From e51f446218071055b01518e6e1ff6d465344f635 Mon Sep 17 00:00:00 2001 From: Erik Burton Date: Mon, 21 Oct 2024 13:00:55 -0700 Subject: [PATCH] fix: only run flakey tests on cron or dispatch --- .github/workflows/ci-core.yml | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci-core.yml b/.github/workflows/ci-core.yml index 47be06cca7f..3f6624a0668 100644 --- a/.github/workflows/ci-core.yml +++ b/.github/workflows/ci-core.yml @@ -14,7 +14,8 @@ on: merge_group: pull_request: schedule: - - cron: "0 0 * * *" + # Every 6 hours + - cron: "0 0,6,12,18 * * *" workflow_dispatch: inputs: distinct_run_name: @@ -248,7 +249,7 @@ jobs: needs: [filter, core] name: Flakey Test Detection runs-on: ubuntu-latest - if: ${{ always() && github.actor != 'dependabot[bot]' }} + if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }} env: CL_DATABASE_URL: postgresql://postgres:postgres@localhost:5432/chainlink_test?sslmode=disable permissions: @@ -258,52 +259,40 @@ jobs: - name: Checkout the repo uses: actions/checkout@v4.2.1 - name: Setup node - if: ${{ needs.filter.outputs.changes == 'true' }} uses: actions/setup-node@v4.0.4 - 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 != ''}} + if: ${{ github.event_name == 'workflow_dispatch' && 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/download-artifact@v4.1.8 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 }} @@ -323,7 +312,7 @@ jobs: -command=./tools/bin/go_core_tests \ `ls -R ./artifacts/output.txt` - name: Store logs artifacts - if: ${{ needs.filter.outputs.changes == 'true' && always() }} + if: ${{ always() }} uses: actions/upload-artifact@v4.4.3 with: name: flakey_test_runner_logs