-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tools/bin: simplify test commands #14757
Closed
+16
−169
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
|
@@ -179,23 +179,13 @@ jobs: | |
run: | | ||
echo "TIMEOUT=10m" >> $GITHUB_ENV | ||
echo "COUNT=50" >> $GITHUB_ENV | ||
- name: Install gotestloghelper | ||
if: ${{ needs.filter.outputs.changes == 'true' }} | ||
run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/[email protected] | ||
- name: Run tests | ||
if: ${{ needs.filter.outputs.changes == 'true' }} | ||
id: run-tests | ||
env: | ||
OUTPUT_FILE: ./output.txt | ||
USE_TEE: false | ||
CL_DATABASE_URL: ${{ env.DB_URL }} | ||
run: ./tools/bin/${{ matrix.type.cmd }} ./... | ||
- name: Print Filtered Test Results | ||
if: ${{ failure() && needs.filter.outputs.changes == 'true' && steps.run-tests.conclusion == 'failure' }} | ||
run: | | ||
if [[ "${{ matrix.type.printResults }}" == "true" ]]; then | ||
cat output.txt | gotestloghelper -ci | ||
fi | ||
- name: Print Races | ||
id: print-races | ||
if: ${{ failure() && matrix.type.cmd == 'go_core_race_tests' && needs.filter.outputs.changes == 'true' }} | ||
|
@@ -243,94 +233,6 @@ jobs: | |
echo "path_output=${resultsFile}" >> $GITHUB_OUTPUT | ||
fi | ||
|
||
detect-flakey-tests: | ||
needs: [filter, core] | ||
name: Flakey Test Detection | ||
runs-on: ubuntu-latest | ||
if: ${{ always() && github.actor != 'dependabot[bot]' }} | ||
env: | ||
CL_DATABASE_URL: postgresql://postgres:postgres@localhost:5432/chainlink_test?sslmode=disable | ||
permissions: | ||
id-token: write | ||
contents: read | ||
steps: | ||
- name: Checkout the repo | ||
uses: actions/[email protected] | ||
- name: Setup node | ||
if: ${{ needs.filter.outputs.changes == 'true' }} | ||
uses: actions/[email protected] | ||
- name: Setup NodeJS | ||
if: ${{ needs.filter.outputs.changes == 'true' }} | ||
uses: ./.github/actions/setup-nodejs | ||
with: | ||
prod: "true" | ||
- name: Setup Go | ||
if: ${{ needs.filter.outputs.changes == 'true' }} | ||
uses: ./.github/actions/setup-go | ||
- name: Setup Postgres | ||
if: ${{ needs.filter.outputs.changes == 'true' }} | ||
uses: ./.github/actions/setup-postgres | ||
- name: Touching core/web/assets/index.html | ||
if: ${{ needs.filter.outputs.changes == 'true' }} | ||
run: mkdir -p core/web/assets && touch core/web/assets/index.html | ||
- name: Download Go vendor packages | ||
if: ${{ needs.filter.outputs.changes == 'true' }} | ||
run: go mod download | ||
- name: Replace chainlink-evm deps | ||
if: ${{ needs.filter.outputs.changes == 'true' && inputs.evm-ref != ''}} | ||
shell: bash | ||
run: go get github.com/smartcontractkit/chainlink-integrations/evm/relayer@${{ inputs.evm-ref }} | ||
- name: Build binary | ||
if: ${{ needs.filter.outputs.changes == 'true' }} | ||
run: go build -o chainlink.test . | ||
- name: Setup DB | ||
if: ${{ needs.filter.outputs.changes == 'true' }} | ||
run: ./chainlink.test local db preparetest | ||
- name: Load test outputs | ||
if: ${{ needs.filter.outputs.changes == 'true' }} | ||
uses: actions/[email protected] | ||
with: | ||
name: go_core_tests_logs | ||
path: ./artifacts | ||
- name: Delete go_core_tests_logs/coverage.txt | ||
if: ${{ needs.filter.outputs.changes == 'true' }} | ||
shell: bash | ||
run: | | ||
# Need to delete coverage.txt so the disk doesn't fill up | ||
rm -f ./artifacts/go_core_tests_logs/coverage.txt | ||
- name: Build flakey test runner | ||
if: ${{ needs.filter.outputs.changes == 'true' }} | ||
run: go build ./tools/flakeytests/cmd/runner | ||
- name: Re-run tests | ||
if: ${{ needs.filter.outputs.changes == 'true' }} | ||
env: | ||
GRAFANA_INTERNAL_BASIC_AUTH: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} | ||
GRAFANA_INTERNAL_HOST: ${{ secrets.GRAFANA_INTERNAL_HOST }} | ||
GRAFANA_INTERNAL_TENANT_ID: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} | ||
GITHUB_EVENT_PATH: ${{ github.event_path }} | ||
GITHUB_EVENT_NAME: ${{ github.event_name }} | ||
GITHUB_REPO: ${{ github.repository }} | ||
GITHUB_RUN_ID: ${{ github.run_id }} | ||
run: | | ||
./runner \ | ||
-grafana_auth=$GRAFANA_INTERNAL_BASIC_AUTH \ | ||
-grafana_host=$GRAFANA_INTERNAL_HOST \ | ||
-grafana_org_id=$GRAFANA_INTERNAL_TENANT_ID \ | ||
-gh_sha=$GITHUB_SHA \ | ||
-gh_event_path=$GITHUB_EVENT_PATH \ | ||
-gh_event_name=$GITHUB_EVENT_NAME \ | ||
-gh_run_id=$GITHUB_RUN_ID \ | ||
-gh_repo=$GITHUB_REPO \ | ||
-command=./tools/bin/go_core_tests \ | ||
`ls -R ./artifacts/output.txt` | ||
- name: Store logs artifacts | ||
if: ${{ needs.filter.outputs.changes == 'true' && always() }} | ||
uses: actions/[email protected] | ||
with: | ||
name: flakey_test_runner_logs | ||
path: | | ||
./output.txt | ||
|
||
scan: | ||
name: SonarQube Scan | ||
needs: [core] | ||
|
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
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
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
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unrelated race was flagged from here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved to #15702