Repository navigation
test!: consolidate integration tests into eight binaries - #346
Merged
Merged
Conversation
The root crate built 81 integration test binaries, each relinking the whole crate. They are now eight area binaries (core, repositories, read_models, graphql, gateway, transports, services, observability); each former target is a module, so `--test <name>` becomes `--test <group> <name>::`. Same 2,277 tests, name for name. Relinking after touching src/lib.rs drops from 57.7 s to about 13 s. Process-global state was audited: the metrics recorder shares a binary only with otel_export, which records none; no test sets env vars or a global subscriber. Every CI and Makefile `--test` invocation is rewritten and selects the same tests as before (listed per job in the PR). The coverage job gets rust-cache. graphql_query_protocol is gated on gateway-graphql-native, the feature its load module always needed. BREAKING CHANGE: integration test target names changed; use `cargo test --test <group> <old_name>::`. Implements [[tasks/v5-review-27]]
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
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.
Task 27 stage C: consolidate integration tests into about eight binaries, and give uncached CI jobs
rust-cache.What changed
The root crate's 81 integration-test targets are now 8 binaries. Each former target is a module of its group, so
cargo test --test <name>becomescargo test --test <group> <name>::.core(14)repositories(15)read_models(10)graphql(16)graphql_*target, including the three OIDC providersgateway(8)transports(9)services(7)observability(2)distributedgoes from 82 to 9 (8 groups plus unit tests); the whole workspace goes from 132 to 59.touch src/lib.rs, from 57.7 s to about 13 s.metrics_expositionasserts exact counts. It shares its binary only withotel_export, which records no metrics.otel_exportuses a thread-local subscriber (set_default).ctororserial_test. Servers bind port 0, and broker names and schemas are unique per test.--testinvocation in the workflows, the Makefiles and the scripts is rewritten. Each job was listed with--listbefore and after, and selects exactly the same tests. For example, the gateway GraphQL job goes from 7--testtargets to--test gateway --test graphql --test repositorieswith module filters, 85 = 85 tests.rust.ymlcoverage job, the only Rust job without it.graphql_query_protocolis now gated ongateway-graphql-native+sqlite. Itsloadmodule never compiled without the native gateway.tests/gateway-portableandtests/gateway-native. They keep their own#![cfg], andgateway_supportis loaded with#[path]so it resolves in both builds.Breaking (test-only): integration test target names changed.
Verification (local)
cargo test -p distributed --all-features -- --list: 2,277 tests, the same asv5.make test-local(Postgres plus compose services): 2,858 passed, 0 failed.cargo test -p distributed --all-featureswith no services: all pass.cargo check --workspace --all-targets --all-features: passes.cargo check -p distributed --tests --no-default-features: passes, as does each of the 18 features alone.tests/gateway-portable,tests/gateway-native) pass their tests and clippy with-D warnings.Not done
docs/reviews/v5-pre-release/*still cite the old test paths. They are point-in-time review records.gateway_supportkeeps#![allow(dead_code)], because the fixture crates include it file by file.FailingSerialize, unusedarchive, and unused imports indistributed_read_modelandcausal_wait_path. Three more appear in GraphQL modules because those now compile under feature combinations nobody built before.