From 4c5d06e39f020fc20c8646fff7ac4be46c490359 Mon Sep 17 00:00:00 2001 From: lukaszcl <120112546+lukaszcl@users.noreply.github.com> Date: Fri, 6 Dec 2024 12:37:18 +0100 Subject: [PATCH 01/41] Refactor flaky test detection reports --- .github/workflows/flakeguard.yml | 141 ++++++++++--------------------- 1 file changed, 44 insertions(+), 97 deletions(-) diff --git a/.github/workflows/flakeguard.yml b/.github/workflows/flakeguard.yml index ecc56e2f291..627828eb26d 100644 --- a/.github/workflows/flakeguard.yml +++ b/.github/workflows/flakeguard.yml @@ -101,7 +101,7 @@ jobs: - name: Install flakeguard shell: bash - run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@9e40f2765df01f20b3bf53f0fb3ead920e3a1f4a # flakguard@0.1.0 + run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@d9043b4d20ecea135a17989eb0f11dcc7085fe2c # flakguard@0.1.0 - name: Find new or updated test packages if: ${{ inputs.runAllTests == false }} @@ -260,7 +260,7 @@ jobs: - name: Install flakeguard shell: bash - run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@9e40f2765df01f20b3bf53f0fb3ead920e3a1f4a # flakguard@0.1.0 + run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@d9043b4d20ecea135a17989eb0f11dcc7085fe2c # flakguard@0.1.0 - name: Run tests with flakeguard shell: bash @@ -282,7 +282,7 @@ jobs: name: Report runs-on: ubuntu-latest outputs: - test_results: ${{ steps.set_test_results.outputs.results }} + test_results: ${{ steps.results.outputs.results }} steps: - name: Checkout repository uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 @@ -307,136 +307,83 @@ jobs: - name: Install flakeguard shell: bash - run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@9e40f2765df01f20b3bf53f0fb3ead920e3a1f4a # flakguard@0.1.0 + run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@d9043b4d20ecea135a17989eb0f11dcc7085fe2c # flakguard@0.1.0 - name: Set combined test results - id: set_test_results + id: results shell: bash run: | set -e # Exit immediately if a command exits with a non-zero status. - if [ -d "ci_test_results" ]; then - cd ci_test_results - ls -R . - - # Fix flakeguard binary path - PATH=$PATH:$(go env GOPATH)/bin - export PATH - - # Use flakeguard to aggregate all test results - flakeguard aggregate-results --results-path . --output-results ../all_tests.json --project-path=${{ github.workspace }}/${{ inputs.projectPath }} --codeowners-path=${{ github.workspace }}/.github/CODEOWNERS - - # Count all tests - ALL_TESTS_COUNT=$(jq '.Results | length' ../all_tests.json) - echo "All tests count: $ALL_TESTS_COUNT" - echo "all_tests_count=$ALL_TESTS_COUNT" >> "$GITHUB_OUTPUT" - - # Use flakeguard to filter and output failed tests based on MaxPassRatio - flakeguard aggregate-results --filter-failed=true --max-pass-ratio=${{ inputs.maxPassRatio }} --results-path . --output-results ../failed_tests.json --output-logs ../failed_test_logs.json --project-path=${{ github.workspace }}/${{ inputs.projectPath }} --codeowners-path=${{ github.workspace }}/.github/CODEOWNERS - - # Count failed tests - if [ -f "../failed_tests.json" ]; then - FAILED_TESTS_COUNT=$(jq '.Results | length' ../failed_tests.json) - else - FAILED_TESTS_COUNT=0 - fi - echo "Failed tests count: $FAILED_TESTS_COUNT" - echo "failed_tests_count=$FAILED_TESTS_COUNT" >> "$GITHUB_OUTPUT" - - # Calculate failed ratio (failed / non-failed tests ratio in %) - if [ "$ALL_TESTS_COUNT" -gt 0 ]; then - NON_FAILED_COUNT=$((ALL_TESTS_COUNT - FAILED_TESTS_COUNT)) - - if [ "$NON_FAILED_COUNT" -gt 0 ]; then - FAILED_RATIO=$(awk "BEGIN {printf \"%.2f\", ($FAILED_TESTS_COUNT / $NON_FAILED_COUNT) * 100}") - else - FAILED_RATIO=0 - fi - else - NON_FAILED_COUNT=0 - FAILED_RATIO=0 - fi - echo "Failed tests ratio: $FAILED_RATIO%" - echo "failed_ratio=$FAILED_RATIO" >> "$GITHUB_OUTPUT" - else - echo "No test results directory found." - echo "all_tests_count=0" >> "$GITHUB_OUTPUT" - echo "failed_tests_count=0" >> "$GITHUB_OUTPUT" - echo "failed_ratio=0" >> "$GITHUB_OUTPUT" - fi + # Create test results folder if it doesn't exist + mkdir -p ci_test_results + + # Fix flakeguard binary path + PATH=$PATH:$(go env GOPATH)/bin + export PATH + + # Combine all test results in a report + flakeguard report --results-path ./ci_test_results --output-path ./flakeguard-report --repo-path=${{ github.workspace }} --codeowners-path=${{ github.workspace }}/.github/CODEOWNERS + + summary=$(cat ./flakeguard-report/all-tests-summary.json) + echo "summary=$summary" >> $GITHUB_OUTPUT - name: Tests Summary - if: ${{ fromJson(steps.set_test_results.outputs.all_tests_count) > 0 }} + if: ${{ fromJSON(steps.results.outputs.summary).total_tests > 0 }} run: | - FILE_SIZE=$(wc -c < all_tests.md) + FILE_SIZE=$(wc -c < ./flakeguard-report/all-tests-summary.md) echo "File size: $FILE_SIZE bytes" SIZE_LIMIT=$((1024 * 1024)) if [ "$FILE_SIZE" -le "$SIZE_LIMIT" ]; then - cat all_tests.md >> $GITHUB_STEP_SUMMARY + cat ./flakeguard-report/all-tests-summary.md >> $GITHUB_STEP_SUMMARY else echo "**We found flaky tests, so many flaky tests that the summary is too large for github actions step summaries!**" >> $GITHUB_STEP_SUMMARY - echo "**Please see logs, or the attached `all-summary.md` artifact**" >> $GITHUB_STEP_SUMMARY - cat all_tests.md + echo "**Please see logs, or the attached `all-tests-summary.md` artifact**" >> $GITHUB_STEP_SUMMARY + cat ./flakeguard-report/all-tests-summary.md fi - name: Upload All Tests Summary as Artifact - if: ${{ fromJson(steps.set_test_results.outputs.all_tests_count) > 0 }} + if: ${{ fromJSON(steps.results.outputs.summary).total_tests > 0 }} uses: actions/upload-artifact@v4.4.3 with: - path: all_tests.md - name: all-summary.md + path: ./flakeguard-report/all-tests-summary.md + name: all-tests-summary.md retention-days: 90 - name: Upload All Test Results as Artifact - if: ${{ fromJson(steps.set_test_results.outputs.all_tests_count) > 0 }} + if: ${{ fromJSON(steps.results.outputs.summary).total_tests > 0 }} uses: actions/upload-artifact@v4.4.3 with: - path: all_tests.json - name: all-test-results.json + path: ./flakeguard-report/all-tests-report.json + name: all-tests-report.json retention-days: 90 - - name: Upload Failed Tests Summary as Artifact - if: ${{ fromJson(steps.set_test_results.outputs.all_tests_count) > 0 }} - uses: actions/upload-artifact@v4.4.3 - with: - path: failed_tests.md - name: failed-summary.md - retention-days: 90 + # - name: Upload Failed Tests Summary as Artifact + # if: ${{ fromJSON(steps.results.outputs.summary).total_tests > 0 }} + # uses: actions/upload-artifact@v4.4.3 + # with: + # path: failed_tests.md + # name: failed-summary.md + # retention-days: 90 - name: Upload Failed Test Results as Artifact - if: ${{ fromJson(steps.set_test_results.outputs.failed_tests_count) > 0 }} + if: ${{ fromJSON(steps.results.outputs.summary).failed_runs > 0 }} uses: actions/upload-artifact@v4.4.3 with: - path: failed_tests.json - name: failed-test-results.json + path: ./flakeguard-report/failed-tests-report.json + name: failed-test-report.json retention-days: 90 - - name: Upload Failed Test Logs as Artifact - if: ${{ fromJson(steps.set_test_results.outputs.failed_tests_count) > 0 }} - uses: actions/upload-artifact@v4.4.3 - with: - path: failed_test_logs.json - name: failed-test-logs.json - retention-days: 90 - - - name: Upload All Test Results as Artifact - if: ${{ fromJson(steps.set_test_results.outputs.all_tests_count) > 0 && env.UPLOAD_ALL_TEST_RESULTS == 'true' }} - uses: actions/upload-artifact@v4.4.3 - with: - path: all_tests.json - name: all-test-results.json - retention-days: 90 - - name: Post comment on PR if flaky tests found - if: ${{ fromJson(steps.set_test_results.outputs.failed_tests_count) > 0 && github.event_name == 'pull_request' }} + if: ${{ fromJSON(steps.results.outputs.summary).flaky_tests > 0 && github.event_name == 'pull_request' }} uses: actions/github-script@v7 continue-on-error: true with: script: | const fs = require('fs'); const prNumber = context.payload.pull_request.number; - const commentBody = fs.readFileSync('all_tests.md', 'utf8'); + const commentBody = fs.readFileSync('./flakeguard-report/all-tests-summary.md', 'utf8'); await github.rest.issues.createComment({ owner: context.repo.owner, @@ -446,7 +393,7 @@ jobs: }); - name: Send Slack message for failed tests - if: ${{ inputs.slackNotificationAfterTestsChannelId != '' && fromJson(steps.set_test_results.outputs.failed_tests_count) > 0 }} + if: ${{ inputs.slackNotificationAfterTestsChannelId != '' && fromJSON(steps.results.outputs.summary).flaky_tests > 0 }} uses: slackapi/slack-github-action@6c661ce58804a1a20f6dc5fbee7f0381b469e001 # v1.25.0 env: SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} @@ -477,11 +424,11 @@ jobs: "fields": [ { "type": "mrkdwn", - "text": "Total Failed Tests: ${{ steps.set_test_results.outputs.failed_tests_count }}" + "text": "Total Flaky Tests: ${{ fromJSON(steps.results.outputs.summary).flaky_tests }}" }, { "type": "mrkdwn", - "text": "Failed to Non-Failed Ratio: ${{ steps.set_test_results.outputs.failed_ratio }}%" + "text": "Flaky Tests Ratio: ${{ fromJSON(steps.results.outputs.summary).flaky_tests_ratio }}" } ] }, @@ -499,7 +446,7 @@ jobs: - name: Send general Slack message uses: slackapi/slack-github-action@6c661ce58804a1a20f6dc5fbee7f0381b469e001 # v1.25.0 - if: ${{ inputs.slackNotificationAfterTestsChannelId != '' && fromJson(steps.set_test_results.outputs.failed_tests_count) == 0 && fromJson(steps.set_test_results.outputs.all_tests_count) > 0 }} + if: ${{ inputs.slackNotificationAfterTestsChannelId != '' && fromJson(steps.results.outputs.failed_tests_count) == 0 && fromJson(steps.results.outputs.all_tests_count) > 0 }} id: slack env: SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} From 078b408f1136a1526bde7202e0c722418b31aace Mon Sep 17 00:00:00 2001 From: lukaszcl <120112546+lukaszcl@users.noreply.github.com> Date: Fri, 6 Dec 2024 12:49:27 +0100 Subject: [PATCH 02/41] fix --- .github/workflows/flakeguard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/flakeguard.yml b/.github/workflows/flakeguard.yml index 627828eb26d..ef6a5c9bc68 100644 --- a/.github/workflows/flakeguard.yml +++ b/.github/workflows/flakeguard.yml @@ -325,7 +325,7 @@ jobs: # Combine all test results in a report flakeguard report --results-path ./ci_test_results --output-path ./flakeguard-report --repo-path=${{ github.workspace }} --codeowners-path=${{ github.workspace }}/.github/CODEOWNERS - summary=$(cat ./flakeguard-report/all-tests-summary.json) + summary=$(jq -c '.' ./flakeguard-report/all-tests-summary.json) echo "summary=$summary" >> $GITHUB_OUTPUT - name: Tests Summary From bf3c8245f3192920e849a122ddd988822238b600 Mon Sep 17 00:00:00 2001 From: lukaszcl <120112546+lukaszcl@users.noreply.github.com> Date: Fri, 6 Dec 2024 12:55:07 +0100 Subject: [PATCH 03/41] fix --- .github/workflows/flakeguard.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/flakeguard.yml b/.github/workflows/flakeguard.yml index ef6a5c9bc68..f557e147681 100644 --- a/.github/workflows/flakeguard.yml +++ b/.github/workflows/flakeguard.yml @@ -393,7 +393,7 @@ jobs: }); - name: Send Slack message for failed tests - if: ${{ inputs.slackNotificationAfterTestsChannelId != '' && fromJSON(steps.results.outputs.summary).flaky_tests > 0 }} + if: ${{ inputs.slackNotificationAfterTestsChannelId != '' && fromJSON(steps.results.outputs.summary).flaky_tests > 0 }} uses: slackapi/slack-github-action@6c661ce58804a1a20f6dc5fbee7f0381b469e001 # v1.25.0 env: SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} @@ -446,7 +446,7 @@ jobs: - name: Send general Slack message uses: slackapi/slack-github-action@6c661ce58804a1a20f6dc5fbee7f0381b469e001 # v1.25.0 - if: ${{ inputs.slackNotificationAfterTestsChannelId != '' && fromJson(steps.results.outputs.failed_tests_count) == 0 && fromJson(steps.results.outputs.all_tests_count) > 0 }} + if: ${{ inputs.slackNotificationAfterTestsChannelId != '' && fromJSON(steps.results.outputs.summary).flaky_tests == 0 && fromJSON(steps.results.outputs.summary).total_tests > 0 }} id: slack env: SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} From 0e74b9ec2ae01407be110151822fdf8ed6de8caf Mon Sep 17 00:00:00 2001 From: lukaszcl <120112546+lukaszcl@users.noreply.github.com> Date: Fri, 6 Dec 2024 12:55:22 +0100 Subject: [PATCH 04/41] fail test --- core/web/resolver/spec_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/web/resolver/spec_test.go b/core/web/resolver/spec_test.go index 69d6a56509c..b0dbfa1aa73 100644 --- a/core/web/resolver/spec_test.go +++ b/core/web/resolver/spec_test.go @@ -42,7 +42,7 @@ func TestResolver_CronSpec(t *testing.T) { Type: job.Cron, CronSpec: &job.CronSpec{ CronSchedule: "CRON_TZ=UTC 0 0 1 1 *", - EVMChainID: ubig.NewI(42), + EVMChainID: ubig.NewI(45), CreatedAt: f.Timestamp(), }, }, nil) From 2966b029da9abc502c2cd99662014e50ba2f9e6d Mon Sep 17 00:00:00 2001 From: lukaszcl <120112546+lukaszcl@users.noreply.github.com> Date: Fri, 6 Dec 2024 13:11:18 +0100 Subject: [PATCH 05/41] fix test --- core/web/resolver/spec_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/web/resolver/spec_test.go b/core/web/resolver/spec_test.go index b0dbfa1aa73..69d6a56509c 100644 --- a/core/web/resolver/spec_test.go +++ b/core/web/resolver/spec_test.go @@ -42,7 +42,7 @@ func TestResolver_CronSpec(t *testing.T) { Type: job.Cron, CronSpec: &job.CronSpec{ CronSchedule: "CRON_TZ=UTC 0 0 1 1 *", - EVMChainID: ubig.NewI(45), + EVMChainID: ubig.NewI(42), CreatedAt: f.Timestamp(), }, }, nil) From 6ada2f2f2f2d20987324a8b5bff456e275e988bd Mon Sep 17 00:00:00 2001 From: lukaszcl <120112546+lukaszcl@users.noreply.github.com> Date: Fri, 6 Dec 2024 13:20:57 +0100 Subject: [PATCH 06/41] add test to fail --- core/web/resolver/failtest/fail_test.go | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 core/web/resolver/failtest/fail_test.go diff --git a/core/web/resolver/failtest/fail_test.go b/core/web/resolver/failtest/fail_test.go new file mode 100644 index 00000000000..9e8d25be356 --- /dev/null +++ b/core/web/resolver/failtest/fail_test.go @@ -0,0 +1,7 @@ +package failtest + +import "testing" + +func TestImmediateFail(t *testing.T) { + t.Fatalf("This test fails immediately.") +} From e3b08a1becd051acdf7752cc20e066ea20040555 Mon Sep 17 00:00:00 2001 From: lukaszcl <120112546+lukaszcl@users.noreply.github.com> Date: Fri, 6 Dec 2024 13:23:07 +0100 Subject: [PATCH 07/41] update pr report --- .github/workflows/flakeguard.yml | 45 +++++++++++++++++++++++--------- 1 file changed, 32 insertions(+), 13 deletions(-) diff --git a/.github/workflows/flakeguard.yml b/.github/workflows/flakeguard.yml index f557e147681..2a5e9664f2d 100644 --- a/.github/workflows/flakeguard.yml +++ b/.github/workflows/flakeguard.yml @@ -101,7 +101,7 @@ jobs: - name: Install flakeguard shell: bash - run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@d9043b4d20ecea135a17989eb0f11dcc7085fe2c # flakguard@0.1.0 + run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@d3a8549a0e5d0ab7f2b3452fe31a7fdfb129ab00 # flakguard@0.1.0 - name: Find new or updated test packages if: ${{ inputs.runAllTests == false }} @@ -260,7 +260,7 @@ jobs: - name: Install flakeguard shell: bash - run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@d9043b4d20ecea135a17989eb0f11dcc7085fe2c # flakguard@0.1.0 + run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@d3a8549a0e5d0ab7f2b3452fe31a7fdfb129ab00 # flakguard@0.1.0 - name: Run tests with flakeguard shell: bash @@ -307,27 +307,46 @@ jobs: - name: Install flakeguard shell: bash - run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@d9043b4d20ecea135a17989eb0f11dcc7085fe2c # flakguard@0.1.0 + run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@d3a8549a0e5d0ab7f2b3452fe31a7fdfb129ab00 # flakguard@0.1.0 - - name: Set combined test results + - name: Generate Flakeguard Report id: results shell: bash run: | set -e # Exit immediately if a command exits with a non-zero status. - + # Create test results folder if it doesn't exist - mkdir -p ci_test_results - + mkdir -p ci_test_results + # Fix flakeguard binary path PATH=$PATH:$(go env GOPATH)/bin export PATH - - # Combine all test results in a report - flakeguard report --results-path ./ci_test_results --output-path ./flakeguard-report --repo-path=${{ github.workspace }} --codeowners-path=${{ github.workspace }}/.github/CODEOWNERS - + + # Generate the Flakeguard report + if [ "${{ github.event_name }}" == "pull_request" ]; then + flakeguard report \ + --results-path ./ci_test_results \ + --output-path ./flakeguard-report \ + --repo-path "${{ github.workspace }}" \ + --codeowners-path "${{ github.workspace }}/.github/CODEOWNERS" \ + --generate-pr-comment \ + --base-branch "${{ inputs.baseRef }}" \ + --current-branch "${{ env.GIT_HEAD_REF }}" \ + --current-commit-sha "${{ needs.get-tests.outputs.git_head_sha }}" \ + --repo-url "${{ inputs.repoUrl }}" \ + --action-run-id "${{ github.run_id }}" + else + flakeguard report \ + --results-path ./ci_test_results \ + --output-path ./flakeguard-report \ + --repo-path "${{ github.workspace }}" \ + --codeowners-path "${{ github.workspace }}/.github/CODEOWNERS" + fi + + # Read the summary from the generated report summary=$(jq -c '.' ./flakeguard-report/all-tests-summary.json) echo "summary=$summary" >> $GITHUB_OUTPUT - + - name: Tests Summary if: ${{ fromJSON(steps.results.outputs.summary).total_tests > 0 }} run: | @@ -383,7 +402,7 @@ jobs: script: | const fs = require('fs'); const prNumber = context.payload.pull_request.number; - const commentBody = fs.readFileSync('./flakeguard-report/all-tests-summary.md', 'utf8'); + const commentBody = fs.readFileSync('./flakeguard-report/all-tests-pr-comment.md', 'utf8'); await github.rest.issues.createComment({ owner: context.repo.owner, From b08d608428b5a64cb97daa878e3ac3f163c5ceeb Mon Sep 17 00:00:00 2001 From: lukaszcl <120112546+lukaszcl@users.noreply.github.com> Date: Fri, 6 Dec 2024 13:24:03 +0100 Subject: [PATCH 08/41] fix --- .github/workflows/flakeguard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/flakeguard.yml b/.github/workflows/flakeguard.yml index 2a5e9664f2d..f48d97332c6 100644 --- a/.github/workflows/flakeguard.yml +++ b/.github/workflows/flakeguard.yml @@ -447,7 +447,7 @@ jobs: }, { "type": "mrkdwn", - "text": "Flaky Tests Ratio: ${{ fromJSON(steps.results.outputs.summary).flaky_tests_ratio }}" + "text": "Flaky Tests Ratio: ${{ fromJSON(steps.results.outputs.summary).flaky_test_ratio }}" } ] }, From ae51d8c7814133802b1b9422100ebd4ad77aed1b Mon Sep 17 00:00:00 2001 From: lukaszcl <120112546+lukaszcl@users.noreply.github.com> Date: Fri, 6 Dec 2024 13:42:21 +0100 Subject: [PATCH 09/41] bump --- .github/workflows/flakeguard.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/flakeguard.yml b/.github/workflows/flakeguard.yml index f48d97332c6..a963a7826ae 100644 --- a/.github/workflows/flakeguard.yml +++ b/.github/workflows/flakeguard.yml @@ -101,7 +101,7 @@ jobs: - name: Install flakeguard shell: bash - run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@d3a8549a0e5d0ab7f2b3452fe31a7fdfb129ab00 # flakguard@0.1.0 + run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@1e6eecca8030d187b90e05175e310fcc8d37f9e4 # flakguard@0.1.0 - name: Find new or updated test packages if: ${{ inputs.runAllTests == false }} @@ -260,7 +260,7 @@ jobs: - name: Install flakeguard shell: bash - run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@d3a8549a0e5d0ab7f2b3452fe31a7fdfb129ab00 # flakguard@0.1.0 + run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@1e6eecca8030d187b90e05175e310fcc8d37f9e4 # flakguard@0.1.0 - name: Run tests with flakeguard shell: bash @@ -307,7 +307,7 @@ jobs: - name: Install flakeguard shell: bash - run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@d3a8549a0e5d0ab7f2b3452fe31a7fdfb129ab00 # flakguard@0.1.0 + run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@1e6eecca8030d187b90e05175e310fcc8d37f9e4 # flakguard@0.1.0 - name: Generate Flakeguard Report id: results From 53760a5288243eaf794714f3ba85809570ac1402 Mon Sep 17 00:00:00 2001 From: lukaszcl <120112546+lukaszcl@users.noreply.github.com> Date: Fri, 6 Dec 2024 13:54:48 +0100 Subject: [PATCH 10/41] pass test --- core/web/resolver/failtest/fail_test.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core/web/resolver/failtest/fail_test.go b/core/web/resolver/failtest/fail_test.go index 9e8d25be356..dcb473c45c2 100644 --- a/core/web/resolver/failtest/fail_test.go +++ b/core/web/resolver/failtest/fail_test.go @@ -2,6 +2,10 @@ package failtest import "testing" -func TestImmediateFail(t *testing.T) { - t.Fatalf("This test fails immediately.") +// func TestImmediateFail(t *testing.T) { +// t.Fatalf("This test fails immediately.") +// } + +func TestPassing(t *testing.T) { + t.Log("This test passes.") } From fd9d72a6963f64e628cade590e68ca9528ee5d4d Mon Sep 17 00:00:00 2001 From: lukaszcl <120112546+lukaszcl@users.noreply.github.com> Date: Fri, 6 Dec 2024 14:09:18 +0100 Subject: [PATCH 11/41] Rename artifacts --- .github/workflows/flakeguard.yml | 48 ++++++++++++++++---------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/.github/workflows/flakeguard.yml b/.github/workflows/flakeguard.yml index a963a7826ae..680adb30b2a 100644 --- a/.github/workflows/flakeguard.yml +++ b/.github/workflows/flakeguard.yml @@ -101,7 +101,7 @@ jobs: - name: Install flakeguard shell: bash - run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@1e6eecca8030d187b90e05175e310fcc8d37f9e4 # flakguard@0.1.0 + run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@6e82b1d547c5ae9c30cd972e88f512a7391404fc # flakguard@0.1.0 - name: Find new or updated test packages if: ${{ inputs.runAllTests == false }} @@ -260,7 +260,7 @@ jobs: - name: Install flakeguard shell: bash - run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@1e6eecca8030d187b90e05175e310fcc8d37f9e4 # flakguard@0.1.0 + run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@6e82b1d547c5ae9c30cd972e88f512a7391404fc # flakguard@0.1.0 - name: Run tests with flakeguard shell: bash @@ -307,7 +307,7 @@ jobs: - name: Install flakeguard shell: bash - run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@1e6eecca8030d187b90e05175e310fcc8d37f9e4 # flakguard@0.1.0 + run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@6e82b1d547c5ae9c30cd972e88f512a7391404fc # flakguard@0.1.0 - name: Generate Flakeguard Report id: results @@ -344,55 +344,55 @@ jobs: fi # Read the summary from the generated report - summary=$(jq -c '.' ./flakeguard-report/all-tests-summary.json) + summary=$(jq -c '.' ./flakeguard-report/all-test-summary.json) echo "summary=$summary" >> $GITHUB_OUTPUT - name: Tests Summary if: ${{ fromJSON(steps.results.outputs.summary).total_tests > 0 }} run: | - FILE_SIZE=$(wc -c < ./flakeguard-report/all-tests-summary.md) + FILE_SIZE=$(wc -c < ./flakeguard-report/all-test-summary.md) echo "File size: $FILE_SIZE bytes" SIZE_LIMIT=$((1024 * 1024)) if [ "$FILE_SIZE" -le "$SIZE_LIMIT" ]; then - cat ./flakeguard-report/all-tests-summary.md >> $GITHUB_STEP_SUMMARY + cat ./flakeguard-report/all-test-summary.md >> $GITHUB_STEP_SUMMARY else echo "**We found flaky tests, so many flaky tests that the summary is too large for github actions step summaries!**" >> $GITHUB_STEP_SUMMARY - echo "**Please see logs, or the attached `all-tests-summary.md` artifact**" >> $GITHUB_STEP_SUMMARY - cat ./flakeguard-report/all-tests-summary.md + echo "**Please see logs, or the attached `all-test-summary.md` artifact**" >> $GITHUB_STEP_SUMMARY + cat ./flakeguard-report/all-test-summary.md fi - name: Upload All Tests Summary as Artifact if: ${{ fromJSON(steps.results.outputs.summary).total_tests > 0 }} uses: actions/upload-artifact@v4.4.3 with: - path: ./flakeguard-report/all-tests-summary.md - name: all-tests-summary.md + path: ./flakeguard-report/all-test-summary.md + name: all-test-summary.md retention-days: 90 - name: Upload All Test Results as Artifact if: ${{ fromJSON(steps.results.outputs.summary).total_tests > 0 }} uses: actions/upload-artifact@v4.4.3 with: - path: ./flakeguard-report/all-tests-report.json - name: all-tests-report.json + path: ./flakeguard-report/all-test-results.json + name: all-test-results.json retention-days: 90 - # - name: Upload Failed Tests Summary as Artifact - # if: ${{ fromJSON(steps.results.outputs.summary).total_tests > 0 }} - # uses: actions/upload-artifact@v4.4.3 - # with: - # path: failed_tests.md - # name: failed-summary.md - # retention-days: 90 - - name: Upload Failed Test Results as Artifact if: ${{ fromJSON(steps.results.outputs.summary).failed_runs > 0 }} uses: actions/upload-artifact@v4.4.3 with: - path: ./flakeguard-report/failed-tests-report.json - name: failed-test-report.json - retention-days: 90 + path: ./flakeguard-report/failed-test-results.json + name: failed-test-results.json + retention-days: 90 + + - name: Upload Failed Test Results With Logs as Artifact + if: ${{ fromJSON(steps.results.outputs.summary).failed_runs > 0 }} + uses: actions/upload-artifact@v4.4.3 + with: + path: ./flakeguard-report/failed-test-results-with-logs.json + name: failed-test-results-with-logs.json + retention-days: 7 - name: Post comment on PR if flaky tests found if: ${{ fromJSON(steps.results.outputs.summary).flaky_tests > 0 && github.event_name == 'pull_request' }} @@ -402,7 +402,7 @@ jobs: script: | const fs = require('fs'); const prNumber = context.payload.pull_request.number; - const commentBody = fs.readFileSync('./flakeguard-report/all-tests-pr-comment.md', 'utf8'); + const commentBody = fs.readFileSync('./flakeguard-report/all-test-pr-comment.md', 'utf8'); await github.rest.issues.createComment({ owner: context.repo.owner, From 4619445b24defdc400504cb664ccf961eb23d52b Mon Sep 17 00:00:00 2001 From: lukaszcl <120112546+lukaszcl@users.noreply.github.com> Date: Fri, 6 Dec 2024 14:09:30 +0100 Subject: [PATCH 12/41] fail test --- core/web/resolver/failtest/fail_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/web/resolver/failtest/fail_test.go b/core/web/resolver/failtest/fail_test.go index dcb473c45c2..f3ff437f2d3 100644 --- a/core/web/resolver/failtest/fail_test.go +++ b/core/web/resolver/failtest/fail_test.go @@ -2,9 +2,9 @@ package failtest import "testing" -// func TestImmediateFail(t *testing.T) { -// t.Fatalf("This test fails immediately.") -// } +func TestImmediateFail(t *testing.T) { + t.Fatalf("This test fails immediately.") +} func TestPassing(t *testing.T) { t.Log("This test passes.") From 11cc43c92f88dc9423b07b7ae2f0072fe7330b6d Mon Sep 17 00:00:00 2001 From: lukaszcl <120112546+lukaszcl@users.noreply.github.com> Date: Fri, 6 Dec 2024 14:25:54 +0100 Subject: [PATCH 13/41] remove test --- core/web/resolver/failtest/fail_test.go | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 core/web/resolver/failtest/fail_test.go diff --git a/core/web/resolver/failtest/fail_test.go b/core/web/resolver/failtest/fail_test.go deleted file mode 100644 index f3ff437f2d3..00000000000 --- a/core/web/resolver/failtest/fail_test.go +++ /dev/null @@ -1,11 +0,0 @@ -package failtest - -import "testing" - -func TestImmediateFail(t *testing.T) { - t.Fatalf("This test fails immediately.") -} - -func TestPassing(t *testing.T) { - t.Log("This test passes.") -} From fcd95788cc4aa570a21ce62fe26a06dc4de7a395 Mon Sep 17 00:00:00 2001 From: lukaszcl <120112546+lukaszcl@users.noreply.github.com> Date: Fri, 6 Dec 2024 14:47:58 +0100 Subject: [PATCH 14/41] bump flakeguard --- .github/workflows/flakeguard.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/flakeguard.yml b/.github/workflows/flakeguard.yml index 680adb30b2a..93ae8726019 100644 --- a/.github/workflows/flakeguard.yml +++ b/.github/workflows/flakeguard.yml @@ -101,7 +101,7 @@ jobs: - name: Install flakeguard shell: bash - run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@6e82b1d547c5ae9c30cd972e88f512a7391404fc # flakguard@0.1.0 + run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@2185a8f65252e998615d9028aba372fcdf86a090 # flakguard@0.1.0 - name: Find new or updated test packages if: ${{ inputs.runAllTests == false }} @@ -260,7 +260,7 @@ jobs: - name: Install flakeguard shell: bash - run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@6e82b1d547c5ae9c30cd972e88f512a7391404fc # flakguard@0.1.0 + run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@2185a8f65252e998615d9028aba372fcdf86a090 # flakguard@0.1.0 - name: Run tests with flakeguard shell: bash @@ -307,7 +307,7 @@ jobs: - name: Install flakeguard shell: bash - run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@6e82b1d547c5ae9c30cd972e88f512a7391404fc # flakguard@0.1.0 + run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@2185a8f65252e998615d9028aba372fcdf86a090 # flakguard@0.1.0 - name: Generate Flakeguard Report id: results From f111e8a9c7d152d52b0d82d313bd06b74aaad017 Mon Sep 17 00:00:00 2001 From: lukaszcl <120112546+lukaszcl@users.noreply.github.com> Date: Fri, 6 Dec 2024 14:49:04 +0100 Subject: [PATCH 15/41] update --- .github/workflows/flakeguard.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/flakeguard.yml b/.github/workflows/flakeguard.yml index 93ae8726019..8d6e35a0dea 100644 --- a/.github/workflows/flakeguard.yml +++ b/.github/workflows/flakeguard.yml @@ -65,7 +65,6 @@ env: ALL_TESTS_RUNNER: ${{ fromJson(inputs.extraArgs)['all_tests_runner'] || 'ubuntu22.04-32cores-128GB' }} # The runner to use for running all tests. DEFAULT_RUNNER: 'ubuntu-latest' # The default runner to use for running tests. UPLOAD_ALL_TEST_RESULTS: ${{ fromJson(inputs.extraArgs)['upload_all_test_results'] || 'false' }} # Whether to upload all test results as artifacts. - PRINT_FAILED_TESTS: ${{ fromJson(inputs.extraArgs)['print_failed_tests'] || 'false' }} # Whether to print failed tests in the GitHub console. jobs: @@ -264,7 +263,7 @@ jobs: - name: Run tests with flakeguard shell: bash - run: flakeguard run --project-path=${{ inputs.projectPath }} --test-packages=${{ matrix.testPackages }} --run-count=${{ env.TEST_REPEAT_COUNT }} --max-pass-ratio=${{ inputs.maxPassRatio }} --race=${{ env.RUN_WITH_RACE }} --shuffle=${{ env.RUN_WITH_SHUFFLE }} --shuffle-seed=${{ env.SHUFFLE_SEED }} --skip-tests=${{ env.SKIPPED_TESTS }} --print-failed-tests=${{ env.PRINT_FAILED_TESTS }} --output-json=test-result.json + run: flakeguard run --project-path=${{ inputs.projectPath }} --test-packages=${{ matrix.testPackages }} --run-count=${{ env.TEST_REPEAT_COUNT }} --max-pass-ratio=${{ inputs.maxPassRatio }} --race=${{ env.RUN_WITH_RACE }} --shuffle=${{ env.RUN_WITH_SHUFFLE }} --shuffle-seed=${{ env.SHUFFLE_SEED }} --skip-tests=${{ env.SKIPPED_TESTS }} --output-json=test-result.json env: CL_DATABASE_URL: ${{ env.DB_URL }} From e47f350e7ecef61ad2b6991c822cf0d0e474eb8b Mon Sep 17 00:00:00 2001 From: lukaszcl <120112546+lukaszcl@users.noreply.github.com> Date: Fri, 6 Dec 2024 17:28:34 +0100 Subject: [PATCH 16/41] bump --- .github/workflows/flakeguard.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/flakeguard.yml b/.github/workflows/flakeguard.yml index 8d6e35a0dea..265c7989d13 100644 --- a/.github/workflows/flakeguard.yml +++ b/.github/workflows/flakeguard.yml @@ -100,7 +100,7 @@ jobs: - name: Install flakeguard shell: bash - run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@2185a8f65252e998615d9028aba372fcdf86a090 # flakguard@0.1.0 + run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@04f007a3d78c45f46674dc01bee83f655c957013 # flakguard@0.1.0 - name: Find new or updated test packages if: ${{ inputs.runAllTests == false }} @@ -259,7 +259,7 @@ jobs: - name: Install flakeguard shell: bash - run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@2185a8f65252e998615d9028aba372fcdf86a090 # flakguard@0.1.0 + run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@04f007a3d78c45f46674dc01bee83f655c957013 # flakguard@0.1.0 - name: Run tests with flakeguard shell: bash @@ -306,7 +306,7 @@ jobs: - name: Install flakeguard shell: bash - run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@2185a8f65252e998615d9028aba372fcdf86a090 # flakguard@0.1.0 + run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@04f007a3d78c45f46674dc01bee83f655c957013 # flakguard@0.1.0 - name: Generate Flakeguard Report id: results From 459c7b01f71b086bf5579d65393485242f5eaa25 Mon Sep 17 00:00:00 2001 From: lukaszcl <120112546+lukaszcl@users.noreply.github.com> Date: Fri, 6 Dec 2024 17:52:41 +0100 Subject: [PATCH 17/41] bump --- .github/workflows/flakeguard.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/flakeguard.yml b/.github/workflows/flakeguard.yml index 265c7989d13..5f281506c36 100644 --- a/.github/workflows/flakeguard.yml +++ b/.github/workflows/flakeguard.yml @@ -100,7 +100,7 @@ jobs: - name: Install flakeguard shell: bash - run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@04f007a3d78c45f46674dc01bee83f655c957013 # flakguard@0.1.0 + run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@084ceff0f5d939438f850c5f9bbb2d6d37400f1c # flakguard@0.1.0 - name: Find new or updated test packages if: ${{ inputs.runAllTests == false }} @@ -259,7 +259,7 @@ jobs: - name: Install flakeguard shell: bash - run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@04f007a3d78c45f46674dc01bee83f655c957013 # flakguard@0.1.0 + run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@084ceff0f5d939438f850c5f9bbb2d6d37400f1c # flakguard@0.1.0 - name: Run tests with flakeguard shell: bash @@ -306,7 +306,7 @@ jobs: - name: Install flakeguard shell: bash - run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@04f007a3d78c45f46674dc01bee83f655c957013 # flakguard@0.1.0 + run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@084ceff0f5d939438f850c5f9bbb2d6d37400f1c # flakguard@0.1.0 - name: Generate Flakeguard Report id: results From f38818aba7281be22ed1d9d09cc8014b98a097f9 Mon Sep 17 00:00:00 2001 From: lukaszcl <120112546+lukaszcl@users.noreply.github.com> Date: Fri, 6 Dec 2024 19:54:45 +0100 Subject: [PATCH 18/41] bump flakeguard --- .github/workflows/flakeguard.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/flakeguard.yml b/.github/workflows/flakeguard.yml index 5f281506c36..7524377b756 100644 --- a/.github/workflows/flakeguard.yml +++ b/.github/workflows/flakeguard.yml @@ -100,7 +100,7 @@ jobs: - name: Install flakeguard shell: bash - run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@084ceff0f5d939438f850c5f9bbb2d6d37400f1c # flakguard@0.1.0 + run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@1540a1b52ecbac49717a8d948863f9f9327d70c4 # flakguard@0.1.0 - name: Find new or updated test packages if: ${{ inputs.runAllTests == false }} @@ -259,7 +259,7 @@ jobs: - name: Install flakeguard shell: bash - run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@084ceff0f5d939438f850c5f9bbb2d6d37400f1c # flakguard@0.1.0 + run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@1540a1b52ecbac49717a8d948863f9f9327d70c4 # flakguard@0.1.0 - name: Run tests with flakeguard shell: bash @@ -306,7 +306,7 @@ jobs: - name: Install flakeguard shell: bash - run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@084ceff0f5d939438f850c5f9bbb2d6d37400f1c # flakguard@0.1.0 + run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@1540a1b52ecbac49717a8d948863f9f9327d70c4 # flakguard@0.1.0 - name: Generate Flakeguard Report id: results From 6d305eaa5d3bd4b100f4b1a7c478c9e2c270a7cc Mon Sep 17 00:00:00 2001 From: lukaszcl <120112546+lukaszcl@users.noreply.github.com> Date: Mon, 9 Dec 2024 10:42:43 +0100 Subject: [PATCH 19/41] bump flakeguard report runner --- .github/workflows/flakeguard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/flakeguard.yml b/.github/workflows/flakeguard.yml index 7524377b756..1aa5713f27d 100644 --- a/.github/workflows/flakeguard.yml +++ b/.github/workflows/flakeguard.yml @@ -279,7 +279,7 @@ jobs: needs: [get-tests, run-tests] if: always() name: Report - runs-on: ubuntu-latest + runs-on: ubuntu-24.04-8cores-32GB-ARM # Use a runner with more resources to avoid OOM errors when aggregating test results. outputs: test_results: ${{ steps.results.outputs.results }} steps: From 7213d1aa439a57833626f4adaa1750e13f80c4f6 Mon Sep 17 00:00:00 2001 From: lukaszcl <120112546+lukaszcl@users.noreply.github.com> Date: Mon, 9 Dec 2024 10:43:42 +0100 Subject: [PATCH 20/41] fail test to check flakeguard reports --- core/web/resolver/failtest/fail_test.go | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 core/web/resolver/failtest/fail_test.go diff --git a/core/web/resolver/failtest/fail_test.go b/core/web/resolver/failtest/fail_test.go new file mode 100644 index 00000000000..f3ff437f2d3 --- /dev/null +++ b/core/web/resolver/failtest/fail_test.go @@ -0,0 +1,11 @@ +package failtest + +import "testing" + +func TestImmediateFail(t *testing.T) { + t.Fatalf("This test fails immediately.") +} + +func TestPassing(t *testing.T) { + t.Log("This test passes.") +} From 3cca09aa43f37e7d0db68614fc34c8426448e263 Mon Sep 17 00:00:00 2001 From: lukaszcl <120112546+lukaszcl@users.noreply.github.com> Date: Mon, 9 Dec 2024 10:52:53 +0100 Subject: [PATCH 21/41] Increase flakeguard nightly test runs from 15 to 50 --- .github/workflows/flakeguard-nightly.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/flakeguard-nightly.yml b/.github/workflows/flakeguard-nightly.yml index 37c00fa0a8f..67ca5f2f8c8 100644 --- a/.github/workflows/flakeguard-nightly.yml +++ b/.github/workflows/flakeguard-nightly.yml @@ -16,7 +16,7 @@ jobs: projectPath: '.' maxPassRatio: '1.0' runAllTests: true - extraArgs: '{ "skipped_tests": "TestChainComponents", "test_repeat_count": "5", "all_tests_runner": "ubuntu22.04-32cores-128GB", "all_tests_runner_count": "3", "run_with_race": "false" }' + extraArgs: '{ "skipped_tests": "TestChainComponents", "test_repeat_count": "10", "all_tests_runner": "ubuntu22.04-32cores-128GB", "all_tests_runner_count": "5", "run_with_race": "false" }' slackNotificationAfterTestsChannelId: 'C07TRF65CNS' #flaky-test-detector-notifications secrets: SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} From e387d3df5baa6cce28451c0b9d580f0822de3951 Mon Sep 17 00:00:00 2001 From: lukaszcl <120112546+lukaszcl@users.noreply.github.com> Date: Mon, 9 Dec 2024 10:53:07 +0100 Subject: [PATCH 22/41] Add step to get url to failed tests artifact --- .github/workflows/flakeguard.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.github/workflows/flakeguard.yml b/.github/workflows/flakeguard.yml index 1aa5713f27d..8c8543efcd4 100644 --- a/.github/workflows/flakeguard.yml +++ b/.github/workflows/flakeguard.yml @@ -393,6 +393,23 @@ jobs: name: failed-test-results-with-logs.json retention-days: 7 + - name: Get Failed Test Results Artifact URL + id: failed-test-results-url + run: | + ARTIFACT_NAME="failed-test-results-with-logs.json" + RUN_ID=${{ github.run_id }} + API_URL="https://api.github.com/repos/${{ github.repository }}/actions/runs/$RUN_ID/artifacts" + ARTIFACT_ID=$(curl -s -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" $API_URL | jq -r ".artifacts[] | select(.name==\"$ARTIFACT_NAME\") | .id") + ARTIFACT_URL="https://github.com/${{ github.repository }}/suites/${{ github.run_id }}/artifacts/$ARTIFACT_ID" + echo "artifact-url=$ARTIFACT_URL" >> $GITHUB_OUTPUT + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Output Failed Test Results Artifact URL + run: | + echo "Artifact URL for failed-test-results-with-logs.json: ${{ steps.failed-test-results-url.outputs.artifact-url }}" + + - name: Post comment on PR if flaky tests found if: ${{ fromJSON(steps.results.outputs.summary).flaky_tests > 0 && github.event_name == 'pull_request' }} uses: actions/github-script@v7 From 41e8e1d2dd4c27e70687b322daad7518288e9b71 Mon Sep 17 00:00:00 2001 From: lukaszcl <120112546+lukaszcl@users.noreply.github.com> Date: Mon, 9 Dec 2024 11:08:54 +0100 Subject: [PATCH 23/41] bump timeout --- .github/workflows/flakeguard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/flakeguard.yml b/.github/workflows/flakeguard.yml index 8c8543efcd4..93bbc5f2661 100644 --- a/.github/workflows/flakeguard.yml +++ b/.github/workflows/flakeguard.yml @@ -195,7 +195,7 @@ jobs: needs: get-tests runs-on: ${{ matrix.runs_on }} if: ${{ needs.get-tests.outputs.matrix != '' && needs.get-tests.outputs.matrix != '[]' }} - timeout-minutes: 90 + timeout-minutes: 180 strategy: fail-fast: false matrix: From 292785a172060671347f536edf3d03664767a913 Mon Sep 17 00:00:00 2001 From: lukaszcl <120112546+lukaszcl@users.noreply.github.com> Date: Mon, 9 Dec 2024 13:04:25 +0100 Subject: [PATCH 24/41] bump flakeguard --- .github/workflows/flakeguard.yml | 117 +++++++++++++++++-------------- 1 file changed, 64 insertions(+), 53 deletions(-) diff --git a/.github/workflows/flakeguard.yml b/.github/workflows/flakeguard.yml index 93bbc5f2661..3a6c8aa5a8b 100644 --- a/.github/workflows/flakeguard.yml +++ b/.github/workflows/flakeguard.yml @@ -100,7 +100,7 @@ jobs: - name: Install flakeguard shell: bash - run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@1540a1b52ecbac49717a8d948863f9f9327d70c4 # flakguard@0.1.0 + run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@66533339e44b0fe816a880d97e259682819d4668 # flakguard@0.1.0 - name: Find new or updated test packages if: ${{ inputs.runAllTests == false }} @@ -259,7 +259,7 @@ jobs: - name: Install flakeguard shell: bash - run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@1540a1b52ecbac49717a8d948863f9f9327d70c4 # flakguard@0.1.0 + run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@66533339e44b0fe816a880d97e259682819d4668 # flakguard@0.1.0 - name: Run tests with flakeguard shell: bash @@ -306,9 +306,9 @@ jobs: - name: Install flakeguard shell: bash - run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@1540a1b52ecbac49717a8d948863f9f9327d70c4 # flakguard@0.1.0 + run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@66533339e44b0fe816a880d97e259682819d4668 # flakguard@0.1.0 - - name: Generate Flakeguard Report + - name: Aggregate Flakeguard Results id: results shell: bash run: | @@ -321,45 +321,17 @@ jobs: PATH=$PATH:$(go env GOPATH)/bin export PATH - # Generate the Flakeguard report - if [ "${{ github.event_name }}" == "pull_request" ]; then - flakeguard report \ - --results-path ./ci_test_results \ - --output-path ./flakeguard-report \ - --repo-path "${{ github.workspace }}" \ - --codeowners-path "${{ github.workspace }}/.github/CODEOWNERS" \ - --generate-pr-comment \ - --base-branch "${{ inputs.baseRef }}" \ - --current-branch "${{ env.GIT_HEAD_REF }}" \ - --current-commit-sha "${{ needs.get-tests.outputs.git_head_sha }}" \ - --repo-url "${{ inputs.repoUrl }}" \ - --action-run-id "${{ github.run_id }}" - else - flakeguard report \ - --results-path ./ci_test_results \ - --output-path ./flakeguard-report \ - --repo-path "${{ github.workspace }}" \ - --codeowners-path "${{ github.workspace }}/.github/CODEOWNERS" - fi - + # Aggregate Flakeguard test results + flakeguard aggregate-results \ + --results-path ./ci_test_results \ + --output-path ./flakeguard-report \ + --repo-path "${{ github.workspace }}" \ + --codeowners-path "${{ github.workspace }}/.github/CODEOWNERS" \ + --max-pass-ratio "${{ inputs.maxPassRatio }}" + # Read the summary from the generated report summary=$(jq -c '.' ./flakeguard-report/all-test-summary.json) echo "summary=$summary" >> $GITHUB_OUTPUT - - - name: Tests Summary - if: ${{ fromJSON(steps.results.outputs.summary).total_tests > 0 }} - run: | - FILE_SIZE=$(wc -c < ./flakeguard-report/all-test-summary.md) - echo "File size: $FILE_SIZE bytes" - SIZE_LIMIT=$((1024 * 1024)) - - if [ "$FILE_SIZE" -le "$SIZE_LIMIT" ]; then - cat ./flakeguard-report/all-test-summary.md >> $GITHUB_STEP_SUMMARY - else - echo "**We found flaky tests, so many flaky tests that the summary is too large for github actions step summaries!**" >> $GITHUB_STEP_SUMMARY - echo "**Please see logs, or the attached `all-test-summary.md` artifact**" >> $GITHUB_STEP_SUMMARY - cat ./flakeguard-report/all-test-summary.md - fi - name: Upload All Tests Summary as Artifact if: ${{ fromJSON(steps.results.outputs.summary).total_tests > 0 }} @@ -393,22 +365,61 @@ jobs: name: failed-test-results-with-logs.json retention-days: 7 - - name: Get Failed Test Results Artifact URL - id: failed-test-results-url + - name: Generate Flakeguard Reports + shell: bash run: | - ARTIFACT_NAME="failed-test-results-with-logs.json" - RUN_ID=${{ github.run_id }} - API_URL="https://api.github.com/repos/${{ github.repository }}/actions/runs/$RUN_ID/artifacts" - ARTIFACT_ID=$(curl -s -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" $API_URL | jq -r ".artifacts[] | select(.name==\"$ARTIFACT_NAME\") | .id") - ARTIFACT_URL="https://github.com/${{ github.repository }}/suites/${{ github.run_id }}/artifacts/$ARTIFACT_ID" - echo "artifact-url=$ARTIFACT_URL" >> $GITHUB_OUTPUT - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + set -e # Exit immediately if a command exits with a non-zero status. - - name: Output Failed Test Results Artifact URL - run: | - echo "Artifact URL for failed-test-results-with-logs.json: ${{ steps.failed-test-results-url.outputs.artifact-url }}" + # Fix flakeguard binary path + PATH=$PATH:$(go env GOPATH)/bin + export PATH + # Check if the event is a pull request + if [ "${{ github.event_name }}" = "pull_request" ]; then + flakeguard generate-report \ + --aggregated-results-path ./flakeguard-report/all-test-results.json \ + --summary-path ./flakeguard-report/all-test-summary.json \ + --output-path ./flakeguard-report \ + --github-repository "${{ github.repository }}" \ + --github-run-id "${{ github.run_id }}" \ + --failed-tests-artifact-name "failed-test-results-with-logs.json" \ + --generate-pr-comment \ + --base-branch "${{ github.event.pull_request.base.ref }}" \ + --current-branch "${{ github.head_ref }}" \ + --current-commit-sha "${{ github.event.pull_request.head.sha }}" \ + --repo-url "https://github.com/${{ github.repository }}" \ + --action-run-id "${{ github.run_id }}" \ + --max-pass-ratio "${{ inputs.maxPassRatio }}" + else + flakeguard generate-report \ + --aggregated-results-path ./flakeguard-report/all-test-results.json \ + --summary-path ./flakeguard-report/all-test-summary.json \ + --output-path ./flakeguard-report \ + --github-repository "${{ github.repository }}" \ + --github-run-id "${{ github.run_id }}" \ + --failed-tests-artifact-name "failed-test-results-with-logs.json" \ + --base-branch "${{ github.event.pull_request.base.ref }}" \ + --current-branch "${{ github.head_ref }}" \ + --current-commit-sha "${{ github.event.pull_request.head.sha }}" \ + --repo-url "https://github.com/${{ github.repository }}" \ + --action-run-id "${{ github.run_id }}" \ + --max-pass-ratio "${{ inputs.maxPassRatio }}" + fi + + - name: Add Github Summary + if: ${{ fromJSON(steps.results.outputs.summary).total_tests > 0 }} + run: | + FILE_SIZE=$(wc -c < ./flakeguard-report/all-test-summary.md) + echo "File size: $FILE_SIZE bytes" + SIZE_LIMIT=$((1024 * 1024)) + + if [ "$FILE_SIZE" -le "$SIZE_LIMIT" ]; then + cat ./flakeguard-report/all-test-summary.md >> $GITHUB_STEP_SUMMARY + else + echo "**We found flaky tests, so many flaky tests that the summary is too large for github actions step summaries!**" >> $GITHUB_STEP_SUMMARY + echo "**Please see logs, or the attached `all-test-summary.md` artifact**" >> $GITHUB_STEP_SUMMARY + cat ./flakeguard-report/all-test-summary.md + fi - name: Post comment on PR if flaky tests found if: ${{ fromJSON(steps.results.outputs.summary).flaky_tests > 0 && github.event_name == 'pull_request' }} From 872a2dc8484b5d68aa608bacf0630f520db92e79 Mon Sep 17 00:00:00 2001 From: lukaszcl <120112546+lukaszcl@users.noreply.github.com> Date: Mon, 9 Dec 2024 13:04:39 +0100 Subject: [PATCH 25/41] to revert: disable slack notification --- .github/workflows/flakeguard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/flakeguard.yml b/.github/workflows/flakeguard.yml index 3a6c8aa5a8b..e22a6b8e3ec 100644 --- a/.github/workflows/flakeguard.yml +++ b/.github/workflows/flakeguard.yml @@ -439,7 +439,7 @@ jobs: }); - name: Send Slack message for failed tests - if: ${{ inputs.slackNotificationAfterTestsChannelId != '' && fromJSON(steps.results.outputs.summary).flaky_tests > 0 }} + # if: ${{ inputs.slackNotificationAfterTestsChannelId != '' && fromJSON(steps.results.outputs.summary).flaky_tests > 0 }} uses: slackapi/slack-github-action@6c661ce58804a1a20f6dc5fbee7f0381b469e001 # v1.25.0 env: SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} From 268fb98e126b44aaa2063b3e6860815d5902941a Mon Sep 17 00:00:00 2001 From: lukaszcl <120112546+lukaszcl@users.noreply.github.com> Date: Mon, 9 Dec 2024 13:26:01 +0100 Subject: [PATCH 26/41] Add GITHUB_TOKEN secret --- .github/workflows/ci-core.yml | 2 ++ .github/workflows/flakeguard.yml | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/.github/workflows/ci-core.yml b/.github/workflows/ci-core.yml index c38ecd918ae..0a6c598360c 100644 --- a/.github/workflows/ci-core.yml +++ b/.github/workflows/ci-core.yml @@ -466,6 +466,7 @@ jobs: extraArgs: '{ "skipped_tests": "TestChainComponents", "run_with_race": "true", "print_failed_tests": "true", "test_repeat_count": "3", "min_pass_ratio": "0.01" }' secrets: SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} trigger-flaky-test-detection-for-deployment-project: name: Flakeguard Deployment Project @@ -484,6 +485,7 @@ jobs: extraArgs: '{ "skipped_tests": "TestAddLane", "run_with_race": "true", "print_failed_tests": "true", "test_repeat_count": "3", "min_pass_ratio": "0.01" }' secrets: SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} clean: name: Clean Go Tidy & Generate diff --git a/.github/workflows/flakeguard.yml b/.github/workflows/flakeguard.yml index e22a6b8e3ec..89b233626b0 100644 --- a/.github/workflows/flakeguard.yml +++ b/.github/workflows/flakeguard.yml @@ -52,6 +52,8 @@ on: secrets: SLACK_BOT_TOKEN: required: false + GITHUB_TOKEN: + required: true env: GIT_HEAD_REF: ${{ inputs.headRef || github.ref }} @@ -367,6 +369,8 @@ jobs: - name: Generate Flakeguard Reports shell: bash + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | set -e # Exit immediately if a command exits with a non-zero status. From 9a02983d1567ed84180f1657ac6b453cc0bc5080 Mon Sep 17 00:00:00 2001 From: lukaszcl <120112546+lukaszcl@users.noreply.github.com> Date: Mon, 9 Dec 2024 13:26:41 +0100 Subject: [PATCH 27/41] add missing secret --- .github/workflows/flakeguard-nightly.yml | 1 + .github/workflows/flakeguard-on-demand.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/flakeguard-nightly.yml b/.github/workflows/flakeguard-nightly.yml index 67ca5f2f8c8..fb57e006492 100644 --- a/.github/workflows/flakeguard-nightly.yml +++ b/.github/workflows/flakeguard-nightly.yml @@ -20,3 +20,4 @@ jobs: slackNotificationAfterTestsChannelId: 'C07TRF65CNS' #flaky-test-detector-notifications secrets: SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/flakeguard-on-demand.yml b/.github/workflows/flakeguard-on-demand.yml index fe972894594..cd6ec1abbbc 100644 --- a/.github/workflows/flakeguard-on-demand.yml +++ b/.github/workflows/flakeguard-on-demand.yml @@ -69,4 +69,5 @@ jobs: extraArgs: ${{ inputs.extraArgs }} secrets: SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file From 1fdfd7a7b047769642c9a749c4cb2e1ad0a5c458 Mon Sep 17 00:00:00 2001 From: lukaszcl <120112546+lukaszcl@users.noreply.github.com> Date: Mon, 9 Dec 2024 13:34:54 +0100 Subject: [PATCH 28/41] fix --- .github/workflows/ci-core.yml | 4 ++-- .github/workflows/flakeguard-nightly.yml | 3 ++- .github/workflows/flakeguard-on-demand.yml | 2 +- .github/workflows/flakeguard.yml | 4 ++-- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci-core.yml b/.github/workflows/ci-core.yml index 0a6c598360c..9134a8c9b56 100644 --- a/.github/workflows/ci-core.yml +++ b/.github/workflows/ci-core.yml @@ -466,7 +466,7 @@ jobs: extraArgs: '{ "skipped_tests": "TestChainComponents", "run_with_race": "true", "print_failed_tests": "true", "test_repeat_count": "3", "min_pass_ratio": "0.01" }' secrets: SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} trigger-flaky-test-detection-for-deployment-project: name: Flakeguard Deployment Project @@ -485,7 +485,7 @@ jobs: extraArgs: '{ "skipped_tests": "TestAddLane", "run_with_race": "true", "print_failed_tests": "true", "test_repeat_count": "3", "min_pass_ratio": "0.01" }' secrets: SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} clean: name: Clean Go Tidy & Generate diff --git a/.github/workflows/flakeguard-nightly.yml b/.github/workflows/flakeguard-nightly.yml index fb57e006492..5a7cc8230fe 100644 --- a/.github/workflows/flakeguard-nightly.yml +++ b/.github/workflows/flakeguard-nightly.yml @@ -20,4 +20,5 @@ jobs: slackNotificationAfterTestsChannelId: 'C07TRF65CNS' #flaky-test-detector-notifications secrets: SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + diff --git a/.github/workflows/flakeguard-on-demand.yml b/.github/workflows/flakeguard-on-demand.yml index cd6ec1abbbc..0ba84c5ab58 100644 --- a/.github/workflows/flakeguard-on-demand.yml +++ b/.github/workflows/flakeguard-on-demand.yml @@ -69,5 +69,5 @@ jobs: extraArgs: ${{ inputs.extraArgs }} secrets: SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/flakeguard.yml b/.github/workflows/flakeguard.yml index 89b233626b0..856beb1b812 100644 --- a/.github/workflows/flakeguard.yml +++ b/.github/workflows/flakeguard.yml @@ -52,7 +52,7 @@ on: secrets: SLACK_BOT_TOKEN: required: false - GITHUB_TOKEN: + GH_TOKEN: required: true env: @@ -370,7 +370,7 @@ jobs: - name: Generate Flakeguard Reports shell: bash env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} run: | set -e # Exit immediately if a command exits with a non-zero status. From 396793bb7576ff2401546c0d8a51c6ec9c578d36 Mon Sep 17 00:00:00 2001 From: lukaszcl <120112546+lukaszcl@users.noreply.github.com> Date: Mon, 9 Dec 2024 14:08:36 +0100 Subject: [PATCH 29/41] temp: update nightly --- .github/workflows/flakeguard-nightly.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/flakeguard-nightly.yml b/.github/workflows/flakeguard-nightly.yml index 5a7cc8230fe..9c75131c652 100644 --- a/.github/workflows/flakeguard-nightly.yml +++ b/.github/workflows/flakeguard-nightly.yml @@ -16,7 +16,7 @@ jobs: projectPath: '.' maxPassRatio: '1.0' runAllTests: true - extraArgs: '{ "skipped_tests": "TestChainComponents", "test_repeat_count": "10", "all_tests_runner": "ubuntu22.04-32cores-128GB", "all_tests_runner_count": "5", "run_with_race": "false" }' + extraArgs: '{ "skipped_tests": "TestChainComponents", "test_repeat_count": "1", "all_tests_runner": "ubuntu22.04-32cores-128GB", "all_tests_runner_count": "3", "run_with_race": "false" }' slackNotificationAfterTestsChannelId: 'C07TRF65CNS' #flaky-test-detector-notifications secrets: SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} From 7ecf4206b1a50ab688edb130edb684784c6328f8 Mon Sep 17 00:00:00 2001 From: lukaszcl <120112546+lukaszcl@users.noreply.github.com> Date: Mon, 9 Dec 2024 14:09:00 +0100 Subject: [PATCH 30/41] Revert "temp: update nightly" This reverts commit 396793bb7576ff2401546c0d8a51c6ec9c578d36. --- .github/workflows/flakeguard-nightly.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/flakeguard-nightly.yml b/.github/workflows/flakeguard-nightly.yml index 9c75131c652..5a7cc8230fe 100644 --- a/.github/workflows/flakeguard-nightly.yml +++ b/.github/workflows/flakeguard-nightly.yml @@ -16,7 +16,7 @@ jobs: projectPath: '.' maxPassRatio: '1.0' runAllTests: true - extraArgs: '{ "skipped_tests": "TestChainComponents", "test_repeat_count": "1", "all_tests_runner": "ubuntu22.04-32cores-128GB", "all_tests_runner_count": "3", "run_with_race": "false" }' + extraArgs: '{ "skipped_tests": "TestChainComponents", "test_repeat_count": "10", "all_tests_runner": "ubuntu22.04-32cores-128GB", "all_tests_runner_count": "5", "run_with_race": "false" }' slackNotificationAfterTestsChannelId: 'C07TRF65CNS' #flaky-test-detector-notifications secrets: SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} From 5a6ab25b7b142bff30c6e6b6eaf471012cf439f7 Mon Sep 17 00:00:00 2001 From: lukaszcl <120112546+lukaszcl@users.noreply.github.com> Date: Mon, 9 Dec 2024 14:30:39 +0100 Subject: [PATCH 31/41] print out flakeguard summary file --- .github/workflows/flakeguard.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/flakeguard.yml b/.github/workflows/flakeguard.yml index 856beb1b812..5a869c036bf 100644 --- a/.github/workflows/flakeguard.yml +++ b/.github/workflows/flakeguard.yml @@ -331,6 +331,10 @@ jobs: --codeowners-path "${{ github.workspace }}/.github/CODEOWNERS" \ --max-pass-ratio "${{ inputs.maxPassRatio }}" + # Print out the summary file + echo "Flakeguard Summary:" + cat ./flakeguard-report/all-test-summary.json + # Read the summary from the generated report summary=$(jq -c '.' ./flakeguard-report/all-test-summary.json) echo "summary=$summary" >> $GITHUB_OUTPUT From 4c922294549de908b92df47f40f615bf7456283e Mon Sep 17 00:00:00 2001 From: lukaszcl <120112546+lukaszcl@users.noreply.github.com> Date: Mon, 9 Dec 2024 14:35:04 +0100 Subject: [PATCH 32/41] bump --- .github/workflows/flakeguard.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/flakeguard.yml b/.github/workflows/flakeguard.yml index 5a869c036bf..c0750da9397 100644 --- a/.github/workflows/flakeguard.yml +++ b/.github/workflows/flakeguard.yml @@ -102,7 +102,7 @@ jobs: - name: Install flakeguard shell: bash - run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@66533339e44b0fe816a880d97e259682819d4668 # flakguard@0.1.0 + run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@34fa8f2dab51f7cfd24fadec57c78978876c9a10 # flakguard@0.1.0 - name: Find new or updated test packages if: ${{ inputs.runAllTests == false }} @@ -261,7 +261,7 @@ jobs: - name: Install flakeguard shell: bash - run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@66533339e44b0fe816a880d97e259682819d4668 # flakguard@0.1.0 + run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@34fa8f2dab51f7cfd24fadec57c78978876c9a10 # flakguard@0.1.0 - name: Run tests with flakeguard shell: bash @@ -308,7 +308,7 @@ jobs: - name: Install flakeguard shell: bash - run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@66533339e44b0fe816a880d97e259682819d4668 # flakguard@0.1.0 + run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@34fa8f2dab51f7cfd24fadec57c78978876c9a10 # flakguard@0.1.0 - name: Aggregate Flakeguard Results id: results From d0b8f3396de0eb8b1a2a1525fea191cf4091080e Mon Sep 17 00:00:00 2001 From: lukaszcl <120112546+lukaszcl@users.noreply.github.com> Date: Mon, 9 Dec 2024 14:35:20 +0100 Subject: [PATCH 33/41] remove fail_test.go --- core/web/resolver/failtest/fail_test.go | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 core/web/resolver/failtest/fail_test.go diff --git a/core/web/resolver/failtest/fail_test.go b/core/web/resolver/failtest/fail_test.go deleted file mode 100644 index f3ff437f2d3..00000000000 --- a/core/web/resolver/failtest/fail_test.go +++ /dev/null @@ -1,11 +0,0 @@ -package failtest - -import "testing" - -func TestImmediateFail(t *testing.T) { - t.Fatalf("This test fails immediately.") -} - -func TestPassing(t *testing.T) { - t.Log("This test passes.") -} From 82f6e35e05225bd381d489e7fc6b0381573529f5 Mon Sep 17 00:00:00 2001 From: lukaszcl <120112546+lukaszcl@users.noreply.github.com> Date: Mon, 9 Dec 2024 14:43:53 +0100 Subject: [PATCH 34/41] Fix --- .github/workflows/flakeguard.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/flakeguard.yml b/.github/workflows/flakeguard.yml index c0750da9397..35b2c13a3ce 100644 --- a/.github/workflows/flakeguard.yml +++ b/.github/workflows/flakeguard.yml @@ -332,7 +332,7 @@ jobs: --max-pass-ratio "${{ inputs.maxPassRatio }}" # Print out the summary file - echo "Flakeguard Summary:" + echo "\nFlakeguard Summary:" cat ./flakeguard-report/all-test-summary.json # Read the summary from the generated report @@ -415,7 +415,6 @@ jobs: fi - name: Add Github Summary - if: ${{ fromJSON(steps.results.outputs.summary).total_tests > 0 }} run: | FILE_SIZE=$(wc -c < ./flakeguard-report/all-test-summary.md) echo "File size: $FILE_SIZE bytes" @@ -447,7 +446,7 @@ jobs: }); - name: Send Slack message for failed tests - # if: ${{ inputs.slackNotificationAfterTestsChannelId != '' && fromJSON(steps.results.outputs.summary).flaky_tests > 0 }} + if: ${{ inputs.slackNotificationAfterTestsChannelId != '' && fromJSON(steps.results.outputs.summary).flaky_tests > 0 }} uses: slackapi/slack-github-action@6c661ce58804a1a20f6dc5fbee7f0381b469e001 # v1.25.0 env: SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} From f9c7a147103a2e2c804da4101a97f9202521e525 Mon Sep 17 00:00:00 2001 From: lukaszcl <120112546+lukaszcl@users.noreply.github.com> Date: Mon, 9 Dec 2024 14:48:37 +0100 Subject: [PATCH 35/41] Fix fromJSON --- .github/workflows/flakeguard.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/flakeguard.yml b/.github/workflows/flakeguard.yml index 35b2c13a3ce..afca8e03ac2 100644 --- a/.github/workflows/flakeguard.yml +++ b/.github/workflows/flakeguard.yml @@ -57,16 +57,16 @@ on: env: GIT_HEAD_REF: ${{ inputs.headRef || github.ref }} - SKIPPED_TESTS: ${{ fromJson(inputs.extraArgs)['skipped_tests'] || '' }} # Comma separated list of test names to skip running in the flaky detector. Related issue: TT-1823 - DEFAULT_MAX_RUNNER_COUNT: ${{ fromJson(inputs.extraArgs)['default_max_runner_count'] || '8' }} # The default maximum number of GitHub runners to use for parallel test execution. - ALL_TESTS_RUNNER_COUNT: ${{ fromJson(inputs.extraArgs)['all_tests_runner_count'] || '2' }} # The number of GitHub runners to use when running all tests `runAllTests=true`. - TEST_REPEAT_COUNT: ${{ fromJson(inputs.extraArgs)['test_repeat_count'] || '5' }} # The number of times each runner should run a test to detect flaky tests. - RUN_WITH_RACE: ${{ fromJson(inputs.extraArgs)['run_with_race'] || 'true' }} # Whether to run tests with -race flag. - RUN_WITH_SHUFFLE: ${{ fromJson(inputs.extraArgs)['run_with_shuffle'] || 'false' }} # Whether to run tests with -shuffle flag. - SHUFFLE_SEED: ${{ fromJson(inputs.extraArgs)['shuffle_seed'] || '999' }} # The seed to use when -shuffle flag is enabled. Requires RUN_WITH_SHUFFLE to be true. - ALL_TESTS_RUNNER: ${{ fromJson(inputs.extraArgs)['all_tests_runner'] || 'ubuntu22.04-32cores-128GB' }} # The runner to use for running all tests. + SKIPPED_TESTS: ${{ fromJSON(inputs.extraArgs)['skipped_tests'] || '' }} # Comma separated list of test names to skip running in the flaky detector. Related issue: TT-1823 + DEFAULT_MAX_RUNNER_COUNT: ${{ fromJSON(inputs.extraArgs)['default_max_runner_count'] || '8' }} # The default maximum number of GitHub runners to use for parallel test execution. + ALL_TESTS_RUNNER_COUNT: ${{ fromJSON(inputs.extraArgs)['all_tests_runner_count'] || '2' }} # The number of GitHub runners to use when running all tests `runAllTests=true`. + TEST_REPEAT_COUNT: ${{ fromJSON(inputs.extraArgs)['test_repeat_count'] || '5' }} # The number of times each runner should run a test to detect flaky tests. + RUN_WITH_RACE: ${{ fromJSON(inputs.extraArgs)['run_with_race'] || 'true' }} # Whether to run tests with -race flag. + RUN_WITH_SHUFFLE: ${{ fromJSON(inputs.extraArgs)['run_with_shuffle'] || 'false' }} # Whether to run tests with -shuffle flag. + SHUFFLE_SEED: ${{ fromJSON(inputs.extraArgs)['shuffle_seed'] || '999' }} # The seed to use when -shuffle flag is enabled. Requires RUN_WITH_SHUFFLE to be true. + ALL_TESTS_RUNNER: ${{ fromJSON(inputs.extraArgs)['all_tests_runner'] || 'ubuntu22.04-32cores-128GB' }} # The runner to use for running all tests. DEFAULT_RUNNER: 'ubuntu-latest' # The default runner to use for running tests. - UPLOAD_ALL_TEST_RESULTS: ${{ fromJson(inputs.extraArgs)['upload_all_test_results'] || 'false' }} # Whether to upload all test results as artifacts. + UPLOAD_ALL_TEST_RESULTS: ${{ fromJSON(inputs.extraArgs)['upload_all_test_results'] || 'false' }} # Whether to upload all test results as artifacts. jobs: @@ -201,7 +201,7 @@ jobs: strategy: fail-fast: false matrix: - include: ${{ fromJson(needs.get-tests.outputs.matrix) }} + include: ${{ fromJSON(needs.get-tests.outputs.matrix) }} env: DB_URL: postgresql://postgres:postgres@localhost:5432/chainlink_test?sslmode=disable steps: From 455129e1eee1f9cb2c5a50a36651ee7314674008 Mon Sep 17 00:00:00 2001 From: lukaszcl <120112546+lukaszcl@users.noreply.github.com> Date: Mon, 9 Dec 2024 14:51:16 +0100 Subject: [PATCH 36/41] fix --- .github/workflows/flakeguard.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/flakeguard.yml b/.github/workflows/flakeguard.yml index afca8e03ac2..4dec7ebc084 100644 --- a/.github/workflows/flakeguard.yml +++ b/.github/workflows/flakeguard.yml @@ -332,8 +332,8 @@ jobs: --max-pass-ratio "${{ inputs.maxPassRatio }}" # Print out the summary file - echo "\nFlakeguard Summary:" - cat ./flakeguard-report/all-test-summary.json + echo -e "\nFlakeguard Summary:" + jq . ./flakeguard-report/all-test-summary.json # Read the summary from the generated report summary=$(jq -c '.' ./flakeguard-report/all-test-summary.json) From deadce0d0c98d25d99fc497665cfb34c333205f5 Mon Sep 17 00:00:00 2001 From: lukaszcl <120112546+lukaszcl@users.noreply.github.com> Date: Mon, 9 Dec 2024 15:15:09 +0100 Subject: [PATCH 37/41] Bump flakeguard --- .github/workflows/flakeguard.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/flakeguard.yml b/.github/workflows/flakeguard.yml index 4dec7ebc084..27295ddf9a7 100644 --- a/.github/workflows/flakeguard.yml +++ b/.github/workflows/flakeguard.yml @@ -102,7 +102,7 @@ jobs: - name: Install flakeguard shell: bash - run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@34fa8f2dab51f7cfd24fadec57c78978876c9a10 # flakguard@0.1.0 + run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@8ab91a5f7b37d374236bf0388908628faa036281 # flakguard@0.1.0 - name: Find new or updated test packages if: ${{ inputs.runAllTests == false }} @@ -261,7 +261,7 @@ jobs: - name: Install flakeguard shell: bash - run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@34fa8f2dab51f7cfd24fadec57c78978876c9a10 # flakguard@0.1.0 + run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@8ab91a5f7b37d374236bf0388908628faa036281 # flakguard@0.1.0 - name: Run tests with flakeguard shell: bash @@ -308,7 +308,7 @@ jobs: - name: Install flakeguard shell: bash - run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@34fa8f2dab51f7cfd24fadec57c78978876c9a10 # flakguard@0.1.0 + run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@8ab91a5f7b37d374236bf0388908628faa036281 # flakguard@0.1.0 - name: Aggregate Flakeguard Results id: results From 6731e9c8415258d4f867c23ba89d17c0d5ff08bb Mon Sep 17 00:00:00 2001 From: lukaszcl <120112546+lukaszcl@users.noreply.github.com> Date: Mon, 9 Dec 2024 16:17:11 +0100 Subject: [PATCH 38/41] bump --- .github/workflows/flakeguard.yml | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/.github/workflows/flakeguard.yml b/.github/workflows/flakeguard.yml index 27295ddf9a7..31f999777c0 100644 --- a/.github/workflows/flakeguard.yml +++ b/.github/workflows/flakeguard.yml @@ -102,7 +102,7 @@ jobs: - name: Install flakeguard shell: bash - run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@8ab91a5f7b37d374236bf0388908628faa036281 # flakguard@0.1.0 + run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@69556c87d09fdcabbc086c474d3772b3b6010a5f # flakguard@0.1.0 - name: Find new or updated test packages if: ${{ inputs.runAllTests == false }} @@ -261,7 +261,7 @@ jobs: - name: Install flakeguard shell: bash - run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@8ab91a5f7b37d374236bf0388908628faa036281 # flakguard@0.1.0 + run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@69556c87d09fdcabbc086c474d3772b3b6010a5f # flakguard@0.1.0 - name: Run tests with flakeguard shell: bash @@ -308,7 +308,7 @@ jobs: - name: Install flakeguard shell: bash - run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@8ab91a5f7b37d374236bf0388908628faa036281 # flakguard@0.1.0 + run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@69556c87d09fdcabbc086c474d3772b3b6010a5f # flakguard@0.1.0 - name: Aggregate Flakeguard Results id: results @@ -339,14 +339,6 @@ jobs: summary=$(jq -c '.' ./flakeguard-report/all-test-summary.json) echo "summary=$summary" >> $GITHUB_OUTPUT - - name: Upload All Tests Summary as Artifact - if: ${{ fromJSON(steps.results.outputs.summary).total_tests > 0 }} - uses: actions/upload-artifact@v4.4.3 - with: - path: ./flakeguard-report/all-test-summary.md - name: all-test-summary.md - retention-days: 90 - - name: Upload All Test Results as Artifact if: ${{ fromJSON(steps.results.outputs.summary).total_tests > 0 }} uses: actions/upload-artifact@v4.4.3 From d3af1a222be7b44d1ced03f94ea7f2f7703ed4e9 Mon Sep 17 00:00:00 2001 From: lukaszcl <120112546+lukaszcl@users.noreply.github.com> Date: Mon, 9 Dec 2024 17:32:08 +0100 Subject: [PATCH 39/41] bump --- .github/workflows/flakeguard.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/flakeguard.yml b/.github/workflows/flakeguard.yml index 31f999777c0..9015151246f 100644 --- a/.github/workflows/flakeguard.yml +++ b/.github/workflows/flakeguard.yml @@ -102,7 +102,7 @@ jobs: - name: Install flakeguard shell: bash - run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@69556c87d09fdcabbc086c474d3772b3b6010a5f # flakguard@0.1.0 + run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@404e04e1e2e2dd5a384b09bd05b8d80409b6609a # flakguard@0.1.0 - name: Find new or updated test packages if: ${{ inputs.runAllTests == false }} @@ -261,7 +261,7 @@ jobs: - name: Install flakeguard shell: bash - run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@69556c87d09fdcabbc086c474d3772b3b6010a5f # flakguard@0.1.0 + run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@404e04e1e2e2dd5a384b09bd05b8d80409b6609a # flakguard@0.1.0 - name: Run tests with flakeguard shell: bash @@ -308,7 +308,7 @@ jobs: - name: Install flakeguard shell: bash - run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@69556c87d09fdcabbc086c474d3772b3b6010a5f # flakguard@0.1.0 + run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@404e04e1e2e2dd5a384b09bd05b8d80409b6609a # flakguard@0.1.0 - name: Aggregate Flakeguard Results id: results From c3e0a390c23da056d627b4fcddadb31f2826f2a8 Mon Sep 17 00:00:00 2001 From: lukaszcl <120112546+lukaszcl@users.noreply.github.com> Date: Tue, 10 Dec 2024 12:48:25 +0100 Subject: [PATCH 40/41] Run each test in flakeguard nightly 15 times --- .github/workflows/flakeguard-nightly.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/flakeguard-nightly.yml b/.github/workflows/flakeguard-nightly.yml index 5a7cc8230fe..178d43d809a 100644 --- a/.github/workflows/flakeguard-nightly.yml +++ b/.github/workflows/flakeguard-nightly.yml @@ -16,7 +16,7 @@ jobs: projectPath: '.' maxPassRatio: '1.0' runAllTests: true - extraArgs: '{ "skipped_tests": "TestChainComponents", "test_repeat_count": "10", "all_tests_runner": "ubuntu22.04-32cores-128GB", "all_tests_runner_count": "5", "run_with_race": "false" }' + extraArgs: '{ "skipped_tests": "TestChainComponents", "test_repeat_count": "5", "all_tests_runner": "ubuntu22.04-32cores-128GB", "all_tests_runner_count": "3", "run_with_race": "false" }' slackNotificationAfterTestsChannelId: 'C07TRF65CNS' #flaky-test-detector-notifications secrets: SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} From 37cb6f3da9c9681ba8b2487b029cebad5691e075 Mon Sep 17 00:00:00 2001 From: lukaszcl <120112546+lukaszcl@users.noreply.github.com> Date: Tue, 10 Dec 2024 15:52:18 +0100 Subject: [PATCH 41/41] bump retention days for test results with logs --- .github/workflows/flakeguard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/flakeguard.yml b/.github/workflows/flakeguard.yml index 9015151246f..4c1aa695c62 100644 --- a/.github/workflows/flakeguard.yml +++ b/.github/workflows/flakeguard.yml @@ -361,7 +361,7 @@ jobs: with: path: ./flakeguard-report/failed-test-results-with-logs.json name: failed-test-results-with-logs.json - retention-days: 7 + retention-days: 90 - name: Generate Flakeguard Reports shell: bash