|
33 | 33 | required: true |
34 | 34 | clients: |
35 | 35 | type: string |
36 | | - description: "The clients config to use (default: clients/latest.yaml)." |
37 | | - default: "clients/latest.yaml" |
| 36 | + description: "The clients config to use (default: clients/latest-dev.yaml)." |
| 37 | + default: "clients/latest-dev.yaml" |
38 | 38 | kurtosis: |
39 | 39 | type: string |
40 | 40 | description: "The kurtosis network config to use (default: kurtosis-config/default.yaml)." |
|
51 | 51 | type: string |
52 | 52 | description: "The list of assertoor test files to run." |
53 | 53 | required: true |
| 54 | + assertoor_image: |
| 55 | + type: string |
| 56 | + description: "The assertoor image to use (default: ethpandaops/assertoor:master)." |
| 57 | + default: "ethpandaops/assertoor:master" |
54 | 58 | send_notification: |
55 | 59 | type: string |
56 | 60 | description: "Send discord notification on test failure (default: false)." |
|
85 | 89 | CHATGPT_KEY: |
86 | 90 | description: 'ChatGPT Key' |
87 | 91 | required: false |
| 92 | + OPENROUTER_API_KEY: |
| 93 | + description: 'OpenRouter API Key' |
| 94 | + required: false |
88 | 95 | S3_ACCESS_KEY: |
89 | 96 | description: 'S3 Access Key' |
90 | 97 | required: false |
|
99 | 106 | timeout-minutes: 1440 |
100 | 107 | steps: |
101 | 108 | - name: Checkout Repository |
102 | | - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
| 109 | + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 |
103 | 110 |
|
104 | 111 | - name: "Show Inputs" |
105 | 112 | shell: bash |
@@ -246,6 +253,7 @@ jobs: |
246 | 253 | fi |
247 | 254 | fi |
248 | 255 |
|
| 256 | + echo " supernode: true" >> ./temp/participants.yaml |
249 | 257 | echo " count: 1" >> ./temp/participants.yaml |
250 | 258 |
|
251 | 259 | echo "Client $client_idx" |
@@ -288,6 +296,14 @@ jobs: |
288 | 296 | done <<< $(echo "$tests_json" | jq -rc '.[]') |
289 | 297 | echo "$kurtosis_cfg" > ./temp/test-network.yaml |
290 | 298 |
|
| 299 | + # Override assertoor image if provided |
| 300 | + assertoor_image="${{ inputs.assertoor_image }}" |
| 301 | + if ! [ -z "$assertoor_image" ]; then |
| 302 | + echo "Overriding assertoor image to: $assertoor_image" |
| 303 | + kurtosis_cfg="$(cat ./temp/test-network.yaml | yq ".assertoor_params.image = \"$assertoor_image\"")" |
| 304 | + echo "$kurtosis_cfg" > ./temp/test-network.yaml |
| 305 | + fi |
| 306 | +
|
291 | 307 | echo "" |
292 | 308 | cat ./temp/test-network.yaml |
293 | 309 |
|
@@ -441,6 +457,98 @@ jobs: |
441 | 457 |
|
442 | 458 | env: |
443 | 459 | CHATGPT_KEY: ${{ secrets.CHATGPT_KEY }} |
| 460 | + OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }} |
| 461 | + |
| 462 | + - name: Check OpenRouter API key availability |
| 463 | + if: ${{ steps.test_result.outputs.result == 'failure' }} |
| 464 | + id: check_openrouter |
| 465 | + shell: bash |
| 466 | + run: | |
| 467 | + if [ ! -z "$OPENROUTER_API_KEY" ]; then |
| 468 | + echo "has_key=true" >> $GITHUB_OUTPUT |
| 469 | + else |
| 470 | + echo "has_key=false" >> $GITHUB_OUTPUT |
| 471 | + fi |
| 472 | + env: |
| 473 | + OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }} |
| 474 | + |
| 475 | + - name: Generate failure summary via OpenRouter/Gemini (on failure) |
| 476 | + if: ${{ steps.test_result.outputs.result == 'failure' && steps.check_openrouter.outputs.has_key == 'true' }} |
| 477 | + id: openrouter |
| 478 | + shell: bash |
| 479 | + run: | |
| 480 | + test_status=$( |
| 481 | + cat <<"EOF" |
| 482 | + ${{ steps.test_result.outputs.test_overview }} |
| 483 | + EOF |
| 484 | + ) |
| 485 | + failed_test_status=$( |
| 486 | + cat <<"EOF" |
| 487 | + ${{ steps.test_result.outputs.failed_test_details }} |
| 488 | + EOF |
| 489 | + ) |
| 490 | +
|
| 491 | + touch ./temp/openrouter_query.txt |
| 492 | + echo "You will receive the test status & the last 200 lines of logs from the ethereum testnet testing tool assertoor." >> ./temp/openrouter_query.txt |
| 493 | + echo "The status & logs you get are from failed tests. Please find the error, which clients caused it and try summarizing what went wrong for a first technical insight." >> ./temp/openrouter_query.txt |
| 494 | + echo "Assume that assertoor and the test are working fine, so it is probably one or multiple clients causing problems." >> ./temp/openrouter_query.txt |
| 495 | + echo "Your summary should not exceed 500 characters. Use easy language with technical details like client names. Avoid listing block numbers or timestamps." >> ./temp/openrouter_query.txt |
| 496 | + echo "" >> ./temp/openrouter_query.txt |
| 497 | +
|
| 498 | + echo "Client Pairs: (Format: <execution layer client>-<consensus layer client>[-<validator client>], validator client may be left out)" >> ./temp/openrouter_query.txt |
| 499 | + cat ./temp/clients_summary.txt >> ./temp/openrouter_query.txt |
| 500 | + echo "" >> ./temp/openrouter_query.txt |
| 501 | +
|
| 502 | + echo "$test_status" >> ./temp/openrouter_query.txt |
| 503 | + echo "" >> ./temp/openrouter_query.txt |
| 504 | + echo "Failed Test Task Status:" >> ./temp/openrouter_query.txt |
| 505 | + echo "$failed_test_status" >> ./temp/openrouter_query.txt |
| 506 | + echo "" >> ./temp/openrouter_query.txt |
| 507 | +
|
| 508 | + tempdir="${{ steps.enclave_dump.outputs.dump_dir }}" |
| 509 | + tail -n 200 $tempdir/assertoor-*/assertoor--*/output.log >> ./temp/openrouter_query.txt |
| 510 | +
|
| 511 | + query_text="$(cat ./temp/openrouter_query.txt)" |
| 512 | + cp ./temp/openrouter_query.txt $tempdir/openrouter_query.txt |
| 513 | +
|
| 514 | + export QUERY_TEXT=$(echo "$query_text" | jq -R -s '.') |
| 515 | + query_json=$( |
| 516 | + cat <<"EOF" | envsubst | jq -c |
| 517 | + { |
| 518 | + "model": "anthropic/claude-sonnet-4.5", |
| 519 | + "messages": [ |
| 520 | + { |
| 521 | + "role": "user", |
| 522 | + "content": $QUERY_TEXT |
| 523 | + } |
| 524 | + ] |
| 525 | + } |
| 526 | + EOF |
| 527 | + ) |
| 528 | +
|
| 529 | + result=$(curl https://openrouter.ai/api/v1/chat/completions \ |
| 530 | + -H "Content-Type: application/json" \ |
| 531 | + -H "Authorization: Bearer $OPENROUTER_API_KEY" \ |
| 532 | + -H "HTTP-Referer: https://github.com/ethpandaops/assertoor-test" \ |
| 533 | + -H "X-Title: Assertoor Test Runner" \ |
| 534 | + -d "$query_json" |
| 535 | + ) |
| 536 | +
|
| 537 | + echo "OpenRouter/Gemini Summary:" |
| 538 | + summary="$(echo $result | jq -r ".choices[0].message.content")" |
| 539 | + if [ "$summary" == "null" ]; then |
| 540 | + echo "OpenRouter/Gemini failed to generate a summary" |
| 541 | + echo $result | jq |
| 542 | + else |
| 543 | + echo "$summary" > ./temp/openrouter_summary.txt |
| 544 | + fi |
| 545 | +
|
| 546 | + echo "summary<<EOF" >> $GITHUB_OUTPUT |
| 547 | + echo $result | jq -r ".choices[0].message.content" >> $GITHUB_OUTPUT |
| 548 | + echo "EOF" >> $GITHUB_OUTPUT |
| 549 | +
|
| 550 | + env: |
| 551 | + OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }} |
444 | 552 |
|
445 | 553 | - name: Upload dump artifact |
446 | 554 | if: ${{ steps.enclave_dump.outputs.dump_dir != '' }} |
@@ -495,6 +603,17 @@ jobs: |
495 | 603 | echo "$chatgpt_summary" >> $GITHUB_STEP_SUMMARY |
496 | 604 | fi |
497 | 605 |
|
| 606 | + openrouter_summary=$( |
| 607 | + cat <<"EOF" |
| 608 | + ${{ steps.openrouter.outputs.summary }} |
| 609 | + EOF |
| 610 | + ) |
| 611 | + if ! [ -z "$openrouter_summary" ]; then |
| 612 | + echo "" >> $GITHUB_STEP_SUMMARY |
| 613 | + echo "## Summary (OpenRouter/Gemini)" >> $GITHUB_STEP_SUMMARY |
| 614 | + echo "$openrouter_summary" >> $GITHUB_STEP_SUMMARY |
| 615 | + fi |
| 616 | +
|
498 | 617 | echo "" >> $GITHUB_STEP_SUMMARY |
499 | 618 | echo "See job logs and artifacts for more details about this failure." >> $GITHUB_STEP_SUMMARY |
500 | 619 |
|
@@ -545,6 +664,16 @@ jobs: |
545 | 664 | echo "$chatgpt_summary" >> ./temp/notification_text.txt |
546 | 665 | fi |
547 | 666 |
|
| 667 | + openrouter_summary=$( |
| 668 | + cat <<"EOF" |
| 669 | + ${{ steps.openrouter.outputs.summary }} |
| 670 | + EOF |
| 671 | + ) |
| 672 | + if ! [ -z "$openrouter_summary" ]; then |
| 673 | + echo "**Summary: (OpenRouter/Gemini)**" >> ./temp/notification_text.txt |
| 674 | + echo "$openrouter_summary" >> ./temp/notification_text.txt |
| 675 | + fi |
| 676 | +
|
548 | 677 | echo "Resolve job_id..." |
549 | 678 | job_id=$(gh run view ${{ github.run_id }} --json jobs --jq '.jobs[] | select(.name=="${{ github.job }}") | .id') |
550 | 679 |
|
|
0 commit comments