ACP-236: Adding E2E tests #24415
Workflow file for this run
This file contains hidden or 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
| name: Tests | |
| on: | |
| push: | |
| tags: | |
| - "*" | |
| branches: | |
| - master | |
| - dev | |
| pull_request: | |
| merge_group: | |
| types: [checks_requested] | |
| env: | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true | |
| permissions: | |
| contents: read | |
| # Cancel ongoing workflow runs if a new one is started | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| tests-required: | |
| if: ${{ always() }} | |
| needs: | |
| - Unit | |
| - Fuzz | |
| - e2e | |
| - e2e_schedule_latest | |
| - e2e_post_latest | |
| - e2e_kube | |
| - e2e_existing_network | |
| - Upgrade | |
| - Lint | |
| - tausecondslint | |
| - links-lint | |
| - check_generated_protobuf | |
| - check_mockgen | |
| - check_canotogen | |
| - check_contract_bindings | |
| - check_go_mod_tidy | |
| - test_build_image | |
| - test_build_antithesis_avalanchego_images | |
| - test_build_antithesis_xsvm_images | |
| - e2e_bootstrap_monitor | |
| - load | |
| - load_kube_kind | |
| - robustness | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Fail unless all needed jobs succeeded | |
| shell: bash | |
| env: | |
| NEEDS_JSON: ${{ toJSON(needs) }} | |
| run: | | |
| failed_jobs="$( | |
| jq -r ' | |
| to_entries[] | |
| | select(.value.result != "success") | |
| | .key | |
| ' <<<"$NEEDS_JSON" | |
| )" | |
| if [[ -n "$failed_jobs" ]]; then | |
| echo "Required jobs failed:" | |
| printf '%s\n' "$failed_jobs" | |
| exit 1 | |
| fi | |
| Unit: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [macos-26, ubuntu-22.04, ubuntu-24.04, ubuntu-22.04-arm, ubuntu-24.04-arm] | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: ./.github/actions/setup-go-for-project | |
| - name: test-unit | |
| shell: bash | |
| run: ./scripts/run_task.sh test-unit | |
| env: | |
| TIMEOUT: ${{ env.TIMEOUT }} | |
| Fuzz: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: ./.github/actions/setup-go-for-project | |
| - name: test-fuzz | |
| shell: bash | |
| run: ./scripts/run_task.sh test-fuzz | |
| e2e: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-24.04, ubuntu-24.04-arm] | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Run e2e tests | |
| uses: ./.github/actions/run-monitored-tmpnet-cmd | |
| with: | |
| run: ./scripts/run_task.sh test-e2e-ci | |
| artifact_prefix: e2e-${{ matrix.os }} | |
| filter_by_owner: avalanchego-e2e | |
| prometheus_url: ${{ secrets.PROMETHEUS_URL || '' }} | |
| prometheus_push_url: ${{ secrets.PROMETHEUS_PUSH_URL || '' }} | |
| prometheus_username: ${{ secrets.PROMETHEUS_USERNAME || '' }} | |
| prometheus_password: ${{ secrets.PROMETHEUS_PASSWORD || '' }} | |
| loki_url: ${{ secrets.LOKI_URL || '' }} | |
| loki_push_url: ${{ secrets.LOKI_PUSH_URL || '' }} | |
| loki_username: ${{ secrets.LOKI_USERNAME || '' }} | |
| loki_password: ${{ secrets.LOKI_PASSWORD || '' }} | |
| e2e_schedule_latest: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Run e2e tests | |
| uses: ./.github/actions/run-monitored-tmpnet-cmd | |
| with: | |
| run: ./scripts/run_task.sh test-e2e-ci -- --activate-latest-after=4m | |
| artifact_prefix: e2e-schedule-latest | |
| filter_by_owner: avalanchego-e2e | |
| prometheus_url: ${{ secrets.PROMETHEUS_URL || '' }} | |
| prometheus_push_url: ${{ secrets.PROMETHEUS_PUSH_URL || '' }} | |
| prometheus_username: ${{ secrets.PROMETHEUS_USERNAME || '' }} | |
| prometheus_password: ${{ secrets.PROMETHEUS_PASSWORD || '' }} | |
| loki_url: ${{ secrets.LOKI_URL || '' }} | |
| loki_push_url: ${{ secrets.LOKI_PUSH_URL || '' }} | |
| loki_username: ${{ secrets.LOKI_USERNAME || '' }} | |
| loki_password: ${{ secrets.LOKI_PASSWORD || '' }} | |
| e2e_post_latest: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Run e2e tests | |
| uses: ./.github/actions/run-monitored-tmpnet-cmd | |
| with: | |
| run: ./scripts/run_task.sh test-e2e-ci -- --activate-latest-after=0 | |
| artifact_prefix: e2e-post-latest | |
| filter_by_owner: avalanchego-e2e | |
| prometheus_url: ${{ secrets.PROMETHEUS_URL || '' }} | |
| prometheus_push_url: ${{ secrets.PROMETHEUS_PUSH_URL || '' }} | |
| prometheus_username: ${{ secrets.PROMETHEUS_USERNAME || '' }} | |
| prometheus_password: ${{ secrets.PROMETHEUS_PASSWORD || '' }} | |
| loki_url: ${{ secrets.LOKI_URL || '' }} | |
| loki_push_url: ${{ secrets.LOKI_PUSH_URL || '' }} | |
| loki_username: ${{ secrets.LOKI_USERNAME || '' }} | |
| loki_password: ${{ secrets.LOKI_PASSWORD || '' }} | |
| e2e_kube: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: ./.github/actions/run-monitored-tmpnet-cmd | |
| with: | |
| run: ./scripts/run_task.sh test-e2e-kube-ci | |
| runtime: kube | |
| artifact_prefix: e2e-kube | |
| filter_by_owner: avalanchego-e2e | |
| prometheus_url: ${{ secrets.PROMETHEUS_URL || '' }} | |
| prometheus_push_url: ${{ secrets.PROMETHEUS_PUSH_URL || '' }} | |
| prometheus_username: ${{ secrets.PROMETHEUS_USERNAME || '' }} | |
| prometheus_password: ${{ secrets.PROMETHEUS_PASSWORD || '' }} | |
| loki_url: ${{ secrets.LOKI_URL || '' }} | |
| loki_push_url: ${{ secrets.LOKI_PUSH_URL || '' }} | |
| loki_username: ${{ secrets.LOKI_USERNAME || '' }} | |
| loki_password: ${{ secrets.LOKI_PASSWORD || '' }} | |
| e2e_existing_network: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Run e2e tests with existing network | |
| uses: ./.github/actions/run-monitored-tmpnet-cmd | |
| with: | |
| run: ./scripts/run_task.sh test-e2e-existing-ci | |
| artifact_prefix: e2e-existing-network | |
| prometheus_url: ${{ secrets.PROMETHEUS_URL || '' }} | |
| prometheus_push_url: ${{ secrets.PROMETHEUS_PUSH_URL || '' }} | |
| prometheus_username: ${{ secrets.PROMETHEUS_USERNAME || '' }} | |
| prometheus_password: ${{ secrets.PROMETHEUS_PASSWORD || '' }} | |
| loki_url: ${{ secrets.LOKI_URL || '' }} | |
| loki_push_url: ${{ secrets.LOKI_PUSH_URL || '' }} | |
| loki_username: ${{ secrets.LOKI_USERNAME || '' }} | |
| loki_password: ${{ secrets.LOKI_PASSWORD || '' }} | |
| Upgrade: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Run e2e tests | |
| uses: ./.github/actions/run-monitored-tmpnet-cmd | |
| with: | |
| run: ./scripts/run_task.sh test-upgrade | |
| artifact_prefix: upgrade | |
| prometheus_url: ${{ secrets.PROMETHEUS_URL || '' }} | |
| prometheus_push_url: ${{ secrets.PROMETHEUS_PUSH_URL || '' }} | |
| prometheus_username: ${{ secrets.PROMETHEUS_USERNAME || '' }} | |
| prometheus_password: ${{ secrets.PROMETHEUS_PASSWORD || '' }} | |
| loki_url: ${{ secrets.LOKI_URL || '' }} | |
| loki_push_url: ${{ secrets.LOKI_PUSH_URL || '' }} | |
| loki_username: ${{ secrets.LOKI_USERNAME || '' }} | |
| loki_password: ${{ secrets.LOKI_PASSWORD || '' }} | |
| Lint: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: ./.github/actions/install-nix | |
| - name: Runs all lint checks | |
| shell: nix develop --command bash -x {0} | |
| run: ./scripts/run_task.sh lint-all-ci | |
| tausecondslint: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Check for TauSeconds misuse with time.Add() | |
| run: | | |
| if grep -rn '\.Add([^)]*TauSeconds' --include='*.go' .; then | |
| echo "ERROR: Use params.Tau (time.Duration) with time.Add(), not TauSeconds (int)" | |
| echo "TauSeconds would be interpreted as nanoseconds, not seconds" | |
| exit 1 | |
| fi | |
| links-lint: | |
| name: Markdown Links Lint | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: umbrelladocs/action-linkspector@de84085e0f51452a470558693d7d308fbb2fa261 # v1.2.5 | |
| with: | |
| fail_level: any | |
| check_generated_protobuf: | |
| name: Up-to-date protobuf | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v5 | |
| # Use the dev shell instead of bufbuild/buf-action to ensure the dev shell provides the expected versions | |
| - uses: ./.github/actions/install-nix | |
| - shell: nix develop --command bash -x {0} | |
| run: ./scripts/run_task.sh check-generate-protobuf | |
| check_mockgen: | |
| name: Up-to-date mocks | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: ./.github/actions/setup-go-for-project | |
| - shell: bash | |
| run: ./scripts/run_task.sh check-generate-mocks | |
| check_canotogen: | |
| name: Up-to-date canoto | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: ./.github/actions/setup-go-for-project | |
| - shell: bash | |
| run: ./scripts/run_task.sh check-generate-canoto | |
| check_contract_bindings: | |
| name: Up-to-date contract bindings | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: ./.github/actions/install-nix | |
| - shell: nix develop --command bash -x {0} | |
| run: task check-generate-load-contract-bindings | |
| check_go_mod_tidy: | |
| name: Up-to-date go.mod and go.sum | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: ./.github/actions/setup-go-for-project | |
| - shell: bash | |
| run: ./scripts/run_task.sh check-go-mod-tidy | |
| test_build_image: | |
| name: Image build | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up QEMU (required for cross-platform builds) | |
| uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a # v4 | |
| - name: Check image build | |
| shell: bash | |
| run: ./scripts/run_task.sh test-build-image | |
| test_build_antithesis_avalanchego_images: | |
| name: Build Antithesis avalanchego images | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: ./.github/actions/setup-go-for-project | |
| - name: Check image build for avalanchego test setup | |
| shell: bash | |
| run: ./scripts/run_task.sh test-build-antithesis-images-avalanchego | |
| test_build_antithesis_xsvm_images: | |
| name: Build Antithesis xsvm images | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: ./.github/actions/setup-go-for-project | |
| - name: Check image build for xsvm test setup | |
| shell: bash | |
| run: ./scripts/run_task.sh test-build-antithesis-images-xsvm | |
| e2e_bootstrap_monitor: | |
| name: Run bootstrap monitor e2e tests | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: ./.github/actions/install-nix | |
| - name: Run e2e tests | |
| shell: bash | |
| run: ./scripts/run_task.sh test-bootstrap-monitor-e2e | |
| - name: Collect kind diagnostics | |
| if: failure() | |
| uses: ./.github/actions/collect-kind-diagnostics | |
| with: | |
| artifact_name: bootstrap-monitor-kind-diagnostics | |
| load: | |
| name: Run process-based load test | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: ./.github/actions/run-monitored-tmpnet-cmd | |
| with: | |
| run: ./scripts/run_task.sh test-load -- --load-timeout=30s | |
| artifact_prefix: load | |
| prometheus_url: ${{ secrets.PROMETHEUS_URL || '' }} | |
| prometheus_push_url: ${{ secrets.PROMETHEUS_PUSH_URL || '' }} | |
| prometheus_username: ${{ secrets.PROMETHEUS_USERNAME || '' }} | |
| prometheus_password: ${{ secrets.PROMETHEUS_PASSWORD || '' }} | |
| loki_url: ${{ secrets.LOKI_URL || '' }} | |
| loki_push_url: ${{ secrets.LOKI_PUSH_URL || '' }} | |
| loki_username: ${{ secrets.LOKI_USERNAME || '' }} | |
| loki_password: ${{ secrets.LOKI_PASSWORD || '' }} | |
| load_kube_kind: | |
| name: Run load test on kind cluster | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: ./.github/actions/run-monitored-tmpnet-cmd | |
| with: | |
| run: ./scripts/run_task.sh test-load-kube-kind -- --load-timeout=30s | |
| runtime: kube | |
| artifact_prefix: load-kube | |
| prometheus_url: ${{ secrets.PROMETHEUS_URL || '' }} | |
| prometheus_push_url: ${{ secrets.PROMETHEUS_PUSH_URL || '' }} | |
| prometheus_username: ${{ secrets.PROMETHEUS_USERNAME || '' }} | |
| prometheus_password: ${{ secrets.PROMETHEUS_PASSWORD || '' }} | |
| loki_url: ${{ secrets.LOKI_URL || '' }} | |
| loki_push_url: ${{ secrets.LOKI_PUSH_URL || '' }} | |
| loki_username: ${{ secrets.LOKI_USERNAME || '' }} | |
| loki_password: ${{ secrets.LOKI_PASSWORD || '' }} | |
| robustness: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: ./.github/actions/install-nix | |
| # TODO(marun) Extend testing of robustness beyond deploying a suitable test environment | |
| - name: Deploy kind with chaos mesh | |
| shell: bash | |
| run: ./scripts/run_task.sh test-robustness | |
| - name: Collect kind diagnostics | |
| if: failure() | |
| uses: ./.github/actions/collect-kind-diagnostics | |
| with: | |
| artifact_name: robustness-kind-diagnostics |