From 466adc71a60f3e2946d63d9a7fe34c1116589d03 Mon Sep 17 00:00:00 2001 From: Arya Date: Wed, 26 Oct 2022 17:26:07 -0400 Subject: [PATCH] change(ci): only run the send transaction test on the main branch (#5480) * only run the send transaction test on the main branch * adds patch job * Add concurrency rule to the send transactions test * Apply suggestions from code review Co-authored-by: teor * Allow send tx test to be triggered manually Co-authored-by: teor --- ...tinous-integration-docker.patch-always.yml | 6 ++++ .../continous-integration-docker.yml | 36 ++++++++++++------- 2 files changed, 30 insertions(+), 12 deletions(-) diff --git a/.github/workflows/continous-integration-docker.patch-always.yml b/.github/workflows/continous-integration-docker.patch-always.yml index ccda278d..baaeaa56 100644 --- a/.github/workflows/continous-integration-docker.patch-always.yml +++ b/.github/workflows/continous-integration-docker.patch-always.yml @@ -24,3 +24,9 @@ jobs: runs-on: ubuntu-latest steps: - run: 'echo "No build required"' + + lightwalletd-transactions-test: + name: lightwalletd tip send / Run lwd-send-transactions test + runs-on: ubuntu-latest + steps: + - run: 'echo "No build required"' diff --git a/.github/workflows/continous-integration-docker.yml b/.github/workflows/continous-integration-docker.yml index 4b81eb00..1f98e1ea 100644 --- a/.github/workflows/continous-integration-docker.yml +++ b/.github/workflows/continous-integration-docker.yml @@ -33,6 +33,11 @@ on: default: false description: 'Just run a lightwalletd full sync and update tip disks' required: true + run-lwd-send-tx: + type: boolean + default: false + description: 'Just run a lightwalletd send transactions test' + required: true pull_request: @@ -186,7 +191,7 @@ jobs: name: Test all runs-on: ubuntu-latest needs: build - if: ${{ github.event.inputs.regenerate-disks != 'true' && github.event.inputs.run-full-sync != 'true' && github.event.inputs.run-lwd-sync != 'true' }} + if: ${{ github.event.inputs.regenerate-disks != 'true' && github.event.inputs.run-full-sync != 'true' && github.event.inputs.run-lwd-sync != 'true' && github.event.inputs.run-lwd-send-tx != 'true' }} steps: - name: Inject slug/short variables uses: rlespinasse/github-slug-action@v4 @@ -205,7 +210,7 @@ jobs: name: Test all with getblocktemplate-rpcs feature runs-on: ubuntu-latest needs: build - if: ${{ github.event.inputs.regenerate-disks != 'true' && github.event.inputs.run-full-sync != 'true' && github.event.inputs.run-lwd-sync != 'true' }} + if: ${{ github.event.inputs.regenerate-disks != 'true' && github.event.inputs.run-full-sync != 'true' && github.event.inputs.run-lwd-sync != 'true' && github.event.inputs.run-lwd-send-tx != 'true' }} steps: - name: Inject slug/short variables uses: rlespinasse/github-slug-action@v4 @@ -230,7 +235,7 @@ jobs: name: Test with fake activation heights runs-on: ubuntu-latest needs: build - if: ${{ github.event.inputs.regenerate-disks != 'true' && github.event.inputs.run-full-sync != 'true' && github.event.inputs.run-lwd-sync != 'true' }} + if: ${{ github.event.inputs.regenerate-disks != 'true' && github.event.inputs.run-full-sync != 'true' && github.event.inputs.run-lwd-sync != 'true' && github.event.inputs.run-lwd-send-tx != 'true' }} steps: - name: Inject slug/short variables uses: rlespinasse/github-slug-action@v4 @@ -251,7 +256,7 @@ jobs: name: Test checkpoint sync from empty state runs-on: ubuntu-latest needs: build - if: ${{ github.event.inputs.regenerate-disks != 'true' && github.event.inputs.run-full-sync != 'true' && github.event.inputs.run-lwd-sync != 'true' }} + if: ${{ github.event.inputs.regenerate-disks != 'true' && github.event.inputs.run-full-sync != 'true' && github.event.inputs.run-lwd-sync != 'true' && github.event.inputs.run-lwd-send-tx != 'true' }} steps: - name: Inject slug/short variables uses: rlespinasse/github-slug-action@v4 @@ -270,7 +275,7 @@ jobs: name: Test integration with lightwalletd runs-on: ubuntu-latest needs: build - if: ${{ github.event.inputs.regenerate-disks != 'true' && github.event.inputs.run-full-sync != 'true' && github.event.inputs.run-lwd-sync != 'true' }} + if: ${{ github.event.inputs.regenerate-disks != 'true' && github.event.inputs.run-full-sync != 'true' && github.event.inputs.run-lwd-sync != 'true' && github.event.inputs.run-lwd-send-tx != 'true' }} steps: - name: Inject slug/short variables uses: rlespinasse/github-slug-action@v4 @@ -324,7 +329,7 @@ jobs: name: Zebra checkpoint update needs: regenerate-stateful-disks uses: ./.github/workflows/deploy-gcp-tests.yml - if: ${{ !cancelled() && !failure() && github.event.inputs.regenerate-disks != 'true' && github.event.inputs.run-full-sync != 'true' && github.event.inputs.run-lwd-sync != 'true' }} + if: ${{ !cancelled() && !failure() && github.event.inputs.regenerate-disks != 'true' && github.event.inputs.run-full-sync != 'true' && github.event.inputs.run-lwd-sync != 'true' && github.event.inputs.run-lwd-send-tx != 'true' }} with: app_name: zebrad test_id: sync-past-checkpoint @@ -390,7 +395,7 @@ jobs: name: Zebra tip update needs: test-full-sync uses: ./.github/workflows/deploy-gcp-tests.yml - if: ${{ !cancelled() && !failure() && github.event.inputs.regenerate-disks != 'true' && github.event.inputs.run-full-sync != 'true' && github.event.inputs.run-lwd-sync != 'true' }} + if: ${{ !cancelled() && !failure() && github.event.inputs.regenerate-disks != 'true' && github.event.inputs.run-full-sync != 'true' && github.event.inputs.run-lwd-sync != 'true' && github.event.inputs.run-lwd-send-tx != 'true' }} with: app_name: zebrad test_id: update-to-tip @@ -455,7 +460,7 @@ jobs: name: lightwalletd tip update needs: lightwalletd-full-sync uses: ./.github/workflows/deploy-gcp-tests.yml - if: ${{ !cancelled() && !failure() && github.event.inputs.regenerate-disks != 'true' && github.event.inputs.run-full-sync != 'true' && github.event.inputs.run-lwd-sync != 'true' }} + if: ${{ !cancelled() && !failure() && github.event.inputs.regenerate-disks != 'true' && github.event.inputs.run-full-sync != 'true' && github.event.inputs.run-lwd-sync != 'true' && github.event.inputs.run-lwd-send-tx != 'true' }} with: app_name: lightwalletd test_id: lwd-update-sync @@ -484,7 +489,7 @@ jobs: name: Zebra tip JSON-RPC needs: test-full-sync uses: ./.github/workflows/deploy-gcp-tests.yml - if: ${{ !cancelled() && !failure() && github.event.inputs.regenerate-disks != 'true' && github.event.inputs.run-full-sync != 'true' && github.event.inputs.run-lwd-sync != 'true' }} + if: ${{ !cancelled() && !failure() && github.event.inputs.regenerate-disks != 'true' && github.event.inputs.run-full-sync != 'true' && github.event.inputs.run-lwd-sync != 'true' && github.event.inputs.run-lwd-send-tx != 'true' }} with: app_name: lightwalletd test_id: fully-synced-rpc @@ -500,7 +505,6 @@ jobs: # # Runs: # - after every PR is merged to `main` - # - on every PR update # # If the state version has changed, waits for the new cached states to be created. # Otherwise, if the state rebuild was skipped, runs immediately after the build job. @@ -509,7 +513,7 @@ jobs: name: lightwalletd tip send needs: lightwalletd-full-sync uses: ./.github/workflows/deploy-gcp-tests.yml - if: ${{ !cancelled() && !failure() && github.event.inputs.regenerate-disks != 'true' && github.event.inputs.run-full-sync != 'true' && github.event.inputs.run-lwd-sync != 'true' }} + if: ${{ !cancelled() && !failure() && ((github.event_name == 'push' && github.ref_name == 'main') || github.event.inputs.run-lwd-send-tx == 'true') }} with: app_name: lightwalletd test_id: lwd-send-transactions @@ -522,6 +526,14 @@ jobs: root_state_path: '/var/cache' zebra_state_dir: 'zebrad-cache' lwd_state_dir: 'lwd-cache' + # We want to prevent multiple lightwalletd send transaction tests running at the same time, + # but we don't want to cancel running tests on `main` if a new PR gets merged, + # because we might never get a finished test. + # + # See the concurrency comment on the zebrad test-full-sync job for details. + concurrency: + group: ${{ github.workflow }}−${{ github.ref }}-lightwalletd-transactions-test + cancel-in-progress: false # Test that Zebra can handle gRPC wallet calls, using a cached Zebra tip state # @@ -535,7 +547,7 @@ jobs: name: lightwalletd GRPC tests needs: lightwalletd-full-sync uses: ./.github/workflows/deploy-gcp-tests.yml - if: ${{ !cancelled() && !failure() && github.event.inputs.regenerate-disks != 'true' && github.event.inputs.run-full-sync != 'true' && github.event.inputs.run-lwd-sync != 'true' }} + if: ${{ !cancelled() && !failure() && github.event.inputs.regenerate-disks != 'true' && github.event.inputs.run-full-sync != 'true' && github.event.inputs.run-lwd-sync != 'true' && github.event.inputs.run-lwd-send-tx != 'true' }} with: app_name: lightwalletd test_id: lwd-grpc-wallet