Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
6301c3b
ref(docker): improve cargo caching by aligning mounts with CARGO_HOME
gustavovalverde Apr 17, 2025
683db84
chore: fix typo
gustavovalverde Apr 29, 2025
6463d15
test: do not use cache mounts
gustavovalverde May 5, 2025
b3048dd
chore: trigger a build
gustavovalverde May 5, 2025
c53b392
imp(docker): revert to binds with `-Z checksum-freshness` Rust flag
gustavovalverde May 14, 2025
bf3605f
chore: trigger a build
gustavovalverde May 14, 2025
fec84d8
chore: reduce diff
gustavovalverde Jul 31, 2025
72d967f
fix: remove extra steps
gustavovalverde Jul 31, 2025
4b4ac6e
fix: reduce complexity
gustavovalverde Jul 31, 2025
f809abc
revert: use a better approach
gustavovalverde Jul 31, 2025
a5b0633
fix: create and own the cargo and cargo target folders
gustavovalverde Jul 31, 2025
ae5b63c
test building several features
gustavovalverde Aug 1, 2025
30cabdb
use nextest and avoid rustup compilation at runtime
gustavovalverde Aug 1, 2025
430579f
refactor: consolidate test features and migrate to cargo-nextest
gustavovalverde Aug 1, 2025
0fd48e5
fix: use correct package management
gustavovalverde Aug 1, 2025
a62ac20
fix: better handle different test cases
gustavovalverde Aug 1, 2025
3df79b9
refactor(ci): use nextest for triggering tests
gustavovalverde Aug 2, 2025
391e580
fix: use nextest overrides
gustavovalverde Aug 2, 2025
fc934b0
fix: delete extra profiles
gustavovalverde Aug 3, 2025
643452f
fix: use default filter instead
gustavovalverde Aug 3, 2025
cbf8507
refactor(testing): Use envars and nextest profiles for test control
gustavovalverde Aug 4, 2025
b766e68
refactor: remove compile-time feature gates from tests in favor of ru…
gustavovalverde Aug 4, 2025
e8cfc05
fix: build
gustavovalverde Aug 4, 2025
a5e10c9
feat: add indexer as a default feature
gustavovalverde Aug 4, 2025
3a883f0
refactor: make lightwalletd-grpc-tests and indexer features optional
gustavovalverde Aug 4, 2025
4a0755f
refactor(tests): remove unused import and use fully qualified path
gustavovalverde Aug 4, 2025
93311d0
refactor(docker): simplify dockerfile
gustavovalverde Aug 4, 2025
ed0607c
fix: formatting
gustavovalverde Aug 4, 2025
d7e72e0
fix: use the default cargo directories
gustavovalverde Aug 4, 2025
f1cd560
fix: build
gustavovalverde Aug 4, 2025
e88ddf0
fix: cargo ownership
gustavovalverde Aug 4, 2025
6da21f1
fix: use correct test filtering with nextest
gustavovalverde Aug 4, 2025
74a2e3e
fix: avoid cargo cache invalidation
gustavovalverde Aug 4, 2025
15a07ef
fix(ci): Correct Docker test execution and platform filtering
gustavovalverde Aug 4, 2025
ca325dc
fix: improve caching
gustavovalverde Aug 4, 2025
b844371
fix: segregate sync-past-mandatory test
gustavovalverde Aug 4, 2025
06efc95
fix: show output for specific test
gustavovalverde Aug 5, 2025
d99090e
revert: most sync and lwd changes
gustavovalverde Aug 5, 2025
dd9aeaf
fix: remove indexer
gustavovalverde Aug 5, 2025
45cf591
chore: reduce diff
gustavovalverde Aug 5, 2025
59fd617
fix: nextest timeouts
gustavovalverde Aug 5, 2025
a364067
Apply suggestions from code review
gustavovalverde Aug 6, 2025
c90c674
fix: linting errors
gustavovalverde Aug 6, 2025
d06e0f1
chore: update documentation and add missing profiles
gustavovalverde Aug 6, 2025
0e84e1e
chore: more documentation fixes
gustavovalverde Aug 6, 2025
7463aa4
Merge branch 'main' into imp-caching
gustavovalverde Aug 8, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
109 changes: 109 additions & 0 deletions .config/nextest.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
# Nextest configuration for Zebra
# This file centralizes all test execution configuration.

[profile.default]
fail-fast = true
status-level = "pass"

# --- All Tests profile ---
# Runs all tests except 'check_no_git_dependencies'
[profile.all-tests]
default-filter = 'not test(check_no_git_dependencies)'

# --- Individual Test Profiles ---

[profile.check-no-git-dependencies]
default-filter = 'test(check_no_git_dependencies)'

[profile.state-fake-activation-heights]
slow-timeout = { period = "10m", terminate-after = 1 }
default-filter = 'package(zebra-state) and test(~with_fake_activation_heights)'

[profile.sync-large-checkpoints-empty]
slow-timeout = { period = "60m", terminate-after = 2 }
default-filter = 'package(zebrad) and test(=sync_large_checkpoints_empty)'

[profile.sync-full-mainnet]
slow-timeout = { period = "30000m", terminate-after = 1 }
success-output = "immediate"
default-filter = 'package(zebrad) and test(=sync_full_mainnet)'

[profile.sync-full-testnet]
slow-timeout = { period = "1500m", terminate-after = 1 }
success-output = "immediate"
default-filter = 'package(zebrad) and test(=sync_full_testnet)'

[profile.sync-to-mandatory-checkpoint]
slow-timeout = { period = "1500m", terminate-after = 1 }
success-output = "immediate"
default-filter = 'package(zebrad) and test(~sync_to_mandatory_checkpoint_)'

[profile.sync-update-mainnet]
slow-timeout = { period = "30m", terminate-after = 2 }
success-output = "immediate"
default-filter = 'package(zebrad) and test(=sync_update_mainnet)'

[profile.sync-past-mandatory-checkpoint-mainnet]
slow-timeout = { period = "60m", terminate-after = 2 }
default-filter = 'package(zebrad) and test(=sync_past_mandatory_checkpoint_mainnet)'

[profile.sync-past-mandatory-checkpoint-testnet]
slow-timeout = { period = "60m", terminate-after = 2 }
default-filter = 'package(zebrad) and test(=sync_past_mandatory_checkpoint_testnet)'

[profile.generate-checkpoints-mainnet]
slow-timeout = { period = "90m", terminate-after = 1 }
success-output = "immediate"
default-filter = 'package(zebrad) and test(=generate_checkpoints_mainnet)'

[profile.generate-checkpoints-testnet]
slow-timeout = { period = "90m", terminate-after = 1 }
success-output = "immediate"
default-filter = 'package(zebrad) and test(=generate_checkpoints_testnet)'

[profile.lwd-rpc-test]
test-threads = 1
slow-timeout = { period = "60m", terminate-after = 2 }
default-filter = 'package(zebrad) and test(=lwd_rpc_test)'

[profile.lwd-integration]
slow-timeout = { period = "30m", terminate-after = 2 }
default-filter = 'package(zebrad) and test(=lwd_integration)'

[profile.lwd-sync-full]
slow-timeout = { period = "30000m", terminate-after = 1 }
success-output = "immediate"
default-filter = 'package(zebrad) and test(=lwd_sync_full)'

[profile.lwd-sync-update]
slow-timeout = { period = "30m", terminate-after = 2 }
success-output = "immediate"
default-filter = 'package(zebrad) and test(=lwd_sync_update)'

[profile.lwd-grpc-wallet]
slow-timeout = { period = "60m", terminate-after = 2 }
default-filter = 'package(zebrad) and test(=lwd_grpc_wallet)'

[profile.lwd-rpc-send-tx]
slow-timeout = { period = "30m", terminate-after = 2 }
default-filter = 'package(zebrad) and test(=lwd_rpc_send_tx)'

[profile.rpc-get-block-template]
slow-timeout = { period = "30m", terminate-after = 2 }
default-filter = 'package(zebrad) and test(=rpc_get_block_template)'

[profile.rpc-submit-block]
slow-timeout = { period = "30m", terminate-after = 2 }
default-filter = 'package(zebrad) and test(=rpc_submit_block)'

[profile.indexer-has-spending-transaction-ids]
slow-timeout = { period = "30m", terminate-after = 2 }
default-filter = 'package(zebrad) and test(=has_spending_transaction_ids)'

[profile.lightwalletd-test-suite]
slow-timeout = { period = "60m", terminate-after = 2 }
default-filter = 'package(zebrad) and test(=lightwalletd_test_suite)'

[profile.rpc-z-getsubtreesbyindex-snapshot]
slow-timeout = { period = "30m", terminate-after = 2 }
default-filter = 'package(zebrad) and test(=fully_synced_rpc_z_getsubtreesbyindex_snapshot_test)'
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# Now un-exclude required files and folders:
#
!.cargo
!.config
!*.toml
!*.lock
!tower-*
Expand Down
30 changes: 19 additions & 11 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,26 +206,34 @@ Our use of patch workflows (`.patch.yml` and `.patch-external.yml`) is a workaro

## Test Execution Strategy

### Test Orchestration
### Test Orchestration with Nextest

Our test execution is centralized through our Docker [entrypoint script](http://../../docker/entrypoint.sh), providing a unified way to run tests both in CI and locally.
Our test execution is centralized through our Docker [entrypoint script](http://../../docker/entrypoint.sh) and orchestrated by `cargo nextest`. This provides a unified and efficient way to run tests both in CI and locally.

#### Environment Variable-driven Testing
#### Nextest Profile-driven Testing

We use `nextest` profiles defined in [`.config/nextest.toml`](../../.config/nextest.toml) to manage test suites. A single environment variable, `NEXTEST_PROFILE`, selects the profile to run.

```bash
# Full test suite
docker run --rm -e RUN_ALL_TESTS=1 zebra-tests
# Run the full test suite using the 'all-tests' profile
docker run --rm -e NEXTEST_PROFILE=all-tests zebra-tests

# Specific test suites
docker run --rm -e LIGHTWALLETD_INTEGRATION=1 zebra-tests
# Run a specific test suite, like the lightwalletd integration tests
docker run --rm -e NEXTEST_PROFILE=lwd-integration zebra-tests
```

#### Test Categories

- Full suite (`RUN_ALL_TESTS`)
- Integration tests (`LIGHTWALLETD_INTEGRATION`)
- Network sync (`SYNC_LARGE_CHECKPOINTS_EMPTY`, `SYNC_UPDATE`)
- State management (`SYNC_TO_MANDATORY_CHECKPOINT`)
Our tests are organized into different categories:

- **Unit & Integration Tests**: Basic functionality and component testing
- **Network Sync Tests**: Testing blockchain synchronization from various states
- **Lightwalletd Tests**: Integration with the lightwalletd service
- **RPC Tests**: JSON-RPC endpoint functionality
- **Checkpoint Tests**: Blockchain checkpoint generation and validation

Each test category has specific profiles that can be run individually using the `NEXTEST_PROFILE` environment variable.


### Pull Request Testing

Expand Down
28 changes: 14 additions & 14 deletions .github/workflows/sub-ci-integration-tests-gcp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ jobs:
app_name: zebrad
test_id: sync-to-mandatory-checkpoint
test_description: Test sync up to mandatory checkpoint
test_variables: "NETWORK=${{ inputs.network || vars.ZCASH_NETWORK }},SYNC_TO_MANDATORY_CHECKPOINT=1,ZEBRA_CACHE_DIR=/home/zebra/.cache/zebra"
test_variables: "NETWORK=${{ inputs.network || vars.ZCASH_NETWORK }},NEXTEST_PROFILE=sync-to-mandatory-checkpoint,ZEBRA_TEST_SYNC_TO_CHECKPOINT=1,ZEBRA_CACHE_DIR=/home/zebra/.cache/zebra"
network: ${{ inputs.network || vars.ZCASH_NETWORK }}
# This test commonly less than 3 hours by October 2024, but now it takes longer
is_long_test: true
Expand All @@ -106,7 +106,7 @@ jobs:
app_name: zebrad
test_id: sync-past-mandatory-checkpoint
test_description: Test full validation sync from a cached state
test_variables: "NETWORK=${{ inputs.network || vars.ZCASH_NETWORK }},SYNC_PAST_MANDATORY_CHECKPOINT=1,ZEBRA_CACHE_DIR=/home/zebra/.cache/zebra"
test_variables: "NETWORK=${{ inputs.network || vars.ZCASH_NETWORK }},NEXTEST_PROFILE=sync-past-mandatory-checkpoint-${{ (inputs.network || vars.ZCASH_NETWORK) == 'Mainnet' && 'mainnet' || 'testnet' }},ZEBRA_TEST_SYNC_PAST_CHECKPOINT=1,ZEBRA_CACHE_DIR=/home/zebra/.cache/zebra"
needs_zebra_state: true
saves_to_disk: false
disk_suffix: checkpoint
Expand Down Expand Up @@ -138,7 +138,7 @@ jobs:
test_id: sync-full-mainnet
test_description: Test a full sync up to the tip
# TODO: update the test to use {{ input.network }} instead?
test_variables: NETWORK=Mainnet,SYNC_FULL_MAINNET_TIMEOUT_MINUTES=0,ZEBRA_CACHE_DIR=/home/zebra/.cache/zebra
test_variables: NETWORK=Mainnet,NEXTEST_PROFILE=sync-full-mainnet,SYNC_FULL_MAINNET_TIMEOUT_MINUTES=0,ZEBRA_CACHE_DIR=/home/zebra/.cache/zebra
# This test runs for longer than 6 hours, so it needs multiple jobs
is_long_test: true
needs_zebra_state: false
Expand All @@ -165,7 +165,7 @@ jobs:
app_name: zebrad
test_id: sync-update-mainnet
test_description: Test syncing to tip with a Zebra tip state
test_variables: "NETWORK=${{ inputs.network || vars.ZCASH_NETWORK }},SYNC_UPDATE_MAINNET=1,ZEBRA_CACHE_DIR=/home/zebra/.cache/zebra"
test_variables: "NETWORK=${{ inputs.network || vars.ZCASH_NETWORK }},NEXTEST_PROFILE=sync-update-mainnet,ZEBRA_CACHE_DIR=/home/zebra/.cache/zebra"
needs_zebra_state: true
# update the disk on every PR, to increase CI speed
saves_to_disk: true
Expand Down Expand Up @@ -196,7 +196,7 @@ jobs:
test_id: generate-checkpoints-mainnet
test_description: Generate Zebra checkpoints on mainnet
# TODO: update the test to use {{ input.network }} instead?
test_variables: NETWORK=Mainnet,GENERATE_CHECKPOINTS_MAINNET=1,ZEBRA_CACHE_DIR=/home/zebra/.cache/zebra
test_variables: NETWORK=Mainnet,NEXTEST_PROFILE=generate-checkpoints-mainnet,ZEBRA_CACHE_DIR=/home/zebra/.cache/zebra
needs_zebra_state: true
# sync-update-mainnet updates the disk on every PR, so we don't need to do it here
saves_to_disk: false
Expand Down Expand Up @@ -230,7 +230,7 @@ jobs:
app_name: zebrad
test_id: sync-full-testnet
test_description: Test a full sync up to the tip on testnet
test_variables: NETWORK=Testnet,SYNC_FULL_TESTNET_TIMEOUT_MINUTES=1,ZEBRA_CACHE_DIR=/home/zebra/.cache/zebra
test_variables: NETWORK=Testnet,NEXTEST_PROFILE=sync-full-testnet,SYNC_FULL_TESTNET_TIMEOUT_MINUTES=1,ZEBRA_CACHE_DIR=/home/zebra/.cache/zebra
network: Testnet
# A full testnet sync could take 2-10 hours in April 2023.
# The time varies a lot due to the small number of nodes.
Expand Down Expand Up @@ -261,7 +261,7 @@ jobs:
app_name: zebrad
test_id: generate-checkpoints-testnet
test_description: Generate Zebra checkpoints on testnet
test_variables: NETWORK=Testnet,GENERATE_CHECKPOINTS_TESTNET=1,ZEBRA_CACHE_DIR=/home/zebra/.cache/zebra
test_variables: NETWORK=Testnet,NEXTEST_PROFILE=generate-checkpoints-testnet,ZEBRA_CACHE_DIR=/home/zebra/.cache/zebra
network: Testnet
needs_zebra_state: true
# update the disk on every PR, to increase CI speed
Expand Down Expand Up @@ -295,7 +295,7 @@ jobs:
app_name: lightwalletd
test_id: lwd-sync-full
test_description: Test lightwalletd full sync
test_variables: "NETWORK=${{ inputs.network || vars.ZCASH_NETWORK }},LWD_SYNC_FULL=1,ZEBRA_TEST_LIGHTWALLETD=1,ZEBRA_CACHE_DIR=/home/zebra/.cache/zebra,LWD_CACHE_DIR=/home/zebra/.cache/lwd"
test_variables: "NETWORK=${{ inputs.network || vars.ZCASH_NETWORK }},NEXTEST_PROFILE=lwd-sync-full,ZEBRA_TEST_LIGHTWALLETD=1,ZEBRA_CACHE_DIR=/home/zebra/.cache/zebra,LWD_CACHE_DIR=/home/zebra/.cache/lwd"
# This test runs for longer than 6 hours, so it needs multiple jobs
is_long_test: true
needs_zebra_state: true
Expand All @@ -322,7 +322,7 @@ jobs:
app_name: lightwalletd
test_id: lwd-sync-update
test_description: Test lightwalletd update sync with both states
test_variables: "NETWORK=${{ inputs.network || vars.ZCASH_NETWORK }},LWD_SYNC_UPDATE=1,ZEBRA_TEST_LIGHTWALLETD=1,ZEBRA_CACHE_DIR=/home/zebra/.cache/zebra,LWD_CACHE_DIR=/home/zebra/.cache/lwd"
test_variables: "NETWORK=${{ inputs.network || vars.ZCASH_NETWORK }},NEXTEST_PROFILE=lwd-sync-update,ZEBRA_TEST_LIGHTWALLETD=1,ZEBRA_CACHE_DIR=/home/zebra/.cache/zebra,LWD_CACHE_DIR=/home/zebra/.cache/lwd"
needs_zebra_state: true
needs_lwd_state: true
saves_to_disk: true
Expand Down Expand Up @@ -350,7 +350,7 @@ jobs:
app_name: lightwalletd
test_id: lwd-rpc-test
test_description: Test lightwalletd RPC with a Zebra tip state
test_variables: "NETWORK=${{ inputs.network || vars.ZCASH_NETWORK }},LWD_RPC_TEST=1,ZEBRA_TEST_LIGHTWALLETD=1,ZEBRA_CACHE_DIR=/home/zebra/.cache/zebra"
test_variables: "NETWORK=${{ inputs.network || vars.ZCASH_NETWORK }},NEXTEST_PROFILE=lwd-rpc-test,ZEBRA_TEST_LIGHTWALLETD=1,ZEBRA_CACHE_DIR=/home/zebra/.cache/zebra"
needs_zebra_state: true
saves_to_disk: false
secrets: inherit
Expand All @@ -372,7 +372,7 @@ jobs:
app_name: lightwalletd
test_id: lwd-rpc-send-tx
test_description: Test sending transactions via lightwalletd
test_variables: "NETWORK=${{ inputs.network || vars.ZCASH_NETWORK }},LWD_RPC_SEND_TX=1,ZEBRA_TEST_LIGHTWALLETD=1,ZEBRA_CACHE_DIR=/home/zebra/.cache/zebra,LWD_CACHE_DIR=/home/zebra/.cache/lwd"
test_variables: "NETWORK=${{ inputs.network || vars.ZCASH_NETWORK }},NEXTEST_PROFILE=lwd-rpc-send-tx,ZEBRA_TEST_LIGHTWALLETD=1,ZEBRA_CACHE_DIR=/home/zebra/.cache/zebra,LWD_CACHE_DIR=/home/zebra/.cache/lwd"
needs_zebra_state: true
needs_lwd_state: true
saves_to_disk: false
Expand All @@ -395,7 +395,7 @@ jobs:
app_name: lightwalletd
test_id: lwd-grpc-wallet
test_description: Test gRPC calls via lightwalletd
test_variables: "NETWORK=${{ inputs.network || vars.ZCASH_NETWORK }},LWD_GRPC_WALLET=1,ZEBRA_TEST_LIGHTWALLETD=1,ZEBRA_CACHE_DIR=/home/zebra/.cache/zebra,LWD_CACHE_DIR=/home/zebra/.cache/lwd"
test_variables: "NETWORK=${{ inputs.network || vars.ZCASH_NETWORK }},NEXTEST_PROFILE=lwd-grpc-wallet,ZEBRA_TEST_LIGHTWALLETD=1,ZEBRA_CACHE_DIR=/home/zebra/.cache/zebra,LWD_CACHE_DIR=/home/zebra/.cache/lwd"
needs_zebra_state: true
needs_lwd_state: true
saves_to_disk: false
Expand All @@ -422,7 +422,7 @@ jobs:
app_name: zebrad
test_id: rpc-get-block-template
test_description: Test getblocktemplate RPC method via Zebra's rpc server
test_variables: "NETWORK=${{ inputs.network || vars.ZCASH_NETWORK }},RPC_GET_BLOCK_TEMPLATE=1,ZEBRA_CACHE_DIR=/home/zebra/.cache/zebra"
test_variables: "NETWORK=${{ inputs.network || vars.ZCASH_NETWORK }},NEXTEST_PROFILE=rpc-get-block-template,ZEBRA_CACHE_DIR=/home/zebra/.cache/zebra"
needs_zebra_state: true
needs_lwd_state: false
saves_to_disk: false
Expand All @@ -445,7 +445,7 @@ jobs:
app_name: zebrad
test_id: rpc-submit-block
test_description: Test submitting blocks via Zebra's rpc server
test_variables: "NETWORK=${{ inputs.network || vars.ZCASH_NETWORK }},RPC_SUBMIT_BLOCK=1,ZEBRA_CACHE_DIR=/home/zebra/.cache/zebra"
test_variables: "NETWORK=${{ inputs.network || vars.ZCASH_NETWORK }},NEXTEST_PROFILE=rpc-submit-block,ZEBRA_CACHE_DIR=/home/zebra/.cache/zebra"
needs_zebra_state: true
needs_lwd_state: false
saves_to_disk: false
Expand Down
16 changes: 10 additions & 6 deletions .github/workflows/sub-ci-unit-tests-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@
run: |
docker pull ${{ vars.GAR_BASE }}/${{ vars.CI_IMAGE_NAME }}@${{ inputs.image_digest }}
docker run --tty \
-e RUN_ALL_TESTS=1 \
-e FEATURES="journald prometheus filter-reload" \
-e NEXTEST_PROFILE=all-tests \
-e NETWORK="${{ inputs.network || vars.ZCASH_NETWORK }}" \
-e RUST_LOG=${{ env.RUST_LOG }} \
-e RUST_BACKTRACE=${{ env.RUST_BACKTRACE }} \
Expand Down Expand Up @@ -89,7 +88,8 @@
run: |
docker pull ${{ vars.GAR_BASE }}/${{ vars.CI_IMAGE_NAME }}@${{ inputs.image_digest }}
docker run --tty \
-e STATE_FAKE_ACTIVATION_HEIGHTS=1 \
-e NEXTEST_PROFILE=state-fake-activation-heights \
-e TEST_FAKE_ACTIVATION_HEIGHTS=1 \
-e NETWORK="${{ inputs.network || vars.ZCASH_NETWORK }}" \
-e RUST_LOG=${{ env.RUST_LOG }} \
-e RUST_BACKTRACE=${{ env.RUST_BACKTRACE }} \
Expand Down Expand Up @@ -117,7 +117,8 @@
run: |
docker pull ${{ vars.GAR_BASE }}/${{ vars.CI_IMAGE_NAME }}@${{ inputs.image_digest }}
docker run --tty \
-e SYNC_LARGE_CHECKPOINTS_EMPTY=1 \
-e NEXTEST_PROFILE=sync-large-checkpoints-empty \
-e ZEBRA_TEST_LARGE_CHECKPOINTS=1 \
-e NETWORK="${{ inputs.network || vars.ZCASH_NETWORK }}" \
-e RUST_LOG=${{ env.RUST_LOG }} \
-e RUST_BACKTRACE=${{ env.RUST_BACKTRACE }} \
Expand Down Expand Up @@ -145,11 +146,14 @@
run: |
docker pull ${{ vars.GAR_BASE }}/${{ vars.CI_IMAGE_NAME }}@${{ inputs.image_digest }}
docker run --tty \
-e NEXTEST_PROFILE=lwd-integration \
-e ZEBRA_TEST_LIGHTWALLETD=1 \
-e LIGHTWALLETD_INTEGRATION=1 \
-e NETWORK="${{ inputs.network || vars.ZCASH_NETWORK }}" \
-e RUST_LOG=${{ env.RUST_LOG }} \
-e RUST_BACKTRACE=${{ env.RUST_BACKTRACE }} \
-e RUST_LIB_BACKTRACE=${{ env.RUST_LIB_BACKTRACE }} \
-e COLORBT_SHOW_HIDDEN=${{ env.COLORBT_SHOW_HIDDEN }} \

Check warning

Code scanning / zizmor

code injection via template expansion Warning

code injection via template expansion
-e CARGO_INCREMENTAL=${{ env.CARGO_INCREMENTAL }} \

Check warning

Code scanning / zizmor

code injection via template expansion Warning

code injection via template expansion
${{ vars.GAR_BASE }}/${{ vars.CI_IMAGE_NAME }}@${{ inputs.image_digest }}

# Run a matrix of configuration tests against the Docker image
Expand Down Expand Up @@ -197,7 +201,7 @@
run: |
docker pull ${{ vars.GAR_BASE }}/${{ vars.CI_IMAGE_NAME }}@${{ inputs.image_digest }}
docker run --tty \
-e CHECK_NO_GIT_DEPENDENCIES=1 \
-e NEXTEST_PROFILE=check-no-git-dependencies \
-e NETWORK="${{ inputs.network || vars.ZCASH_NETWORK }}" \
-e RUST_LOG=${{ env.RUST_LOG }} \
-e RUST_BACKTRACE=${{ env.RUST_BACKTRACE }} \
Expand Down
24 changes: 8 additions & 16 deletions .github/workflows/sub-deploy-integration-tests-gcp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -357,27 +357,19 @@ jobs:
--ssh-flag="-o ConnectionAttempts=20" \
--ssh-flag="-o ConnectTimeout=5" \
--command="
echo 'Streaming logs and waiting for test success message...';
sudo docker logs --tail all --follow ${CONTAINER_ID} \
| tee --output-error=exit-nopipe /dev/stderr \
| grep --max-count=1 --extended-regexp --color=always \
'test result: .*ok.* [1-9][0-9]* passed.*finished in';
LOGS_EXIT_STATUS=\$?;
echo 'Streaming logs from container ${CONTAINER_ID}...';
sudo docker logs --tail all --follow ${CONTAINER_ID} &

echo 'Waiting for container ${CONTAINER_ID} to exit...';
EXIT_STATUS=\$(sudo docker wait ${CONTAINER_ID} || echo 'Error retrieving exit status');
EXIT_STATUS=\$(sudo docker wait ${CONTAINER_ID});
echo 'Container exit status: '\$EXIT_STATUS;

if [ \$LOGS_EXIT_STATUS -ne 0 ]; then
echo 'Test failed: Success log pattern not found (grep exit status: '\$LOGS_EXIT_STATUS').';
if [ \"\$EXIT_STATUS\" -ne 0 ]; then
echo 'Test failed with exit code: '\$EXIT_STATUS;
exit 1;
else
if [ \"\$EXIT_STATUS\" -eq 1 ]; then
echo 'Test failed: Success log pattern found BUT container exited with status 1.';
exit 1;
else
echo 'Test successful: Success log pattern found. Container exit status '\$EXIT_STATUS' ignored (as it is not 1).';
exit 0;
fi
echo 'Test successful with exit code: '\$EXIT_STATUS;
exit 0;
fi
"

Expand Down
Loading
Loading