-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add separate job for nightly flakeguard workflow * trigger * fix * fix * Fix * Fix codeowners issue * Fix all tests path * Fix * bump flakeguard to fix codeowners
- Loading branch information
Showing
3 changed files
with
38 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: Flakeguard Nightly | ||
|
||
on: | ||
schedule: | ||
# Run every night at 3:00 AM UTC | ||
- cron: '0 3 * * *' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
trigger-flaky-test-detection: | ||
name: Find Flaky Tests | ||
uses: ./.github/workflows/flakeguard.yml | ||
with: | ||
repoUrl: 'https://github.com/smartcontractkit/chainlink' | ||
baseRef: 'origin/develop' | ||
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" }' | ||
slackNotificationAfterTestsChannelId: 'C07TRF65CNS' #flaky-test-detector-notifications | ||
secrets: | ||
SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -100,7 +100,7 @@ jobs: | |
|
||
- name: Install flakeguard | ||
shell: bash | ||
run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@04bfae2602c015036f366a8dd4e7a619096cc516 # [email protected] | ||
run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@f03577def97a20a38c0e1de1cbe7fc98d416dd86 # [email protected] | ||
|
||
- 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@04bfae2602c015036f366a8dd4e7a619096cc516 # [email protected] | ||
run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@f03577def97a20a38c0e1de1cbe7fc98d416dd86 # [email protected] | ||
|
||
- name: Run tests with flakeguard | ||
shell: bash | ||
|
@@ -283,6 +283,11 @@ jobs: | |
outputs: | ||
test_results: ${{ steps.set_test_results.outputs.results }} | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 | ||
with: | ||
ref: ${{ env.GIT_HEAD_REF }} | ||
|
||
- name: Set Pretty Project Path | ||
id: set_project_path_pretty | ||
run: | | ||
|
@@ -295,37 +300,38 @@ jobs: | |
- name: Download all test result artifacts | ||
uses: actions/[email protected] | ||
with: | ||
path: test_results | ||
path: ci_test_results | ||
pattern: | ||
test-result-${{ needs.get-tests.outputs.workflow_id }}-* | ||
|
||
- name: Install flakeguard | ||
shell: bash | ||
run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@04bfae2602c015036f366a8dd4e7a619096cc516 # [email protected] | ||
run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@f03577def97a20a38c0e1de1cbe7fc98d416dd86 # [email protected] | ||
|
||
- name: Set combined test results | ||
id: set_test_results | ||
shell: bash | ||
run: | | ||
set -e # Exit immediately if a command exits with a non-zero status. | ||
if [ -d "test_results" ]; then | ||
cd test_results | ||
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 | ||
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=${{ inputs.projectPath }} --codeowners-path=.github/CODEOWNERS | ||
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 | ||
|
@@ -342,7 +348,7 @@ jobs: | |
fi | ||
- name: Tests Summary | ||
if: always() | ||
if: ${{ fromJson(steps.set_test_results.outputs.all_tests_count) > 0 }} | ||
run: | | ||
FILE_SIZE=$(wc -c < all_tests.md) | ||
echo "File size: $FILE_SIZE bytes" | ||
|
@@ -412,7 +418,7 @@ jobs: | |
script: | | ||
const fs = require('fs'); | ||
const prNumber = context.payload.pull_request.number; | ||
const commentBody = fs.readFileSync('../all_tests.md', 'utf8'); | ||
const commentBody = fs.readFileSync('all_tests.md', 'utf8'); | ||
await github.rest.issues.createComment({ | ||
owner: context.repo.owner, | ||
|