Repository navigation
test(sdk): check export and state parsing without OpenTofu - #12996
Merged
Merged
Conversation
Replace runtime_export_declares_the_native_helm_provider_inputs with a unit test of the export's provider-only configuration, and remove native_state_json_preserves_module_and_instance_identity_without_refresh, whose checks unit and system tests keep.
Contributor
cv
added a commit
that referenced
this pull request
Oct 11, 2026
Part of #12876: its last criterion, "the testing guide describes the layers and budgets". ## Failure `docs/contributing/testing.md` listed the step budgets but didn't describe the unit, contract, system, and live layers, or which crates and binaries belong to each. `docs/contributing/integration-tests.md` had grown one fixture at a time, and some of its text no longer matched the code: - it named tests that no longer exist: `harness_codex`, the OpenClaw interface lifecycle, and Hermes interface modes; - it described ten Fabric harness tests, but `fabric_deployment` has two (OpenClaw and Pi); - its Docker tests are part of the `live-docker` suite, not the fixture layers. ## Decision - `testing.md` now has sections for the layers (what each checks, its binaries, and what belongs there), how to run each layer with the one `NEMOCLAW_TEST_BUNDLE` input, budgets and per-test limits (where each is enforced and how to change one), timing reports, and how CI runs each layer: jobs, partitions, archives, the Windows relay, and live suites on pull requests. The dependency, image, schema, CLI, cache, and coverage sections are unchanged. - `integration-tests.md` now covers the contract and system layers: the shared harness, each provider's contract binary by module, and the system modules, built from the current test names. - The four sections that need a real Docker engine move to `live-tests.md` under a new Docker Live Suite section, next to the Docker gateway tests already there. Their two inbound links are updated. Other anchors are kept. - After merging `v1` (#12995, #12996, #12998, #12999, #13000), the guide describes what moved: the system layer's `nemoclaw-sdk` tests are now only the Helm recovery tests, the OpenShell and Fabric backends' fake-gateway tests (formerly `nemoclaw-e2e/tests/openshell.rs`) are provider unit tests, the Kind suite runs `nemoclaw-e2e`'s `kubernetes_live` and `kubernetes_chart`, and `Build live images` builds the live images once and decides whether the live suites run. - The `kubernetes_lifecycle` contract tests' `#[ignore]` reason named `NEMOCLAW_TEST_TOFU` and `NEMOCLAW_TEST_PROVIDER`; it now names `NEMOCLAW_TEST_BUNDLE`, which the tests read. - Every statement was checked against `run_ci.rs`, `ci/timing.rs`, `.config/`, the workflows, the `v1` ruleset, and the tests. ### Budget enforcement audit Every budget in `.config/test-budgets.yaml` is enforced on the Linux runners. In run [38136353545](https://github.com/NVIDIA/NemoClaw/actions/runs/38136353545) (linux_amd64), the `test`, `Lifecycle / 1`, `Live / Docker`, `Live / Kind`, and `Lifecycle timing` logs each print their budget and "Within budget." with no "reported only" note. The three binary budgets appear in the `Lifecycle timing` table. No budget is recorded but unenforced. These gaps remain: - When `changes live` skips the live suites on a pull request, their budgets aren't checked for that PR. - The `test` wall budget covers the nextest run, not the doctests. - `.config/test-budgets.yaml` isn't checked in the other direction. A step key that names no step, or a binary budget whose binary has no lifecycle tests (renamed, or every partition missing its report), passes silently. `Lifecycle timing` names a partition with no report but doesn't fail on it. ## Validation - `cargo run --locked -p nemoclaw-build -- fern check`: 0 errors. Its one warning is also on `v1`. - `git diff --check` - `cargo test -p nemoclaw-build --test integration ci::`: 15 passed. - I ran the documented commands against a `linux_arm64` bundle: - the nextest `lifecycle` command filtered to `openshell-provider::contract` (44 passed); - `nemoclaw-sdk --lib -- --ignored helm_recovery` (5 passed); - `nemoclaw-e2e sandbox_readiness::` (1 passed); - `nemoclaw-provider --test contract service_readiness::` (2 passed); - `lifecycle-timing` on an empty directory. - After the merge, against a rebuilt `linux_arm64` bundle: the same commands again, plus `kubernetes_lifecycle::` (2 passed) and the providers' `fake_gateway_tests` (3 and 9 passed); `cargo fmt --all --check` and `cargo clippy --workspace --all-targets -- -D warnings`. - No behavior changes: the only code change is an `#[ignore]` reason string.
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.
Part of #12881.
Failure
Two
nemoclaw-sdkunit tests ran OpenTofu fromNEMOCLAW_TEST_BUNDLEin the lifecycle step:deployment::export::tests::runtime_export_declares_the_native_helm_provider_inputsbuilt a Kubernetes runtime stage, fabricated its state, and ran export against an unreachable cluster to check that OpenTofu did not report an undeclared input variable.state::tests::native_state_json_preserves_module_and_instance_identity_without_refreshapplied OpenTofu's builtinterraform_dataresources to check how the SDK readstofu show -json.Unit tests must not run OpenTofu; the rule each checked is pure SDK logic.
Decision
observation_configuration. A unit test,export_configuration_declares_every_variable_its_providers_read, compiles the Kubernetes runtime graph and checks that the configuration keeps the graph'sterraformandproviderblocks, has no resources or data sources, and declares everyvar.its providers read, includingnemoclaw_kubeconfig. Removing the variable copy fails it:export reads undeclared variable nemoclaw_kubeconfig..config/nextest.tomldrops both names from the lifecycle filter.deployment::export::tests::export_configuration_declares_every_variable_its_providers_read(unit)export_observations::export_refreshes_through_opentofu_without_applying_or_losing_bindings(nemoclaw-e2e): the provider read fails, andterraform.tfstateandintent.jsonkeep their bytesplanafter the provider read failsfor_eachinstance addresses stay distinctstate::tests::documented_state_json_preserves_full_instance_addresses(unit, OpenTofu's documentedshow -jsonformat)export_observations::export_refreshes_through_opentofu_without_applying_or_losing_bindings: a successful export reads bindings and leavesterraform.tfstateunchangedstate::tests::malformed_duplicate_and_unsupported_state_is_not_emptyfor state that parses wrongly; for a file OpenTofu cannot read,showfails andbindingsreturns that failureThe Kubernetes-specific part of the export test, the declared variable, is now checked in the unit test only; the e2e keeper exercises the same export code on the root stage.
Validation
On linux_arm64:
cargo nextest run -p nemoclaw-sdk --lib: 190 passed.cargo nextest list --profile lifecycle -p nemoclaw-sdk --run-ignored allselects only the fivehelm_recoverytests, which a later change moves.export_observations::export_refreshes_through_opentofu_without_applying_or_losing_bindingsagainst a bundle built from this branch: passed.cargo fmt --all --checkandcargo clippy --workspace --all-targets -- -D warnings: clean.