Repository navigation
test: simplify suites and link each crate into one test binary - #12613
Merged
Merged
Conversation
Two tests compared a hand-written list with the files on disk: the scripts guard failed on any Python or shell file it didn't list, and the onboarding guard failed when an example lacked a hand-written journey test. Both checked the repository's contents, not code. The scripts guard is removed; AGENTS.md still states the Rust rule. The onboarding test list is now generated by a build script from the examples directory, so a new example gets a journey test without any listing, and the guard is no longer needed. Examples with more than one sandbox return early, as the hand-written list excluded them. Validation: the 39 generated example tests pass (the 30 single-sandbox examples walk to review). Adding an example produces a new test, and removing it removes the test. clippy and fmt are clean.
One test required every example to start with a yaml-language-server comment naming the checked-in schema, then validated the example against that file. The comment is editor guidance, not behavior. cargo ci schema already fails when the checked-in schema differs from the generated one, and another test validates every example against the generated schema. Validation: the config_schema tests pass and clippy is clean.
Three tests walked configuration files: one parsed every top-level example, one validated every example against the schema, and one round-tripped the SDK's fixture configs. Seven of those fixtures were read by no other test and were outdated copies of same-named examples, each differing in about 40 lines, so the round-trip test mostly checked files that nothing used. The schema test now also parses and round-trips every example, including subdirectories, and checks that the workspace and digest survive. The top-level parse test, the fixture round-trip test, and the seven unused fixtures are removed. inference_connection keeps its own tests. The fixtures README no longer mentions JSON files that do not exist. Validation: the config, config_input and config_schema tests pass (35), and clippy is clean.
Seven ignored tests in the discovery, inference_discovery and gateway_readiness binaries need only the bundle's OpenTofu, the provider and local fixtures, which the lifecycle step already provides, but its filter left them out, so no workflow ran them. Run locally, six pass. The lifecycle profile now includes those three binaries. The seventh test also needed a Fabric fixture descriptor and a Python environment that CI does not provide. Its checks are covered elsewhere: the image unit-tests stage packages that fixture adapter and delivers its settings to Fabric's runner, and the SDK planner tests plan the same unknown adapter's settings. It is removed, and the fixture docs describe where that coverage now lives. Validation: the six tests pass through the lifecycle profile (the longest takes 35 s). The lifecycle profile now selects 96 tests instead of 90. clippy and the docs check pass.
Each of the SDK's 54 integration-test files built its own binary, and each linked the whole SDK and its dependencies: 55 binaries and 10.1 GB of debug output. After any SDK source change, relinking them took 19 s, while rebuilding the library took 2 s. The crate now sets autotests = false and declares one integration test, tests/main.rs, which includes every file as a module. Files stay where they are, so their include_str! paths are unchanged. Shared helpers are declared once in main.rs: clippy rejects one file loaded as several modules. A new support module loads examples and fixtures, replacing eight copies of identical input() helpers. Docs that ran a single test file now select it by module path. Validation: the same 448 tests pass, with the same 10 ignored. The SDK now builds 2 test binaries (0.56 GB), and relinking after an SDK change takes 7-8 s instead of 19 s. Each updated docs command selects the same tests as before. clippy is clean. Windows behavior is checked only in CI.
The e2e crate built 29 test binaries (6.1 GB of debug output), each linking the SDK, provider and runtime. It now builds one integration binary from tests/main.rs, with each file as a module. The Brev test stays a separate binary because its workflow copies that one executable to a VM. The lifecycle profile now selects tests by module path within the integration binary instead of by binary name. Maintained docs select tests by module path. Three of their commands already selected nothing: one named a test renamed in db923ca, and two hosted live tests sit in a nested live module. They now name the current tests. Dated validation records keep the commands they ran. Validation: the e2e tests pass (40, with 107 ignored). The lifecycle profile selects the same 96 tests as before and all pass. The Brev workflow's jq lookup still finds its executable. Every maintained docs command selects at least one test. The crate now builds 4 binaries (0.71 GB).
The authoring, provider, build, runtime and CLI crates still built one test binary per file, 33 in all, each linking its crate's dependencies. Each crate now declares one integration test, tests/main.rs, with every file as a module, as the SDK and e2e crates do. The provider's support module is declared once. The docs and image workflows, and the docs that ran a single file, now select tests by module path. Validation: cargo ci passes every step (1032 tests, then 96 lifecycle tests). The build tests pass with and without the sdk feature, and the runtime tests with and without execution. The workflow selections run the same tests: the image job's bake:: (7) and the docs job's docs:: (5). Across the workspace, test binaries fell from 133 (22.5 GB) to 26 (3.5 GB). A workspace rebuild after one SDK change takes 10-11 s instead of 38 s, and listing every test takes 0.85 s instead of 36 s.
Contributor
bowenzhu21
added a commit
to bowenzhu21/NemoClaw
that referenced
this pull request
Oct 5, 2026
v1 now links each crate's tests into one integration binary (NVIDIA#12613). This branch's test files are unchanged by the merge. Validation on dcbf45c with these changes, Linux ARM64 (Colima), bundle built from this tree: nextest ci profile 1032 passed, lifecycle profile 96 passed, doc tests, cargo fmt --check, and Clippy -D warnings pass. docker_provider_proxy 1/1, CPU runtime 2/2, ollama_cache 3/3, cache_provider 5/5, lifecycle test 5/5, run through the integration binary. Signed-off-by: Bowen Zhu <[email protected]>
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.
Summary
Simplifies the test suites, in seven commits. The biggest change links each crate's integration tests into one binary, so builds are much faster:
cargo nextest listcargo ci buildstepCommits
test: drop guard tests that list files by nameAGENTS.mdstill states the Rust rule).examples/, so a new example gets a test automatically and that guard isn't needed.test(sdk): stop checking each example's editor schema commentcargo ci schemaalready keeps the checked-in schema identical to the generated one.test(sdk): check the example corpus in one test and drop unused fixturestest(e2e): run the discovery and gateway readiness fixtures in CIdiscovery,inference_discoveryandgateway_readinessneed only the bundle, but no workflow ran them. The lifecycle profile now includes them: 96 tests instead of 90.unit-testsstage and the SDK planner tests cover its checks, so it's removed.test(sdk): link the integration tests into one binaryautotests = falseand addstests/main.rs, which includes each file as a module. Files stay in place, soinclude_str!paths are unchanged.supportmodule replaces eight copies of an identicalinput()helper.test(e2e): link the integration tests into one binarybrevstays a separate binary because its workflow copies that one executable to a VM.test: link each remaining crate's integration tests into one binary--test integration name::).Validation (Linux ARM64)
cargo ci: passes every step: 1032 tests, then 96 lifecycle tests.sdkfeature, and runtime tests with and withoutexecution.bake::runs 7 tests and the docs job'sdocs::runs 5, without the SDK feature where the job requires it;jqlookup still finds its executable.v1(a test renamed indb923cac65, and two hosted live tests in a nested module); they're fixed.For reviewers
cargo test -p CRATE --test integration FILE::instead of--test FILE.docs/validation/keep the commands they ran.