From 21485c8eac66c337e6315e8708720cd8fc4f1e04 Mon Sep 17 00:00:00 2001 From: Adam Hamrick Date: Mon, 16 Dec 2024 15:40:04 -0500 Subject: [PATCH 01/19] Adds Splunk Flakeguard uploads --- .github/workflows/flakeguard.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/flakeguard.yml b/.github/workflows/flakeguard.yml index 3951c356a3b..b4e51d6d96e 100644 --- a/.github/workflows/flakeguard.yml +++ b/.github/workflows/flakeguard.yml @@ -371,6 +371,15 @@ jobs: path: ./flakeguard-report/all-test-results.json name: all-test-results.json retention-days: 90 + + - name: Send Flakeguard Results to Splunk + if: ${{ fromJSON(steps.results.outputs.summary).total_tests > 0 }} + run: | + echo "Sending Flakeguard results to Splunk" + curl -k -X POST "${{ secrets.FLAKEGUARD_SPLUNK_ENDPOINT }}" \ + -H "Authorization: Splunk ${{ secrets.FLAKEGUARD_SPLUNK_HEC }}" \ + -H "Content-Type: application/json" \ + -d @data.json - name: Upload Failed Test Results as Artifact if: ${{ fromJSON(steps.results.outputs.summary).failed_runs > 0 }} From 0efff775024f7ad5a02c2b336cf15261c8905917 Mon Sep 17 00:00:00 2001 From: Adam Hamrick Date: Mon, 16 Dec 2024 16:22:40 -0500 Subject: [PATCH 02/19] Fix data path --- .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 b4e51d6d96e..31992c55e18 100644 --- a/.github/workflows/flakeguard.yml +++ b/.github/workflows/flakeguard.yml @@ -379,7 +379,7 @@ jobs: curl -k -X POST "${{ secrets.FLAKEGUARD_SPLUNK_ENDPOINT }}" \ -H "Authorization: Splunk ${{ secrets.FLAKEGUARD_SPLUNK_HEC }}" \ -H "Content-Type: application/json" \ - -d @data.json + -d @./flakeguard-report/all-test-results.json - name: Upload Failed Test Results as Artifact if: ${{ fromJSON(steps.results.outputs.summary).failed_runs > 0 }} From 7f6f0440849f7f978b51a30938a661c033a73374 Mon Sep 17 00:00:00 2001 From: Adam Hamrick Date: Mon, 16 Dec 2024 16:55:14 -0500 Subject: [PATCH 03/19] Secrets --- .github/workflows/flakeguard-nightly.yml | 2 ++ .github/workflows/flakeguard-on-demand.yml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/.github/workflows/flakeguard-nightly.yml b/.github/workflows/flakeguard-nightly.yml index 178d43d809a..39142a01d44 100644 --- a/.github/workflows/flakeguard-nightly.yml +++ b/.github/workflows/flakeguard-nightly.yml @@ -21,4 +21,6 @@ jobs: secrets: SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + FLAKEGUARD_SPLUNK_ENDPOINT: ${{ secrets.FLAKEGUARD_SPLUNK_ENDPOINT }} + FLAKEGUARD_SPLUNK_HEC: ${{ secrets.FLAKEGUARD_SPLUNK_HEC }} diff --git a/.github/workflows/flakeguard-on-demand.yml b/.github/workflows/flakeguard-on-demand.yml index 4508da30e6b..afee9a2fdba 100644 --- a/.github/workflows/flakeguard-on-demand.yml +++ b/.github/workflows/flakeguard-on-demand.yml @@ -69,4 +69,6 @@ jobs: secrets: SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + FLAKEGUARD_SPLUNK_ENDPOINT: ${{ secrets.FLAKEGUARD_SPLUNK_ENDPOINT }} + FLAKEGUARD_SPLUNK_HEC: ${{ secrets.FLAKEGUARD_SPLUNK_HEC }} \ No newline at end of file From f94b88ab561f3c51efe900dd4ac78713aa4471a9 Mon Sep 17 00:00:00 2001 From: Adam Hamrick Date: Mon, 16 Dec 2024 17:16:04 -0500 Subject: [PATCH 04/19] Proper secrets --- .github/workflows/flakeguard-nightly.yml | 1 - .github/workflows/flakeguard-on-demand.yml | 1 - .github/workflows/flakeguard.yml | 6 ++++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/flakeguard-nightly.yml b/.github/workflows/flakeguard-nightly.yml index 39142a01d44..025cca6d0a0 100644 --- a/.github/workflows/flakeguard-nightly.yml +++ b/.github/workflows/flakeguard-nightly.yml @@ -23,4 +23,3 @@ jobs: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} FLAKEGUARD_SPLUNK_ENDPOINT: ${{ secrets.FLAKEGUARD_SPLUNK_ENDPOINT }} FLAKEGUARD_SPLUNK_HEC: ${{ secrets.FLAKEGUARD_SPLUNK_HEC }} - diff --git a/.github/workflows/flakeguard-on-demand.yml b/.github/workflows/flakeguard-on-demand.yml index afee9a2fdba..f6df40616f7 100644 --- a/.github/workflows/flakeguard-on-demand.yml +++ b/.github/workflows/flakeguard-on-demand.yml @@ -71,4 +71,3 @@ jobs: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} FLAKEGUARD_SPLUNK_ENDPOINT: ${{ secrets.FLAKEGUARD_SPLUNK_ENDPOINT }} FLAKEGUARD_SPLUNK_HEC: ${{ secrets.FLAKEGUARD_SPLUNK_HEC }} - \ No newline at end of file diff --git a/.github/workflows/flakeguard.yml b/.github/workflows/flakeguard.yml index 31992c55e18..3436b8ea452 100644 --- a/.github/workflows/flakeguard.yml +++ b/.github/workflows/flakeguard.yml @@ -54,6 +54,12 @@ on: required: false GH_TOKEN: required: true + FLAKEGUARD_SPLUNK_ENDPOINT: + description: "The Splunk HTTP Event Collector (HEC) endpoint." + required: true + FLAKEGUARD_SPLUNK_HEC: + description: "The Splunk HTTP Event Collector (HEC) token." + required: true env: GIT_BASE_REF: ${{ inputs.baseRef }} From eb0150d416c7dfeb42e755887566bf558e7b466a Mon Sep 17 00:00:00 2001 From: Adam Hamrick Date: Tue, 17 Dec 2024 09:51:30 -0500 Subject: [PATCH 05/19] Add proper splunk events --- .github/workflows/flakeguard-nightly.yml | 3 ++- .github/workflows/flakeguard-on-demand.yml | 3 ++- .github/workflows/flakeguard.yml | 13 +++++++++++-- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/.github/workflows/flakeguard-nightly.yml b/.github/workflows/flakeguard-nightly.yml index 025cca6d0a0..28432c417ad 100644 --- a/.github/workflows/flakeguard-nightly.yml +++ b/.github/workflows/flakeguard-nightly.yml @@ -8,7 +8,7 @@ on: jobs: trigger-flaky-test-detection: - name: Find Flaky Tests + name: Flakeguard Nightly uses: ./.github/workflows/flakeguard.yml with: repoUrl: 'https://github.com/smartcontractkit/chainlink' @@ -18,6 +18,7 @@ jobs: 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" }' slackNotificationAfterTestsChannelId: 'C07TRF65CNS' #flaky-test-detector-notifications + event: 'nightly' secrets: SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/flakeguard-on-demand.yml b/.github/workflows/flakeguard-on-demand.yml index f6df40616f7..95d3c4f6034 100644 --- a/.github/workflows/flakeguard-on-demand.yml +++ b/.github/workflows/flakeguard-on-demand.yml @@ -53,7 +53,7 @@ on: jobs: trigger-flaky-test-detection: - name: Find Flaky Tests + name: Flakeguard on Demand uses: ./.github/workflows/flakeguard.yml with: repoUrl: ${{ inputs.repoUrl }} @@ -66,6 +66,7 @@ jobs: findByAffectedPackages: ${{ inputs.findByAffectedPackages }} slackNotificationAfterTestsChannelId: ${{ inputs.slack_notification_after_tests_channel_id || 'C07TRF65CNS' }} #flaky-test-detector-notifications extraArgs: ${{ inputs.extraArgs }} + event: 'on_demand' secrets: SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/flakeguard.yml b/.github/workflows/flakeguard.yml index 3436b8ea452..9a9f92a6550 100644 --- a/.github/workflows/flakeguard.yml +++ b/.github/workflows/flakeguard.yml @@ -49,6 +49,10 @@ on: type: string default: '{}' description: 'JSON of extra arguments for the workflow.' + event: + required: true + type: string + description: 'The event that triggered flakeguard run. (e.g. pull_request, nightly, on_demand)' secrets: SLACK_BOT_TOKEN: required: false @@ -380,12 +384,17 @@ jobs: - name: Send Flakeguard Results to Splunk if: ${{ fromJSON(steps.results.outputs.summary).total_tests > 0 }} + continue-on-error: true run: | echo "Sending Flakeguard results to Splunk" - curl -k -X POST "${{ secrets.FLAKEGUARD_SPLUNK_ENDPOINT }}" \ + jq -n --argjson data "$(cat ./flakeguard-report/all-test-results.json)" \ + --arg event "${{ inputs.event }}" \ + '{event: $event, data: $data}' > splunk.json + RESPONSE=$(curl -k --fail -X POST "${{ secrets.FLAKEGUARD_SPLUNK_ENDPOINT }}" \ -H "Authorization: Splunk ${{ secrets.FLAKEGUARD_SPLUNK_HEC }}" \ -H "Content-Type: application/json" \ - -d @./flakeguard-report/all-test-results.json + -d @splunk.json) + echo "Response from Splunk: $RESPONSE" - name: Upload Failed Test Results as Artifact if: ${{ fromJSON(steps.results.outputs.summary).failed_runs > 0 }} From 61c3d243c8b0495a23c0d2ccdc9e3de0055b0592 Mon Sep 17 00:00:00 2001 From: Adam Hamrick Date: Tue, 17 Dec 2024 10:10:53 -0500 Subject: [PATCH 06/19] Fix JQ --- .github/workflows/flakeguard.yml | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/.github/workflows/flakeguard.yml b/.github/workflows/flakeguard.yml index 9a9f92a6550..ee94301b946 100644 --- a/.github/workflows/flakeguard.yml +++ b/.github/workflows/flakeguard.yml @@ -381,20 +381,6 @@ jobs: path: ./flakeguard-report/all-test-results.json name: all-test-results.json retention-days: 90 - - - name: Send Flakeguard Results to Splunk - if: ${{ fromJSON(steps.results.outputs.summary).total_tests > 0 }} - continue-on-error: true - run: | - echo "Sending Flakeguard results to Splunk" - jq -n --argjson data "$(cat ./flakeguard-report/all-test-results.json)" \ - --arg event "${{ inputs.event }}" \ - '{event: $event, data: $data}' > splunk.json - RESPONSE=$(curl -k --fail -X POST "${{ secrets.FLAKEGUARD_SPLUNK_ENDPOINT }}" \ - -H "Authorization: Splunk ${{ secrets.FLAKEGUARD_SPLUNK_HEC }}" \ - -H "Content-Type: application/json" \ - -d @splunk.json) - echo "Response from Splunk: $RESPONSE" - name: Upload Failed Test Results as Artifact if: ${{ fromJSON(steps.results.outputs.summary).failed_runs > 0 }} @@ -577,3 +563,14 @@ jobs: } ] } + + - name: Send Flakeguard Results to Splunk + if: ${{ fromJSON(steps.results.outputs.summary).total_tests > 0 }} + run: | + echo "Sending Flakeguard results to Splunk" + jq --arg event "${{ inputs.event }}" \ + '. | {event: $event, data: .}' ./flakeguard-report/all-test-results.json > splunk.json + curl -k --fail -X POST "${{ secrets.FLAKEGUARD_SPLUNK_ENDPOINT }}" \ + -H "Authorization: Splunk ${{ secrets.FLAKEGUARD_SPLUNK_HEC }}" \ + -H "Content-Type: application/json" \ + -d @splunk.json From da961e2066d5ff4c4fc506552229524221385b9a Mon Sep 17 00:00:00 2001 From: Adam Hamrick Date: Tue, 17 Dec 2024 10:33:04 -0500 Subject: [PATCH 07/19] Better debugging for failing calls --- .github/workflows/flakeguard.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/flakeguard.yml b/.github/workflows/flakeguard.yml index ee94301b946..445012820ee 100644 --- a/.github/workflows/flakeguard.yml +++ b/.github/workflows/flakeguard.yml @@ -570,7 +570,15 @@ jobs: echo "Sending Flakeguard results to Splunk" jq --arg event "${{ inputs.event }}" \ '. | {event: $event, data: .}' ./flakeguard-report/all-test-results.json > splunk.json - curl -k --fail -X POST "${{ secrets.FLAKEGUARD_SPLUNK_ENDPOINT }}" \ + + set +e + SPLUNK_RESP=$(curl -k -X POST "${{ secrets.FLAKEGUARD_SPLUNK_ENDPOINT }}" \ -H "Authorization: Splunk ${{ secrets.FLAKEGUARD_SPLUNK_HEC }}" \ -H "Content-Type: application/json" \ - -d @splunk.json + -d @splunk.json) + CURL_EXIT_CODE=$? + echo "Splunk response: $SPLUNK_RESP" + if [ $CURL_EXIT_CODE -ne 0 ]; then + echo "Error: Failed to send data to Splunk" + exit $CURL_EXIT_CODE + fi From 37739df571796dd9a017dbd54a5a9e84799d82ec Mon Sep 17 00:00:00 2001 From: Adam Hamrick Date: Tue, 17 Dec 2024 16:44:30 -0500 Subject: [PATCH 08/19] Properly format for Splunk events --- .github/workflows/flakeguard.yml | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/.github/workflows/flakeguard.yml b/.github/workflows/flakeguard.yml index 445012820ee..035866704cd 100644 --- a/.github/workflows/flakeguard.yml +++ b/.github/workflows/flakeguard.yml @@ -133,7 +133,7 @@ jobs: - name: Install flakeguard shell: bash - run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@ea4ffd8c51ce02efebf5ea6bca503fe10b6cee92 # flakguard@0.1.0 + run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@b098053cae17c17175a88f3d6ea6c57861c347fe # flakguard@0.1.0 - name: Find new or updated test packages if: ${{ inputs.runAllTests == false }} @@ -292,7 +292,7 @@ jobs: - name: Install flakeguard shell: bash - run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@ea4ffd8c51ce02efebf5ea6bca503fe10b6cee92 # flakguard@0.1.0 + run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@b098053cae17c17175a88f3d6ea6c57861c347fe # flakguard@0.1.0 - name: Run tests with flakeguard shell: bash @@ -339,7 +339,7 @@ jobs: - name: Install flakeguard shell: bash - run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@ea4ffd8c51ce02efebf5ea6bca503fe10b6cee92 # flakguard@0.1.0 + run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@b098053cae17c17175a88f3d6ea6c57861c347fe # flakguard@0.1.0 - name: Aggregate Flakeguard Results id: results @@ -569,16 +569,8 @@ jobs: run: | echo "Sending Flakeguard results to Splunk" jq --arg event "${{ inputs.event }}" \ - '. | {event: $event, data: .}' ./flakeguard-report/all-test-results.json > splunk.json + '. | {"sourcetype": "_json", "event": {"event": $event, data: .}}' ./flakeguard-report/all-test-results.json > splunk.json - set +e - SPLUNK_RESP=$(curl -k -X POST "${{ secrets.FLAKEGUARD_SPLUNK_ENDPOINT }}" \ + curl "${{ secrets.FLAKEGUARD_SPLUNK_ENDPOINT }}" \ -H "Authorization: Splunk ${{ secrets.FLAKEGUARD_SPLUNK_HEC }}" \ - -H "Content-Type: application/json" \ - -d @splunk.json) - CURL_EXIT_CODE=$? - echo "Splunk response: $SPLUNK_RESP" - if [ $CURL_EXIT_CODE -ne 0 ]; then - echo "Error: Failed to send data to Splunk" - exit $CURL_EXIT_CODE - fi + -d @splunk.json From 689af1118e636c6fe60dd78f353532368bcc2a66 Mon Sep 17 00:00:00 2001 From: Adam Hamrick Date: Tue, 17 Dec 2024 17:09:54 -0500 Subject: [PATCH 09/19] Fix flakeguard decoding --- .github/workflows/flakeguard.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/flakeguard.yml b/.github/workflows/flakeguard.yml index 035866704cd..009347a89e3 100644 --- a/.github/workflows/flakeguard.yml +++ b/.github/workflows/flakeguard.yml @@ -128,12 +128,14 @@ jobs: - name: Set up Go 1.21.9 uses: actions/setup-go@v5.0.2 + if: ${{ inputs.runAllTests == false }} with: cache: false - name: Install flakeguard + if: ${{ inputs.runAllTests == false }} shell: bash - run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@b098053cae17c17175a88f3d6ea6c57861c347fe # flakguard@0.1.0 + run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@29ed5aaa0367219d587131dde16f9bc838063590 # flakguard@0.1.0 - name: Find new or updated test packages if: ${{ inputs.runAllTests == false }} @@ -292,7 +294,7 @@ jobs: - name: Install flakeguard shell: bash - run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@b098053cae17c17175a88f3d6ea6c57861c347fe # flakguard@0.1.0 + run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@29ed5aaa0367219d587131dde16f9bc838063590 # flakguard@0.1.0 - name: Run tests with flakeguard shell: bash @@ -339,7 +341,7 @@ jobs: - name: Install flakeguard shell: bash - run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@b098053cae17c17175a88f3d6ea6c57861c347fe # flakguard@0.1.0 + run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@29ed5aaa0367219d587131dde16f9bc838063590 # flakguard@0.1.0 - name: Aggregate Flakeguard Results id: results From 51d7d4eb3b708d6962a11900b91473c0845b4c6e Mon Sep 17 00:00:00 2001 From: Adam Hamrick Date: Tue, 17 Dec 2024 19:08:40 -0500 Subject: [PATCH 10/19] Compact and debug --- .github/workflows/flakeguard.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/flakeguard.yml b/.github/workflows/flakeguard.yml index 009347a89e3..c5632bc40f9 100644 --- a/.github/workflows/flakeguard.yml +++ b/.github/workflows/flakeguard.yml @@ -570,9 +570,12 @@ jobs: if: ${{ fromJSON(steps.results.outputs.summary).total_tests > 0 }} run: | echo "Sending Flakeguard results to Splunk" - jq --arg event "${{ inputs.event }}" \ + jq -c --arg event "${{ inputs.event }}" \ '. | {"sourcetype": "_json", "event": {"event": $event, data: .}}' ./flakeguard-report/all-test-results.json > splunk.json + # DEBUG: Print the Splunk JSON + cat splunk.json + curl "${{ secrets.FLAKEGUARD_SPLUNK_ENDPOINT }}" \ -H "Authorization: Splunk ${{ secrets.FLAKEGUARD_SPLUNK_HEC }}" \ -d @splunk.json From b67d9377138a0547619265eb6d5d12837ea56949 Mon Sep 17 00:00:00 2001 From: Adam Hamrick Date: Thu, 19 Dec 2024 11:17:12 -0500 Subject: [PATCH 11/19] Updated go version --- .github/workflows/flakeguard.yml | 31 ++++++++++--------------------- 1 file changed, 10 insertions(+), 21 deletions(-) diff --git a/.github/workflows/flakeguard.yml b/.github/workflows/flakeguard.yml index c5632bc40f9..87a72ff0da7 100644 --- a/.github/workflows/flakeguard.yml +++ b/.github/workflows/flakeguard.yml @@ -126,16 +126,15 @@ jobs: echo "git_base_sha=" >> $GITHUB_OUTPUT fi - - name: Set up Go 1.21.9 - uses: actions/setup-go@v5.0.2 - if: ${{ inputs.runAllTests == false }} + - name: Setup Go + uses: ./.github/actions/setup-go with: - cache: false + restore-build-cache-only: "true" - name: Install flakeguard if: ${{ inputs.runAllTests == false }} shell: bash - run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@29ed5aaa0367219d587131dde16f9bc838063590 # flakguard@0.1.0 + run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@09a056061154b169f2a73d8df4a03fe83ceffebd # flakguard@0.1.0 - name: Find new or updated test packages if: ${{ inputs.runAllTests == false }} @@ -294,7 +293,7 @@ jobs: - name: Install flakeguard shell: bash - run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@29ed5aaa0367219d587131dde16f9bc838063590 # flakguard@0.1.0 + run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@09a056061154b169f2a73d8df4a03fe83ceffebd # flakguard@0.1.0 - name: Run tests with flakeguard shell: bash @@ -322,6 +321,10 @@ jobs: uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 with: ref: ${{ env.GIT_HEAD_REF }} + - name: Setup Go + uses: ./.github/actions/setup-go + with: + restore-build-cache-only: "true" - name: Set Pretty Project Path id: set_project_path_pretty @@ -341,7 +344,7 @@ jobs: - name: Install flakeguard shell: bash - run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@29ed5aaa0367219d587131dde16f9bc838063590 # flakguard@0.1.0 + run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@09a056061154b169f2a73d8df4a03fe83ceffebd # flakguard@0.1.0 - name: Aggregate Flakeguard Results id: results @@ -565,17 +568,3 @@ jobs: } ] } - - - name: Send Flakeguard Results to Splunk - if: ${{ fromJSON(steps.results.outputs.summary).total_tests > 0 }} - run: | - echo "Sending Flakeguard results to Splunk" - jq -c --arg event "${{ inputs.event }}" \ - '. | {"sourcetype": "_json", "event": {"event": $event, data: .}}' ./flakeguard-report/all-test-results.json > splunk.json - - # DEBUG: Print the Splunk JSON - cat splunk.json - - curl "${{ secrets.FLAKEGUARD_SPLUNK_ENDPOINT }}" \ - -H "Authorization: Splunk ${{ secrets.FLAKEGUARD_SPLUNK_HEC }}" \ - -d @splunk.json From d4f5b39b1403ae81b19a035fa6bcbfcf3bf51974 Mon Sep 17 00:00:00 2001 From: Adam Hamrick Date: Thu, 19 Dec 2024 11:19:57 -0500 Subject: [PATCH 12/19] Input splunk params --- .github/workflows/flakeguard.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/flakeguard.yml b/.github/workflows/flakeguard.yml index 87a72ff0da7..c152c3a2390 100644 --- a/.github/workflows/flakeguard.yml +++ b/.github/workflows/flakeguard.yml @@ -49,7 +49,7 @@ on: type: string default: '{}' description: 'JSON of extra arguments for the workflow.' - event: + splunkEvent: required: true type: string description: 'The event that triggered flakeguard run. (e.g. pull_request, nightly, on_demand)' @@ -370,6 +370,9 @@ jobs: --base-sha "${{ needs.get-tests.outputs.git_base_sha }}" \ --head-sha "${{ needs.get-tests.outputs.git_head_sha }}" \ --github-workflow-name "${{ github.workflow }}" + --splunk-url "${{ secrets.FLAKEGUARD_SPLUNK_ENDPOINT }}" + --splunk-token "${{ secrets.FLAKEGUARD_SPLUNK_HEC }}" + --splunk-event "${{ inputs.splunkEvent }}" # Print out the summary file echo -e "\nFlakeguard Summary:" From ba560b66f13182ccc8afe9a95f998fc7661696c8 Mon Sep 17 00:00:00 2001 From: Adam Hamrick Date: Thu, 19 Dec 2024 11:22:31 -0500 Subject: [PATCH 13/19] Update event types --- .github/workflows/flakeguard-nightly.yml | 2 +- .github/workflows/flakeguard-on-demand.yml | 2 +- .github/workflows/flakeguard.yml | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/flakeguard-nightly.yml b/.github/workflows/flakeguard-nightly.yml index 28432c417ad..3c348881d14 100644 --- a/.github/workflows/flakeguard-nightly.yml +++ b/.github/workflows/flakeguard-nightly.yml @@ -18,7 +18,7 @@ jobs: 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" }' slackNotificationAfterTestsChannelId: 'C07TRF65CNS' #flaky-test-detector-notifications - event: 'nightly' + splunkEvent: 'scheduled' secrets: SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/flakeguard-on-demand.yml b/.github/workflows/flakeguard-on-demand.yml index 95d3c4f6034..9ee7176556b 100644 --- a/.github/workflows/flakeguard-on-demand.yml +++ b/.github/workflows/flakeguard-on-demand.yml @@ -66,7 +66,7 @@ jobs: findByAffectedPackages: ${{ inputs.findByAffectedPackages }} slackNotificationAfterTestsChannelId: ${{ inputs.slack_notification_after_tests_channel_id || 'C07TRF65CNS' }} #flaky-test-detector-notifications extraArgs: ${{ inputs.extraArgs }} - event: 'on_demand' + splunkEvent: 'manual' secrets: SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/flakeguard.yml b/.github/workflows/flakeguard.yml index c152c3a2390..5419a630cc1 100644 --- a/.github/workflows/flakeguard.yml +++ b/.github/workflows/flakeguard.yml @@ -134,7 +134,7 @@ jobs: - name: Install flakeguard if: ${{ inputs.runAllTests == false }} shell: bash - run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@09a056061154b169f2a73d8df4a03fe83ceffebd # flakguard@0.1.0 + run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@60c53716cb24837619f3282476d62cf827e9fa54 # flakguard@0.1.0 - name: Find new or updated test packages if: ${{ inputs.runAllTests == false }} @@ -293,7 +293,7 @@ jobs: - name: Install flakeguard shell: bash - run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@09a056061154b169f2a73d8df4a03fe83ceffebd # flakguard@0.1.0 + run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@60c53716cb24837619f3282476d62cf827e9fa54 # flakguard@0.1.0 - name: Run tests with flakeguard shell: bash @@ -344,7 +344,7 @@ jobs: - name: Install flakeguard shell: bash - run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@09a056061154b169f2a73d8df4a03fe83ceffebd # flakguard@0.1.0 + run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@60c53716cb24837619f3282476d62cf827e9fa54 # flakguard@0.1.0 - name: Aggregate Flakeguard Results id: results From 1f0a2fce5828b3e24410f2f3b33a978e61d39e21 Mon Sep 17 00:00:00 2001 From: Adam Hamrick Date: Thu, 19 Dec 2024 11:37:07 -0500 Subject: [PATCH 14/19] Fix typo --- .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 5419a630cc1..0cb7d1b08ea 100644 --- a/.github/workflows/flakeguard.yml +++ b/.github/workflows/flakeguard.yml @@ -369,9 +369,9 @@ jobs: --repo-url "${{ inputs.repoUrl }}" \ --base-sha "${{ needs.get-tests.outputs.git_base_sha }}" \ --head-sha "${{ needs.get-tests.outputs.git_head_sha }}" \ - --github-workflow-name "${{ github.workflow }}" - --splunk-url "${{ secrets.FLAKEGUARD_SPLUNK_ENDPOINT }}" - --splunk-token "${{ secrets.FLAKEGUARD_SPLUNK_HEC }}" + --github-workflow-name "${{ github.workflow }}" \ + --splunk-url "${{ secrets.FLAKEGUARD_SPLUNK_ENDPOINT }}" \ + --splunk-token "${{ secrets.FLAKEGUARD_SPLUNK_HEC }}" \ --splunk-event "${{ inputs.splunkEvent }}" # Print out the summary file From 3ede8e246e8f4d4ed45b82d65274fe5ff6627be0 Mon Sep 17 00:00:00 2001 From: Adam Hamrick Date: Thu, 19 Dec 2024 16:20:36 -0500 Subject: [PATCH 15/19] Batch splunk sends --- .github/workflows/flakeguard.yml | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/.github/workflows/flakeguard.yml b/.github/workflows/flakeguard.yml index 0cb7d1b08ea..da9eb819002 100644 --- a/.github/workflows/flakeguard.yml +++ b/.github/workflows/flakeguard.yml @@ -6,6 +6,7 @@ on: repoUrl: required: true type: string + default: 'https://github.com/smartcontractkit/chainlink' description: 'The URL of the repository to compare changes for detecting flaky tests.' projectPath: required: true @@ -134,7 +135,7 @@ jobs: - name: Install flakeguard if: ${{ inputs.runAllTests == false }} shell: bash - run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@60c53716cb24837619f3282476d62cf827e9fa54 # flakguard@0.1.0 + run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@00d9baff8b1b965980e06f5d5df427ad96c75125 # flakguard@0.1.0 - name: Find new or updated test packages if: ${{ inputs.runAllTests == false }} @@ -293,7 +294,7 @@ jobs: - name: Install flakeguard shell: bash - run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@60c53716cb24837619f3282476d62cf827e9fa54 # flakguard@0.1.0 + run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@00d9baff8b1b965980e06f5d5df427ad96c75125 # flakguard@0.1.0 - name: Run tests with flakeguard shell: bash @@ -344,7 +345,7 @@ jobs: - name: Install flakeguard shell: bash - run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@60c53716cb24837619f3282476d62cf827e9fa54 # flakguard@0.1.0 + run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@00d9baff8b1b965980e06f5d5df427ad96c75125 # flakguard@0.1.0 - name: Aggregate Flakeguard Results id: results @@ -370,6 +371,7 @@ jobs: --base-sha "${{ needs.get-tests.outputs.git_base_sha }}" \ --head-sha "${{ needs.get-tests.outputs.git_head_sha }}" \ --github-workflow-name "${{ github.workflow }}" \ + --github-workflow-run-url "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" \ --splunk-url "${{ secrets.FLAKEGUARD_SPLUNK_ENDPOINT }}" \ --splunk-token "${{ secrets.FLAKEGUARD_SPLUNK_HEC }}" \ --splunk-event "${{ inputs.splunkEvent }}" @@ -383,7 +385,7 @@ jobs: echo "summary=$summary" >> $GITHUB_OUTPUT - name: Upload All Test Results as Artifact - if: ${{ fromJSON(steps.results.outputs.summary).total_tests > 0 }} + if: always() && ${{ fromJSON(steps.results.outputs.summary).total_tests > 0 }} uses: actions/upload-artifact@v4.4.3 with: path: ./flakeguard-report/all-test-results.json @@ -391,7 +393,7 @@ jobs: retention-days: 90 - name: Upload Failed Test Results as Artifact - if: ${{ fromJSON(steps.results.outputs.summary).failed_runs > 0 }} + if: always() && ${{ fromJSON(steps.results.outputs.summary).failed_runs > 0 }} uses: actions/upload-artifact@v4.4.3 with: path: ./flakeguard-report/failed-test-results.json @@ -399,7 +401,7 @@ jobs: retention-days: 90 - name: Upload Failed Test Results With Logs as Artifact - if: ${{ fromJSON(steps.results.outputs.summary).failed_runs > 0 }} + if: always() && ${{ 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 @@ -408,6 +410,7 @@ jobs: - name: Generate Flakeguard Reports shell: bash + if: always() env: GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} run: | @@ -450,6 +453,7 @@ jobs: fi - name: Add Github Summary + if: always() run: | FILE_SIZE=$(wc -c < ./flakeguard-report/all-test-summary.md) echo "File size: $FILE_SIZE bytes" @@ -464,7 +468,7 @@ jobs: fi - name: Post comment on PR if flaky tests found - if: ${{ fromJSON(steps.results.outputs.summary).flaky_tests > 0 && github.event_name == 'pull_request' }} + if: always() && ${{ fromJSON(steps.results.outputs.summary).flaky_tests > 0 && github.event_name == 'pull_request' }} uses: actions/github-script@v7 continue-on-error: true with: @@ -481,7 +485,7 @@ jobs: }); - name: Send Slack message for failed tests - if: ${{ inputs.slackNotificationAfterTestsChannelId != '' && fromJSON(steps.results.outputs.summary).flaky_tests > 0 }} + if: always && ${{ 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 }} @@ -534,7 +538,7 @@ jobs: - name: Send general Slack message uses: slackapi/slack-github-action@6c661ce58804a1a20f6dc5fbee7f0381b469e001 # v1.25.0 - if: ${{ inputs.slackNotificationAfterTestsChannelId != '' && fromJSON(steps.results.outputs.summary).flaky_tests == 0 && fromJSON(steps.results.outputs.summary).total_tests > 0 }} + if: always() && ${{ 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 a8a748691a00a02b7adcb977f955adbb0562ab7c Mon Sep 17 00:00:00 2001 From: Adam Hamrick Date: Thu, 19 Dec 2024 16:55:54 -0500 Subject: [PATCH 16/19] Fix if triggers --- .github/workflows/flakeguard.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/flakeguard.yml b/.github/workflows/flakeguard.yml index da9eb819002..eb2ea5c13f2 100644 --- a/.github/workflows/flakeguard.yml +++ b/.github/workflows/flakeguard.yml @@ -135,7 +135,7 @@ jobs: - name: Install flakeguard if: ${{ inputs.runAllTests == false }} shell: bash - run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@00d9baff8b1b965980e06f5d5df427ad96c75125 # flakguard@0.1.0 + run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@7c45cff27ac6b0d4244754660661cdbfcfaf2f9e # flakguard@0.1.0 - name: Find new or updated test packages if: ${{ inputs.runAllTests == false }} @@ -294,7 +294,7 @@ jobs: - name: Install flakeguard shell: bash - run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@00d9baff8b1b965980e06f5d5df427ad96c75125 # flakguard@0.1.0 + run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@7c45cff27ac6b0d4244754660661cdbfcfaf2f9e # flakguard@0.1.0 - name: Run tests with flakeguard shell: bash @@ -345,7 +345,7 @@ jobs: - name: Install flakeguard shell: bash - run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@00d9baff8b1b965980e06f5d5df427ad96c75125 # flakguard@0.1.0 + run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@7c45cff27ac6b0d4244754660661cdbfcfaf2f9e # flakguard@0.1.0 - name: Aggregate Flakeguard Results id: results @@ -385,7 +385,7 @@ jobs: echo "summary=$summary" >> $GITHUB_OUTPUT - name: Upload All Test Results as Artifact - if: always() && ${{ fromJSON(steps.results.outputs.summary).total_tests > 0 }} + if: ${{ always() && fromJSON(steps.results.outputs.summary).total_tests > 0 }} uses: actions/upload-artifact@v4.4.3 with: path: ./flakeguard-report/all-test-results.json @@ -393,7 +393,7 @@ jobs: retention-days: 90 - name: Upload Failed Test Results as Artifact - if: always() && ${{ fromJSON(steps.results.outputs.summary).failed_runs > 0 }} + if: ${{ always() && fromJSON(steps.results.outputs.summary).failed_runs > 0 }} uses: actions/upload-artifact@v4.4.3 with: path: ./flakeguard-report/failed-test-results.json @@ -401,7 +401,7 @@ jobs: retention-days: 90 - name: Upload Failed Test Results With Logs as Artifact - if: always() && ${{ fromJSON(steps.results.outputs.summary).failed_runs > 0 }} + if: ${{ always() && 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 @@ -468,7 +468,7 @@ jobs: fi - name: Post comment on PR if flaky tests found - if: always() && ${{ fromJSON(steps.results.outputs.summary).flaky_tests > 0 && github.event_name == 'pull_request' }} + if: ${{ always() && fromJSON(steps.results.outputs.summary).flaky_tests > 0 && github.event_name == 'pull_request' }} uses: actions/github-script@v7 continue-on-error: true with: @@ -485,7 +485,7 @@ jobs: }); - name: Send Slack message for failed tests - if: always && ${{ inputs.slackNotificationAfterTestsChannelId != '' && fromJSON(steps.results.outputs.summary).flaky_tests > 0 }} + if: ${{ always() && 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 }} @@ -538,7 +538,7 @@ jobs: - name: Send general Slack message uses: slackapi/slack-github-action@6c661ce58804a1a20f6dc5fbee7f0381b469e001 # v1.25.0 - if: always() && ${{ inputs.slackNotificationAfterTestsChannelId != '' && fromJSON(steps.results.outputs.summary).flaky_tests == 0 && fromJSON(steps.results.outputs.summary).total_tests > 0 }} + if: ${{ always() && 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 9cb2c168cce6df49efacd4c5b850986009402a5d Mon Sep 17 00:00:00 2001 From: Adam Hamrick Date: Thu, 19 Dec 2024 16:58:33 -0500 Subject: [PATCH 17/19] Use success failure --- .github/workflows/flakeguard.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/flakeguard.yml b/.github/workflows/flakeguard.yml index eb2ea5c13f2..cb19ad9ef97 100644 --- a/.github/workflows/flakeguard.yml +++ b/.github/workflows/flakeguard.yml @@ -385,7 +385,7 @@ jobs: echo "summary=$summary" >> $GITHUB_OUTPUT - name: Upload All Test Results as Artifact - if: ${{ always() && fromJSON(steps.results.outputs.summary).total_tests > 0 }} + if: ${{ (success() || failure()) && fromJSON(steps.results.outputs.summary).total_tests > 0 }} uses: actions/upload-artifact@v4.4.3 with: path: ./flakeguard-report/all-test-results.json @@ -393,7 +393,7 @@ jobs: retention-days: 90 - name: Upload Failed Test Results as Artifact - if: ${{ always() && fromJSON(steps.results.outputs.summary).failed_runs > 0 }} + if: ${{ (success() || failure()) && fromJSON(steps.results.outputs.summary).failed_runs > 0 }} uses: actions/upload-artifact@v4.4.3 with: path: ./flakeguard-report/failed-test-results.json @@ -401,7 +401,7 @@ jobs: retention-days: 90 - name: Upload Failed Test Results With Logs as Artifact - if: ${{ always() && fromJSON(steps.results.outputs.summary).failed_runs > 0 }} + if: ${{ (success() || failure()) && 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 @@ -410,7 +410,7 @@ jobs: - name: Generate Flakeguard Reports shell: bash - if: always() + if: success() || failure() env: GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} run: | @@ -453,7 +453,7 @@ jobs: fi - name: Add Github Summary - if: always() + if: (success() || failure()) run: | FILE_SIZE=$(wc -c < ./flakeguard-report/all-test-summary.md) echo "File size: $FILE_SIZE bytes" @@ -468,7 +468,7 @@ jobs: fi - name: Post comment on PR if flaky tests found - if: ${{ always() && fromJSON(steps.results.outputs.summary).flaky_tests > 0 && github.event_name == 'pull_request' }} + if: ${{ (success() || failure()) && fromJSON(steps.results.outputs.summary).flaky_tests > 0 && github.event_name == 'pull_request' }} uses: actions/github-script@v7 continue-on-error: true with: @@ -485,7 +485,7 @@ jobs: }); - name: Send Slack message for failed tests - if: ${{ always() && inputs.slackNotificationAfterTestsChannelId != '' && fromJSON(steps.results.outputs.summary).flaky_tests > 0 }} + if: ${{ (success() || failure()) && 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 }} @@ -538,7 +538,7 @@ jobs: - name: Send general Slack message uses: slackapi/slack-github-action@6c661ce58804a1a20f6dc5fbee7f0381b469e001 # v1.25.0 - if: ${{ always() && inputs.slackNotificationAfterTestsChannelId != '' && fromJSON(steps.results.outputs.summary).flaky_tests == 0 && fromJSON(steps.results.outputs.summary).total_tests > 0 }} + if: ${{ (success() || failure()) && 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 7f8b93c7cf8f55a42091a9b4ae054d331748912b Mon Sep 17 00:00:00 2001 From: Adam Hamrick Date: Fri, 20 Dec 2024 09:52:37 -0500 Subject: [PATCH 18/19] Revert name change --- .github/workflows/flakeguard-nightly.yml | 2 +- .github/workflows/flakeguard-on-demand.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/flakeguard-nightly.yml b/.github/workflows/flakeguard-nightly.yml index 3c348881d14..10fcae094a7 100644 --- a/.github/workflows/flakeguard-nightly.yml +++ b/.github/workflows/flakeguard-nightly.yml @@ -8,7 +8,7 @@ on: jobs: trigger-flaky-test-detection: - name: Flakeguard Nightly + name: Find Flaky Tests uses: ./.github/workflows/flakeguard.yml with: repoUrl: 'https://github.com/smartcontractkit/chainlink' diff --git a/.github/workflows/flakeguard-on-demand.yml b/.github/workflows/flakeguard-on-demand.yml index 9ee7176556b..1a3d02ea43e 100644 --- a/.github/workflows/flakeguard-on-demand.yml +++ b/.github/workflows/flakeguard-on-demand.yml @@ -53,7 +53,7 @@ on: jobs: trigger-flaky-test-detection: - name: Flakeguard on Demand + name: Find Flaky Tests uses: ./.github/workflows/flakeguard.yml with: repoUrl: ${{ inputs.repoUrl }} From 18c45b4e0a26c994322780c1b660f7279f5381f2 Mon Sep 17 00:00:00 2001 From: Adam Hamrick Date: Fri, 20 Dec 2024 12:43:28 -0500 Subject: [PATCH 19/19] Fix splunk event --- .github/workflows/ci-core.yml | 5 +++++ .github/workflows/flakeguard-nightly.yml | 1 - .github/workflows/flakeguard-on-demand.yml | 1 - .github/workflows/flakeguard.yml | 6 +----- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci-core.yml b/.github/workflows/ci-core.yml index 882d40425eb..cf9d525a846 100644 --- a/.github/workflows/ci-core.yml +++ b/.github/workflows/ci-core.yml @@ -561,6 +561,8 @@ jobs: secrets: SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + FLAKEGUARD_SPLUNK_ENDPOINT: ${{ secrets.FLAKEGUARD_SPLUNK_ENDPOINT }} + FLAKEGUARD_SPLUNK_HEC: ${{ secrets.FLAKEGUARD_SPLUNK_HEC }} trigger-flaky-test-detection-for-deployment-project: name: Flakeguard Deployment Project @@ -580,6 +582,9 @@ jobs: secrets: SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + FLAKEGUARD_SPLUNK_ENDPOINT: ${{ secrets.FLAKEGUARD_SPLUNK_ENDPOINT }} + FLAKEGUARD_SPLUNK_HEC: ${{ secrets.FLAKEGUARD_SPLUNK_HEC }} + clean: name: Clean Go Tidy & Generate diff --git a/.github/workflows/flakeguard-nightly.yml b/.github/workflows/flakeguard-nightly.yml index 10fcae094a7..025cca6d0a0 100644 --- a/.github/workflows/flakeguard-nightly.yml +++ b/.github/workflows/flakeguard-nightly.yml @@ -18,7 +18,6 @@ jobs: 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" }' slackNotificationAfterTestsChannelId: 'C07TRF65CNS' #flaky-test-detector-notifications - splunkEvent: 'scheduled' secrets: SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/flakeguard-on-demand.yml b/.github/workflows/flakeguard-on-demand.yml index 1a3d02ea43e..f6df40616f7 100644 --- a/.github/workflows/flakeguard-on-demand.yml +++ b/.github/workflows/flakeguard-on-demand.yml @@ -66,7 +66,6 @@ jobs: findByAffectedPackages: ${{ inputs.findByAffectedPackages }} slackNotificationAfterTestsChannelId: ${{ inputs.slack_notification_after_tests_channel_id || 'C07TRF65CNS' }} #flaky-test-detector-notifications extraArgs: ${{ inputs.extraArgs }} - splunkEvent: 'manual' secrets: SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/flakeguard.yml b/.github/workflows/flakeguard.yml index cb19ad9ef97..93f380606b0 100644 --- a/.github/workflows/flakeguard.yml +++ b/.github/workflows/flakeguard.yml @@ -50,10 +50,6 @@ on: type: string default: '{}' description: 'JSON of extra arguments for the workflow.' - splunkEvent: - required: true - type: string - description: 'The event that triggered flakeguard run. (e.g. pull_request, nightly, on_demand)' secrets: SLACK_BOT_TOKEN: required: false @@ -374,7 +370,7 @@ jobs: --github-workflow-run-url "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" \ --splunk-url "${{ secrets.FLAKEGUARD_SPLUNK_ENDPOINT }}" \ --splunk-token "${{ secrets.FLAKEGUARD_SPLUNK_HEC }}" \ - --splunk-event "${{ inputs.splunkEvent }}" + --splunk-event "${{ github.event }}" # Print out the summary file echo -e "\nFlakeguard Summary:"