From cff40aa582268b1f0f9cc61e5d51be33151554ca Mon Sep 17 00:00:00 2001 From: teor Date: Mon, 7 Mar 2022 11:59:11 +1000 Subject: [PATCH 1/4] fix(test/lightwalletd): add an alternative matching log line Sometimes lightwalletd goes straight to "Another refresh in progress", without logging "Mempool refresh error" first. --- zebrad/tests/acceptance.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/zebrad/tests/acceptance.rs b/zebrad/tests/acceptance.rs index a706d42f092..95e963387db 100644 --- a/zebrad/tests/acceptance.rs +++ b/zebrad/tests/acceptance.rs @@ -1694,10 +1694,11 @@ fn lightwalletd_integration() -> Result<()> { lightwalletd.expect_stdout_line_matches("Method not found.*error zcashd getblock rpc"); let (_, zebrad) = zebrad.kill_on_error(result)?; - // zcash/lightwalletd exits with a fatal error here, but - // adityapk00/lightwalletd keeps trying the mempool + // zcash/lightwalletd exits with a fatal error here. + // adityapk00/lightwalletd keeps trying the mempool, + // but it sometimes skips the "Method not found" log line. let result = - lightwalletd.expect_stdout_line_matches("Mempool refresh error: -32601: Method not found"); + lightwalletd.expect_stdout_line_matches("(Mempool refresh error: -32601: Method not found)|(Another refresh in progress, returning)"); let (_, zebrad) = zebrad.kill_on_error(result)?; // Cleanup both processes From e3517398395104efaebdd21fce28c3f8e14fe7cb Mon Sep 17 00:00:00 2001 From: teor Date: Tue, 8 Mar 2022 08:42:12 +1000 Subject: [PATCH 2/4] fix(ci): only run the full sync test on mergify queue PRs --- .github/workflows/test-full-sync.yml | 143 ++++++++++++++------------- 1 file changed, 73 insertions(+), 70 deletions(-) diff --git a/.github/workflows/test-full-sync.yml b/.github/workflows/test-full-sync.yml index 024d15dae1e..3012cb900f1 100644 --- a/.github/workflows/test-full-sync.yml +++ b/.github/workflows/test-full-sync.yml @@ -5,7 +5,9 @@ on: inputs: network: default: 'Mainnet' - pull_request_review: + # only run on Mergify head branches: + # https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#running-your-workflow-based-on-the-head-or-base-branch-of-a-pull-request-1 + pull_request: branches: - main paths: @@ -21,7 +23,6 @@ on: # workflow definitions - 'docker/**' - '.github/workflows/test-full-sync.yml' - types: [submitted] env: CARGO_INCREMENTAL: '1' @@ -37,76 +38,78 @@ env: jobs: build: - name: Build images - timeout-minutes: 210 - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2.4.0 - with: - persist-credentials: false - - - name: Inject slug/short variables - uses: rlespinasse/github-slug-action@v4 + run_if: + if: startsWith(github.head_ref, 'mergify/merge-queue/') + name: Build images + timeout-minutes: 210 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2.4.0 + with: + persist-credentials: false + + - name: Inject slug/short variables + uses: rlespinasse/github-slug-action@v4 # Automatic tag management and OCI Image Format Specification for labels - - name: Docker meta - id: meta - uses: docker/metadata-action@v3.6.2 - with: - # list of Docker images to use as base name for tags - images: | - ${{ env.GAR_BASE }}/${{ env.IMAGE_NAME }} - ${{ env.GCR_BASE }}/${{ env.GITHUB_REPOSITORY_SLUG_URL }}/${{ env.IMAGE_NAME }} - # generate Docker tags based on the following events/attributes - tags: | - type=schedule - type=ref,event=branch - type=ref,event=pr - type=semver,pattern={{version}} - type=semver,pattern={{major}}.{{minor}} - type=semver,pattern={{major}} - type=sha - - # Setup Docker Buildx to allow use of docker cache layers from GH - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v1 - - - name: Login to Google Artifact Registry - uses: docker/login-action@v1.12.0 - with: - registry: us-docker.pkg.dev - username: _json_key - password: ${{ secrets.GOOGLE_CREDENTIALS }} - - - name: Login to Google Container Registry - uses: docker/login-action@v1.12.0 - with: - registry: gcr.io - username: _json_key - password: ${{ secrets.GOOGLE_CREDENTIALS }} - - # Build and push image to Google Artifact Registry - - name: Build & push - id: docker_build - uses: docker/build-push-action@v2.8.0 - with: - target: tester - context: . - file: ./docker/Dockerfile - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - build-args: | - NETWORK=${{ github.event.inputs.network || env.NETWORK }} - SHORT_SHA=${{ env.GITHUB_SHA_SHORT }} - RUST_BACKTRACE=full - ZEBRA_SKIP_NETWORK_TESTS="1" - CHECKPOINT_SYNC=${{ github.event.inputs.checkpoint_sync || true }} - RUST_LOG=debug - SENTRY_DSN=${{ secrets.SENTRY_ENDPOINT }} - push: true - cache-from: type=gha - cache-to: type=gha,mode=max + - name: Docker meta + id: meta + uses: docker/metadata-action@v3.6.2 + with: + # list of Docker images to use as base name for tags + images: | + ${{ env.GAR_BASE }}/${{ env.IMAGE_NAME }} + ${{ env.GCR_BASE }}/${{ env.GITHUB_REPOSITORY_SLUG_URL }}/${{ env.IMAGE_NAME }} + # generate Docker tags based on the following events/attributes + tags: | + type=schedule + type=ref,event=branch + type=ref,event=pr + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=semver,pattern={{major}} + type=sha + + # Setup Docker Buildx to allow use of docker cache layers from GH + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v1 + + - name: Login to Google Artifact Registry + uses: docker/login-action@v1.12.0 + with: + registry: us-docker.pkg.dev + username: _json_key + password: ${{ secrets.GOOGLE_CREDENTIALS }} + + - name: Login to Google Container Registry + uses: docker/login-action@v1.12.0 + with: + registry: gcr.io + username: _json_key + password: ${{ secrets.GOOGLE_CREDENTIALS }} + + # Build and push image to Google Artifact Registry + - name: Build & push + id: docker_build + uses: docker/build-push-action@v2.8.0 + with: + target: tester + context: . + file: ./docker/Dockerfile + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + build-args: | + NETWORK=${{ github.event.inputs.network || env.NETWORK }} + SHORT_SHA=${{ env.GITHUB_SHA_SHORT }} + RUST_BACKTRACE=full + ZEBRA_SKIP_NETWORK_TESTS="1" + CHECKPOINT_SYNC=${{ github.event.inputs.checkpoint_sync || true }} + RUST_LOG=debug + SENTRY_DSN=${{ secrets.SENTRY_ENDPOINT }} + push: true + cache-from: type=gha + cache-to: type=gha,mode=max # Test that Zebra can run a full mainnet sync after a PR is approved test-full-sync: From 7e12049fda5b23b7c0ae31d737334c1cad528e07 Mon Sep 17 00:00:00 2001 From: teor Date: Tue, 8 Mar 2022 08:54:45 +1000 Subject: [PATCH 3/4] fix inconsistent indenting and syntax --- .github/workflows/test-full-sync.yml | 145 ++++++++++++++------------- 1 file changed, 73 insertions(+), 72 deletions(-) diff --git a/.github/workflows/test-full-sync.yml b/.github/workflows/test-full-sync.yml index 3012cb900f1..e89a65a3b61 100644 --- a/.github/workflows/test-full-sync.yml +++ b/.github/workflows/test-full-sync.yml @@ -38,78 +38,79 @@ env: jobs: build: - run_if: - if: startsWith(github.head_ref, 'mergify/merge-queue/') - name: Build images - timeout-minutes: 210 - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2.4.0 - with: - persist-credentials: false - - - name: Inject slug/short variables - uses: rlespinasse/github-slug-action@v4 - - # Automatic tag management and OCI Image Format Specification for labels - - name: Docker meta - id: meta - uses: docker/metadata-action@v3.6.2 - with: - # list of Docker images to use as base name for tags - images: | - ${{ env.GAR_BASE }}/${{ env.IMAGE_NAME }} - ${{ env.GCR_BASE }}/${{ env.GITHUB_REPOSITORY_SLUG_URL }}/${{ env.IMAGE_NAME }} - # generate Docker tags based on the following events/attributes - tags: | - type=schedule - type=ref,event=branch - type=ref,event=pr - type=semver,pattern={{version}} - type=semver,pattern={{major}}.{{minor}} - type=semver,pattern={{major}} - type=sha - - # Setup Docker Buildx to allow use of docker cache layers from GH - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v1 - - - name: Login to Google Artifact Registry - uses: docker/login-action@v1.12.0 - with: - registry: us-docker.pkg.dev - username: _json_key - password: ${{ secrets.GOOGLE_CREDENTIALS }} - - - name: Login to Google Container Registry - uses: docker/login-action@v1.12.0 - with: - registry: gcr.io - username: _json_key - password: ${{ secrets.GOOGLE_CREDENTIALS }} - - # Build and push image to Google Artifact Registry - - name: Build & push - id: docker_build - uses: docker/build-push-action@v2.8.0 - with: - target: tester - context: . - file: ./docker/Dockerfile - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - build-args: | - NETWORK=${{ github.event.inputs.network || env.NETWORK }} - SHORT_SHA=${{ env.GITHUB_SHA_SHORT }} - RUST_BACKTRACE=full - ZEBRA_SKIP_NETWORK_TESTS="1" - CHECKPOINT_SYNC=${{ github.event.inputs.checkpoint_sync || true }} - RUST_LOG=debug - SENTRY_DSN=${{ secrets.SENTRY_ENDPOINT }} - push: true - cache-from: type=gha - cache-to: type=gha,mode=max + # only run on Mergify head branches: + # https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#running-your-workflow-based-on-the-head-or-base-branch-of-a-pull-request-1 + if: startsWith(github.head_ref, 'mergify/merge-queue/') + name: Build images + timeout-minutes: 210 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2.4.0 + with: + persist-credentials: false + + - name: Inject slug/short variables + uses: rlespinasse/github-slug-action@v4 + + # Automatic tag management and OCI Image Format Specification for labels + - name: Docker meta + id: meta + uses: docker/metadata-action@v3.6.2 + with: + # list of Docker images to use as base name for tags + images: | + ${{ env.GAR_BASE }}/${{ env.IMAGE_NAME }} + ${{ env.GCR_BASE }}/${{ env.GITHUB_REPOSITORY_SLUG_URL }}/${{ env.IMAGE_NAME }} + # generate Docker tags based on the following events/attributes + tags: | + type=schedule + type=ref,event=branch + type=ref,event=pr + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=semver,pattern={{major}} + type=sha + + # Setup Docker Buildx to allow use of docker cache layers from GH + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v1 + + - name: Login to Google Artifact Registry + uses: docker/login-action@v1.12.0 + with: + registry: us-docker.pkg.dev + username: _json_key + password: ${{ secrets.GOOGLE_CREDENTIALS }} + + - name: Login to Google Container Registry + uses: docker/login-action@v1.12.0 + with: + registry: gcr.io + username: _json_key + password: ${{ secrets.GOOGLE_CREDENTIALS }} + + # Build and push image to Google Artifact Registry + - name: Build & push + id: docker_build + uses: docker/build-push-action@v2.8.0 + with: + target: tester + context: . + file: ./docker/Dockerfile + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + build-args: | + NETWORK=${{ github.event.inputs.network || env.NETWORK }} + SHORT_SHA=${{ env.GITHUB_SHA_SHORT }} + RUST_BACKTRACE=full + ZEBRA_SKIP_NETWORK_TESTS="1" + CHECKPOINT_SYNC=${{ github.event.inputs.checkpoint_sync || true }} + RUST_LOG=debug + SENTRY_DSN=${{ secrets.SENTRY_ENDPOINT }} + push: true + cache-from: type=gha + cache-to: type=gha,mode=max # Test that Zebra can run a full mainnet sync after a PR is approved test-full-sync: From 4253bd7f786b68a93f6357451cd55098a4de4a3d Mon Sep 17 00:00:00 2001 From: Gustavo Valverde Date: Mon, 7 Mar 2022 21:46:47 -0400 Subject: [PATCH 4/4] Update .github/workflows/test-full-sync.yml --- .github/workflows/test-full-sync.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/test-full-sync.yml b/.github/workflows/test-full-sync.yml index e89a65a3b61..f9f5887050b 100644 --- a/.github/workflows/test-full-sync.yml +++ b/.github/workflows/test-full-sync.yml @@ -5,8 +5,6 @@ on: inputs: network: default: 'Mainnet' - # only run on Mergify head branches: - # https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#running-your-workflow-based-on-the-head-or-base-branch-of-a-pull-request-1 pull_request: branches: - main