Skip to content
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

ci: add option to run e2e twice #3262

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ jobs:
V2_TESTS: ${{ steps.matrix-conditionals.outputs.V2_TESTS }}
V2_MIGRATION_TESTS: ${{ steps.matrix-conditionals.outputs.V2_MIGRATION_TESTS }}
ENABLE_MONITORING: ${{ steps.matrix-conditionals.outputs.ENABLE_MONITORING }}
TWICE_TESTS: ${{ steps.matrix-conditionals.outputs.TWICE_TESTS }}
steps:
# use api rather than event context to avoid race conditions (label added after push)
- id: matrix-conditionals
Expand Down Expand Up @@ -156,9 +157,11 @@ jobs:
core.setOutput('V2_TESTS', labels.includes('V2_TESTS')); // for v2 tests, TODO: remove this once we fully migrate to v2 (https://github.com/zeta-chain/node/issues/2627)
core.setOutput('V2_MIGRATION_TESTS', labels.includes('V2_MIGRATION_TESTS')); // for v2 tests, TODO: remove this once we fully migrate to v2 (https://github.com/zeta-chain/node/issues/2627)
core.setOutput('ENABLE_MONITORING', labels.includes('ENABLE_MONITORING'));
core.setOutput('TWICE_TESTS', labels.includes('TWICE_TESTS'));
} else if (context.eventName === 'merge_group') {
// default mergequeue tests
core.setOutput('DEFAULT_TESTS', true);
core.setOutput('TWICE_TESTS', true);
core.setOutput('UPGRADE_LIGHT_TESTS', true);

// conditional tests based on PR labels
Expand Down Expand Up @@ -224,6 +227,7 @@ jobs:
include:
- make-target: "start-e2e-test"
runs-on: ubuntu-20.04
run-twice: ${{ needs.matrix-conditionals.outputs.TWICE_TESTS == 'true' }}
run: ${{ needs.matrix-conditionals.outputs.DEFAULT_TESTS == 'true' }}
- make-target: "start-e2e-consensus-test"
runs-on: ubuntu-20.04
Expand Down Expand Up @@ -270,6 +274,7 @@ jobs:
make-target: ${{ matrix.make-target }}
runs-on: ${{ matrix.runs-on}}
run: ${{ matrix.run }}
run-twice: ${{ matrix.run-twice || false }}
timeout-minutes: "${{ matrix.timeout-minutes || 25 }}"
zetanode-image: ${{ needs.build-zetanode.outputs.image }}
enable-monitoring: ${{ needs.matrix-conditionals.outputs.ENABLE_MONITORING == 'true' }}
Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/reusable-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ on:
description: 'Enable the monitoring stack for this run'
type: boolean
default: false
run-twice:
description: 'Run the tests a second time'
type: boolean
default: false

jobs:
e2e:
Expand Down Expand Up @@ -74,6 +78,17 @@ jobs:
docker logs -f "${container_id}" &
exit $(docker wait "${container_id}")

- name: Start Test (second run)
if: inputs.run-twice
run: make ${{ inputs.make-target }}

- name: Watch Test (second run)
if: inputs.run-twice
run: |
container_id=$(docker ps --filter "ancestor=orchestrator:latest" --format "{{.ID}}")
docker logs --since -10s -f "${container_id}" &
exit $(docker wait "${container_id}")

gartnera marked this conversation as resolved.
Show resolved Hide resolved
- name: Full Log Dump On Failure
if: failure()
run: |
Expand Down
Loading