From 2dc8c0a2bd613a89a56c23bf34152ef195e708e2 Mon Sep 17 00:00:00 2001 From: teor Date: Fri, 4 Nov 2022 16:57:36 +1000 Subject: [PATCH] fix(ci): Make "test all" log output shorter (#5521) * Make "test all" log output shorter * Use different docker instance names * Spell out command-line arguments * Fix option names * Use nocapture on basic tests but not ignored tests Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- .../continous-integration-docker.yml | 25 +++++++++++++++---- .../workflows/continous-integration-os.yml | 5 +++- 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/.github/workflows/continous-integration-docker.yml b/.github/workflows/continous-integration-docker.yml index 1f98e1ea..126a88e5 100644 --- a/.github/workflows/continous-integration-docker.yml +++ b/.github/workflows/continous-integration-docker.yml @@ -187,6 +187,8 @@ jobs: # # - We run all the tests behind the `getblocktemplate-rpcs` feature as a separated step. # - We activate the gRPC feature to avoid recompiling `zebrad`, but we don't actually run any gRPC tests. + # + # TODO: turn this test and the getblocktemplate test into a matrix, so the jobs use exactly the same diagnostics settings test-all: name: Test all runs-on: ubuntu-latest @@ -198,13 +200,21 @@ jobs: with: short-length: 7 - - name: Run all zebrad tests + # Run unit and basic acceptance tests, only showing command output if the test fails. + # + # If some tests hang, add "-- --nocapture" for just that test, or for all the tests. + - name: Run basic zebrad tests run: | docker pull ${{ env.GAR_BASE }}/${{ env.IMAGE_NAME }}:sha-${{ env.GITHUB_SHA_SHORT }} - docker run --name zebrad-tests -t ${{ env.GAR_BASE }}/${{ env.IMAGE_NAME }}:sha-${{ env.GITHUB_SHA_SHORT }} cargo test --locked --release --features "lightwalletd-grpc-tests" --workspace -- --nocapture --include-ignored + docker run --name zebrad-tests --tty ${{ env.GAR_BASE }}/${{ env.IMAGE_NAME }}:sha-${{ env.GITHUB_SHA_SHORT }} cargo test --locked --release --features "lightwalletd-grpc-tests" --workspace + + # Run ignored by default acceptance tests, only showing command output if the test fails. + - name: Run ignored zebrad tests + run: | + docker run --name zebrad-tests-ignored --tty ${{ env.GAR_BASE }}/${{ env.IMAGE_NAME }}:sha-${{ env.GITHUB_SHA_SHORT }} cargo test --locked --release --features "lightwalletd-grpc-tests" --workspace -- --ignored --nocapture # zebrad tests without cached state with `getblocktemplate-rpcs` feature - + # # Same as above but we run all the tests behind the `getblocktemplate-rpcs` feature. test-all-getblocktemplate-rpcs: name: Test all with getblocktemplate-rpcs feature @@ -217,10 +227,15 @@ jobs: with: short-length: 7 - - name: Run all zebrad tests + - name: Run basic zebrad tests run: | docker pull ${{ env.GAR_BASE }}/${{ env.IMAGE_NAME }}:sha-${{ env.GITHUB_SHA_SHORT }} - docker run --name zebrad-tests -t ${{ env.GAR_BASE }}/${{ env.IMAGE_NAME }}:sha-${{ env.GITHUB_SHA_SHORT }} cargo test --locked --release --features "lightwalletd-grpc-tests getblocktemplate-rpcs" --workspace -- --nocapture --include-ignored + docker run --name zebrad-tests --tty ${{ env.GAR_BASE }}/${{ env.IMAGE_NAME }}:sha-${{ env.GITHUB_SHA_SHORT }} cargo test --locked --release --features "lightwalletd-grpc-tests getblocktemplate-rpcs" --workspace + + - name: Run ignored zebrad tests + run: | + docker pull ${{ env.GAR_BASE }}/${{ env.IMAGE_NAME }}:sha-${{ env.GITHUB_SHA_SHORT }} + docker run --name zebrad-tests-ignored --tty ${{ env.GAR_BASE }}/${{ env.IMAGE_NAME }}:sha-${{ env.GITHUB_SHA_SHORT }} cargo test --locked --release --features "lightwalletd-grpc-tests getblocktemplate-rpcs" --workspace -- --ignored --nocapture # Run state tests with fake activation heights. # diff --git a/.github/workflows/continous-integration-os.yml b/.github/workflows/continous-integration-os.yml index 4657e20d..92d3d0c5 100644 --- a/.github/workflows/continous-integration-os.yml +++ b/.github/workflows/continous-integration-os.yml @@ -162,11 +162,14 @@ jobs: working-directory: ./zebra-consensus run: cargo run --example download-params + # Run unit and basic acceptance tests, only showing command output if the test fails. + # + # If some tests hang, add "-- --nocapture" for just that test, or for all the tests. - name: Run tests${{ matrix.features }} uses: actions-rs/cargo@v1.0.3 with: command: test - args: ${{ matrix.features }} --verbose --workspace -- --nocapture + args: ${{ matrix.features }} --verbose --workspace # Explicitly run any tests that are usually #[ignored]