feat(ci): implement nextest and optimize Docker test builds#9435
Merged
gustavovalverde merged 46 commits intomainfrom Aug 11, 2025
Merged
feat(ci): implement nextest and optimize Docker test builds#9435gustavovalverde merged 46 commits intomainfrom
gustavovalverde merged 46 commits intomainfrom
Conversation
5 tasks
CARGO_HOME
CARGO_HOMECARGO_HOME
- Add feature gates to lightwalletd test infrastructure to prevent compilation errors when lightwalletd-grpc-tests is disabled - Add feature gate to indexer test to prevent compilation errors when indexer is disabled - Move lightwalletd-related imports and constants behind feature gates - Wrap gRPC code generation in feature-conditional module - Fix GitHub Actions workflow to pass features as single string - Restore missing lightwalletd_failure_messages method with feature gate - Add missing DATABASE_FORMAT_UPGRADE_IS_LONG import This ensures --no-default-features builds work correctly while maintaining full functionality when features are enabled.
- Remove unused DATABASE_FORMAT_UPGRADE_IS_LONG import - Update references to use common::cached_state::DATABASE_FORMAT_UPGRADE_IS_LONG - Fix unused import linting warning
This commit addresses several issues related to running tests within Docker and CI environments. The initial problem was a permissions error where `nextest` could not write to its store directory. This was resolved by adjusting `CARGO_HOME` and `CARGO_TARGET_DIR` to be relative to the user's home directory within the Docker image. A subsequent issue was discovered where test filters in `nextest.toml` were platform-specific, causing the entire test suite to run on `x86_64` CI runners, leading to failures. The configuration has been refactored to be platform-agnostic, ensuring filters are applied correctly on all architectures. Additionally, the `Dockerfile` has been updated to use a multi-stage build for fetching the `lightwalletd` binary, resolving multi-platform build failures. The test entrypoint script was also improved to correctly handle ignored tests and provide cleaner logs. Finally, the GCP integration test workflow has been simplified to rely on the container's exit code for determining test success, removing fragile log parsing.
conradoplg
reviewed
Aug 6, 2025
Collaborator
conradoplg
left a comment
There was a problem hiding this comment.
Looks good, added some minor suggestions.
I'll wait before approving in order to check if we want to do the next release before merging this.
Co-authored-by: Conrado Gouvea <conrado@zfnd.org>
Collaborator
|
@Mergifyio requeue |
Contributor
✅ The queue state of this pull request has been cleaned. It can be re-embarked automatically |
Member
Author
|
I'm admin merging to clean-up the merge message |
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Zebra's CI/CD pipeline had several inefficiencies that were impacting build and test execution times:
Fragmented Test Execution: Individual environment variables were used to control different test suites (
RUN_ALL_TESTS,STATE_FAKE_ACTIVATION_HEIGHTS,SYNC_LARGE_CHECKPOINTS_EMPTY, etc.), sometimes in combination with feature gates, leading to inconsistent test configuration and complex workflow management.Feature Gate Inefficiencies: Different feature combinations between build-time and runtime were causing Rust to rebuild artifacts unnecessarily, slowing down the build process.
Complex Entrypoint Logic: The
entrypoint.shscript contained complex conditional logic for different test scenarios, making it harder to maintain and understand.Verbose CI Workflows: Each test type required separate environment variables or feature gates configurations across multiple workflow files.
Fixes: #9331
Solution
This PR implements a modernization of Zebra's test execution and Docker build system:
1. Nextest Integration with Centralized Configuration
.config/nextest.tomlwith 17 specialized test profiles covering all test scenarios:all-tests: Runs all tests except dependency checkssync-full-mainnet,lwd-grpc-wallet,rpc-submit-block, etc.NEXTEST_PROFILEvariable2. Docker Build Optimization
default-release-binaries proptest-impl lightwalletd-grpc-tests zebra-checkpoints) for testing to prevent unnecessary rebuilds.dockerignoreto include.configdirectory for nextest configuration3. CI/CD Workflow Modernization
sub-ci-unit-tests-docker.yml,sub-ci-integration-tests-gcp.yml) with 15+ test jobs converted to use nextest profilesNEXTEST_PROFILEusage4. Entrypoint Simplification (Phase 1)
entrypoint.shcomplexity: Moved test execution logic to nextest profilesNEXTEST_PROFILEis set, the entrypoint usescargo nextest runwith appropriate flags5. Test Execution Improvements
Performance Impact
Based on CI run comparisons:
Migration Path
entrypoint.shfunctionality preservedTesting