Skip to content

Commit

Permalink
Merge branch 'main' into fix-no-checkpoint-panic
Browse files Browse the repository at this point in the history
  • Loading branch information
teor2345 authored Oct 22, 2023
2 parents 92def54 + b04cca9 commit fd50038
Show file tree
Hide file tree
Showing 74 changed files with 1,657 additions and 1,248 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/cd-deploy-nodes-gcp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ jobs:
if: ${{ !cancelled() && !failure() && ((github.event_name == 'push' && github.ref_name == 'main') || github.event_name == 'release') }}

steps:
- uses: actions/[email protected].0
- uses: actions/[email protected].1
with:
persist-credentials: false

Expand Down Expand Up @@ -283,7 +283,7 @@ jobs:
if: github.event_name == 'workflow_dispatch'

steps:
- uses: actions/[email protected].0
- uses: actions/[email protected].1
with:
persist-credentials: false

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/chore-delete-gcp-resources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
contents: 'read'
id-token: 'write'
steps:
- uses: actions/[email protected].0
- uses: actions/[email protected].1
with:
persist-credentials: false

Expand Down Expand Up @@ -239,7 +239,7 @@ jobs:
contents: 'read'
id-token: 'write'
steps:
- uses: actions/[email protected].0
- uses: actions/[email protected].1
with:
persist-credentials: false

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-build-crates.patch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/[email protected].0
- uses: actions/[email protected].1

# Setup Rust with stable toolchain and minimal profile
- name: Setup Rust
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/ci-build-crates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/[email protected].0
- uses: actions/[email protected].1
- uses: r7kamura/[email protected]

# Setup Rust with stable toolchain and minimal profile
Expand Down Expand Up @@ -99,14 +99,17 @@ jobs:
build:
name: Build ${{ matrix.crate }} crate
timeout-minutes: 90
needs: [ matrix, check-matrix ]
runs-on: ubuntu-latest
strategy:
# avoid rate-limit errors by only launching a few of these jobs at a time
max-parallel: 2
fail-fast: true
matrix: ${{ fromJson(needs.matrix.outputs.matrix) }}

steps:
- uses: actions/[email protected].0
- uses: actions/[email protected].1
with:
persist-credentials: false
- uses: r7kamura/[email protected]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
runs-on: ubuntu-latest-xl

steps:
- uses: actions/[email protected].0
- uses: actions/[email protected].1
with:
persist-credentials: false

Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/ci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ jobs:
rust: ${{ steps.changed-files-rust.outputs.any_changed == 'true' }}
workflows: ${{ steps.changed-files-workflows.outputs.any_changed == 'true' }}
steps:
- uses: actions/[email protected].0
- uses: actions/[email protected].1
with:
persist-credentials: false
fetch-depth: 0

- name: Rust files
id: changed-files-rust
uses: tj-actions/[email protected].1
uses: tj-actions/[email protected].3
with:
files: |
**/*.rs
Expand All @@ -49,7 +49,7 @@ jobs:
- name: Workflow files
id: changed-files-workflows
uses: tj-actions/[email protected].1
uses: tj-actions/[email protected].3
with:
files: |
.github/workflows/*.yml
Expand All @@ -62,7 +62,7 @@ jobs:
if: ${{ needs.changed-files.outputs.rust == 'true' }}

steps:
- uses: actions/[email protected].0
- uses: actions/[email protected].1
with:
persist-credentials: false

Expand Down Expand Up @@ -112,7 +112,7 @@ jobs:
if: ${{ needs.changed-files.outputs.rust == 'true' }}

steps:
- uses: actions/[email protected].0
- uses: actions/[email protected].1
with:
persist-credentials: false
- uses: r7kamura/[email protected]
Expand Down Expand Up @@ -142,7 +142,7 @@ jobs:
needs: changed-files
if: ${{ needs.changed-files.outputs.workflows == 'true' }}
steps:
- uses: actions/[email protected].0
- uses: actions/[email protected].1
- name: actionlint
uses: reviewdog/[email protected]
with:
Expand All @@ -155,7 +155,7 @@ jobs:
runs-on: ubuntu-latest
needs: changed-files
steps:
- uses: actions/[email protected].0
- uses: actions/[email protected].1
- uses: plettich/action-codespell@master
with:
github_token: ${{ secrets.github_token }}
Expand Down
6 changes: 0 additions & 6 deletions .github/workflows/ci-unit-tests-docker.patch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,6 @@ jobs:
steps:
- run: 'echo "No build required"'

test-all-getblocktemplate-rpcs:
name: Test all with getblocktemplate-rpcs feature
runs-on: ubuntu-latest
steps:
- run: 'echo "No build required"'

test-fake-activation-heights:
name: Test with fake activation heights
runs-on: ubuntu-latest
Expand Down
66 changes: 31 additions & 35 deletions .github/workflows/ci-unit-tests-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,16 @@ on:
- '.github/workflows/sub-find-cached-disks.yml'
- '.github/workflows/sub-build-docker-image.yml'

env:
# We need to combine the features manually because some tests don't use the Docker entrypoint
TEST_FEATURES: ${{ format('{0} {1}', vars.RUST_PROD_FEATURES, vars.RUST_TEST_FEATURES) }}
EXPERIMENTAL_FEATURES: ${{ format('{0} {1} {2}', vars.RUST_PROD_FEATURES, vars.RUST_TEST_FEATURES, vars.RUST_EXPERIMENTAL_FEATURES) }}
RUST_LOG: ${{ vars.RUST_LOG }}
RUST_BACKTRACE: ${{ vars.RUST_BACKTRACE }}
RUST_LIB_BACKTRACE: ${{ vars.RUST_LIB_BACKTRACE }}
COLORBT_SHOW_HIDDEN: ${{ vars.COLORBT_SHOW_HIDDEN }}
CARGO_INCREMENTAL: ${{ vars.CARGO_INCREMENTAL }}

jobs:
# Build the docker image used by the tests.
#
Expand All @@ -85,12 +95,10 @@ jobs:

# Run all the zebra tests, including tests that are ignored by default.
#
# - 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
timeout-minutes: 180
runs-on: ubuntu-latest-xl
needs: build
steps:
Expand All @@ -104,32 +112,17 @@ jobs:
# Run unit, basic acceptance tests, and ignored tests, only showing command output if the test fails.
#
# If some tests hang, add "-- --nocapture" for just that test, or for all the tests.
#
# TODO: move this test command into entrypoint.sh
# add a separate experimental workflow job if this job is slow
- name: Run zebrad tests
run: |
docker pull ${{ vars.GAR_BASE }}/${{ vars.CI_IMAGE_NAME }}@${{ needs.build.outputs.image_digest }}
docker run -e NETWORK --name zebrad-tests --tty ${{ vars.GAR_BASE }}/${{ vars.CI_IMAGE_NAME }}@${{ needs.build.outputs.image_digest }} cargo test --locked --release --features "lightwalletd-grpc-tests" --workspace -- --include-ignored
env:
NETWORK: ${{ inputs.network || vars.ZCASH_NETWORK }}

# 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
runs-on: ubuntu-latest-xl
needs: build
steps:
- uses: r7kamura/[email protected]

- name: Inject slug/short variables
uses: rlespinasse/github-slug-action@v4
with:
short-length: 7

- name: Run zebrad tests
run: |
docker pull ${{ vars.GAR_BASE }}/${{ vars.CI_IMAGE_NAME }}@${{ needs.build.outputs.image_digest }}
docker run -e NETWORK --name zebrad-tests --tty -e ${{ inputs.network || vars.ZCASH_NETWORK }} ${{ vars.GAR_BASE }}/${{ vars.CI_IMAGE_NAME }}@${{ needs.build.outputs.image_digest }} cargo test --locked --release --features "lightwalletd-grpc-tests getblocktemplate-rpcs" --workspace -- --include-ignored
docker run -e NETWORK --name zebrad-tests --tty ${{ vars.GAR_BASE }}/${{ vars.CI_IMAGE_NAME }}@${{ needs.build.outputs.image_digest }} cargo test --locked --release --features "${{ env.TEST_FEATURES }}" --workspace -- --include-ignored
# Currently GitHub doesn't allow empty variables
if [[ -n "${{ vars.RUST_EXPERIMENTAL_FEATURES }}" && "${{ vars.RUST_EXPERIMENTAL_FEATURES }}" != " " ]]; then
docker run -e NETWORK --name zebrad-tests-experimental --tty ${{ vars.GAR_BASE }}/${{ vars.CI_IMAGE_NAME }}@${{ needs.build.outputs.image_digest }} cargo test --locked --release --features "${{ env.EXPERIMENTAL_FEATURES }} " --workspace -- --include-ignored
fi
env:
NETWORK: ${{ inputs.network || vars.ZCASH_NETWORK }}

Expand All @@ -141,9 +134,10 @@ jobs:
#
# Also, we don't want to accidentally use the fake heights in other tests.
#
# (The gRPC feature is a zebrad feature, so it isn't needed here.)
# (We activate the test features to avoid recompiling dependencies, but we don't actually run any gRPC tests.)
test-fake-activation-heights:
name: Test with fake activation heights
timeout-minutes: 60
runs-on: ubuntu-latest
needs: build
steps:
Expand All @@ -154,19 +148,20 @@ jobs:
with:
short-length: 7

# TODO: move this test command into entrypoint.sh
# make sure that at least one test runs, and that it doesn't skip itself due to the environmental variable
- name: Run tests with fake activation heights
run: |
docker pull ${{ vars.GAR_BASE }}/${{ vars.CI_IMAGE_NAME }}@${{ needs.build.outputs.image_digest }}
docker run -e NETWORK -e TEST_FAKE_ACTIVATION_HEIGHTS --name zebrad-tests -t ${{ vars.GAR_BASE }}/${{ vars.CI_IMAGE_NAME }}@${{ needs.build.outputs.image_digest }} cargo test --locked --release --package zebra-state --lib -- --nocapture --include-ignored with_fake_activation_heights
docker run -e NETWORK -e TEST_FAKE_ACTIVATION_HEIGHTS --name zebrad-tests -t ${{ vars.GAR_BASE }}/${{ vars.CI_IMAGE_NAME }}@${{ needs.build.outputs.image_digest }} cargo test --locked --release --features "zebra-test" --package zebra-state --lib -- --nocapture --include-ignored with_fake_activation_heights
env:
TEST_FAKE_ACTIVATION_HEIGHTS: '1'
NETWORK: ${{ inputs.network || vars.ZCASH_NETWORK }}

# Test that Zebra syncs and checkpoints a few thousand blocks from an empty state.
#
# (We activate the gRPC feature to avoid recompiling `zebrad`, but we don't actually run any gRPC tests.)
test-empty-sync:
name: Test checkpoint sync from empty state
timeout-minutes: 60
runs-on: ubuntu-latest
needs: build
steps:
Expand All @@ -177,18 +172,18 @@ jobs:
with:
short-length: 7

# TODO: move this test command into entrypoint.sh
- name: Run zebrad large sync tests
run: |
docker pull ${{ vars.GAR_BASE }}/${{ vars.CI_IMAGE_NAME }}@${{ needs.build.outputs.image_digest }}
docker run -e NETWORK --name zebrad-tests -t ${{ vars.GAR_BASE }}/${{ vars.CI_IMAGE_NAME }}@${{ needs.build.outputs.image_digest }} cargo test --locked --release --features lightwalletd-grpc-tests --package zebrad --test acceptance -- --nocapture --include-ignored sync_large_checkpoints_
docker run -e NETWORK --name zebrad-tests -t ${{ vars.GAR_BASE }}/${{ vars.CI_IMAGE_NAME }}@${{ needs.build.outputs.image_digest }} cargo test --locked --release --features "${{ env.TEST_FEATURES }}" --package zebrad --test acceptance -- --nocapture --include-ignored sync_large_checkpoints_
env:
NETWORK: ${{ inputs.network || vars.ZCASH_NETWORK }}

# Test launching lightwalletd with an empty lightwalletd and Zebra state.
#
# (We activate the gRPC feature to avoid recompiling `zebrad`, but we don't actually run any gRPC tests.)
test-lightwalletd-integration:
name: Test integration with lightwalletd
timeout-minutes: 60
runs-on: ubuntu-latest
needs: build
steps:
Expand All @@ -199,10 +194,11 @@ jobs:
with:
short-length: 7

# TODO: move this test command into entrypoint.sh
- name: Run tests with empty lightwalletd launch
run: |
docker pull ${{ vars.GAR_BASE }}/${{ vars.CI_IMAGE_NAME }}@${{ needs.build.outputs.image_digest }}
docker run -e NETWORK -e ZEBRA_TEST_LIGHTWALLETD --name lightwalletd-tests -t ${{ vars.GAR_BASE }}/${{ vars.CI_IMAGE_NAME }}@${{ needs.build.outputs.image_digest }} cargo test --locked --release --features lightwalletd-grpc-tests --package zebrad --test acceptance -- --nocapture --include-ignored lightwalletd_integration
docker run -e NETWORK -e ZEBRA_TEST_LIGHTWALLETD --name lightwalletd-tests -t ${{ vars.GAR_BASE }}/${{ vars.CI_IMAGE_NAME }}@${{ needs.build.outputs.image_digest }} cargo test --locked --release --features "${{ env.TEST_FEATURES }}" --package zebrad --test acceptance -- --nocapture --include-ignored lightwalletd_integration
env:
ZEBRA_TEST_LIGHTWALLETD: '1'
NETWORK: ${{ inputs.network || vars.ZCASH_NETWORK }}
Expand Down Expand Up @@ -251,7 +247,7 @@ jobs:
#
# This list is for reliable tests that are run on the `main` branch.
# Testnet jobs are not in this list, because we expect testnet to fail occasionally.
needs: [ test-all, test-all-getblocktemplate-rpcs, test-fake-activation-heights, test-empty-sync, test-lightwalletd-integration, test-configuration-file, test-zebra-conf-path ]
needs: [ test-all, test-fake-activation-heights, test-empty-sync, test-lightwalletd-integration, test-configuration-file, test-zebra-conf-path ]
# Only open tickets for failed scheduled jobs, manual workflow runs, or `main` branch merges.
# (PR statuses are already reported in the PR jobs list, and checked by Mergify.)
# TODO: if a job times out, we want to create a ticket. Does failure() do that? Or do we need cancelled()?
Expand Down
9 changes: 1 addition & 8 deletions .github/workflows/ci-unit-tests-os.patch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,12 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
# TODO: Windows was removed for now, see https://github.com/ZcashFoundation/zebra/issues/3801
# TODO: macOS tests were removed for now, see https://github.com/ZcashFoundation/zebra/issues/6824
os: [ubuntu-latest]
rust: [stable, beta]
features: ["", " --features getblocktemplate-rpcs"]
features: [""]
exclude:
- os: macos-latest
rust: beta
- os: macos-latest
features: " --features getblocktemplate-rpcs"
- os: ubuntu-latest
rust: beta
features: " --features getblocktemplate-rpcs"

steps:
- run: 'echo "No build required"'
Expand Down
Loading

0 comments on commit fd50038

Please sign in to comment.