Repository navigation
test: move the SDK's OpenTofu recovery tests to nemoclaw-e2e - #13002
Merged
Merged
Conversation
The five Helm recovery tests and the managed gateway runtime test ran the bundled OpenTofu from nemoclaw-sdk and built their starting states with SDK internals. They now live in nemoclaw-e2e and use a test-scenarios feature of the SDK, off by default and enabled only by nemoclaw-e2e's dev-dependency, to build those states; recovery runs through the public destroy and plan_destroy.
Contributor
This was referenced Oct 11, 2026
cv
added a commit
that referenced
this pull request
Oct 12, 2026
Part of #12881. ## Failure #13002 moved the SDK's Helm recovery tests to nemoclaw-e2e, and #12997 merged after it with the earlier layout. On v1: - `docs/contributing/testing.md`'s layer table and System section say the `lifecycle` profile selects ignored Helm recovery tests in the `nemoclaw-sdk` library. - `docs/contributing/integration-tests.md` says the same and gives `cargo test -p nemoclaw-sdk --lib -- --ignored helm_recovery`, which no longer runs any test. ## Decision - **`testing.md`:** - The System row and section list `helm_recovery` with the other `nemoclaw-e2e` modules that the `lifecycle` profile selects. - The Live section names nemoclaw-e2e's `managed_gateway` test and links its inputs in `live-tests.md`, which #13002 already updated. - **`integration-tests.md`:** - The system-test introduction no longer names the SDK. - The module table gains `helm_recovery`. - A new "Helm Release Recovery" subsection explains why each test starts from an imported release. It says the SDK's test-only `test-scenarios` feature builds that state and that nemoclaw-e2e enables it, so no flag is needed. It gives the run command. I checked the rest of both files for other changes from #13002 and found none. Two facts stay true: - The `live-docker` profile still selects one `nemoclaw-sdk` test, `kubernetes_auth::the_issuer_image_serves_both_documents_over_https`. - Crates still include `crates/test-support` as private modules. ## Validation Checked against v1 (`3b248a7b76`): - `.config/nextest.toml`: the `lifecycle` filter selects `helm_recovery::` and the `live-docker` filter selects `managed_gateway::` in `nemoclaw-e2e`'s `integration` binary. - `crates/nemoclaw-e2e/tests/main.rs` declares both modules `#[cfg(unix)]`. - `crates/nemoclaw-e2e/Cargo.toml` enables `test-scenarios` on its `nemoclaw-sdk` dev-dependency. - The documented command, `NEMOCLAW_TEST_BUNDLE=… cargo test -p nemoclaw-e2e --test integration -- --ignored helm_recovery::`, ran 5 tests, all passing, on linux_arm64. - `cargo test -p nemoclaw-e2e --test integration -- --list --ignored --exact managed_gateway::managed_gateway_plan_apply_noop_destroy_and_recovery_use_real_opentofu` lists the test that `live-tests.md` runs. - `cargo run -p nemoclaw-build -- fern check`: 0 errors. `nemoclaw-build`'s `docs::` tests pass.
gaveezy
added a commit
that referenced
this pull request
Oct 12, 2026
testing.md and integration-tests.md said the lifecycle profile selects Helm recovery tests in the nemoclaw-sdk library. #13002 moved those to nemoclaw-e2e's helm_recovery module, and the only SDK test the profile now selects is plan_and_apply_refuse_cluster_port_changes_with_separate_state_files. That test builds its saved OpenTofu states from SDK internals, so it stays in the SDK instead of moving behind test-scenarios hooks. Name that test, its purpose and its run command, and list helm_recovery with the other nemoclaw-e2e system-test modules. Validation: .config/nextest.toml selects that test by name and the e2e helm_recovery module by prefix. The test passes with a bundle built from this branch. nemoclaw-build docs reports no link errors. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Hai Nguyen <[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.
Part of #12881.
Failure
Six
nemoclaw-sdktests ran the bundled OpenTofu:deployment::runtime::helm_recovery::tests(lifecycle step).managed_gateway_plan_apply_noop_destroy_and_recovery_use_real_opentofu(Live / Docker).They built their starting states with SDK internals:
Record,Store,initialize,tofu,saved_plan,checkpoint_helm_binding, andruntime_stage. The public API can't reach those states offline. Installing the gateway release throughapplywould pull the pinned chart, because Helm provider 3.3.0 pulls it during every plan. A runtime apply that stops after OpenTofu saves its identities has no fault a test can inject.Decision
Test-only setup in the SDK. A
test-scenariosfeature compiles three hiddenDeploymentmethods incrates/nemoclaw-sdk/src/deployment/runtime/scenarios.rs:scenario_runtime_stageplans or applies only the runtime stage.scenario_interrupt_runtime_applysaves the configuration as a runtime apply that started and didn't finish.scenario_runtime_tofuruns OpenTofu commands in that stage with destroy's environment.Their doc comment says they exist only for these tests. The feature is off by default, no other feature enables it, and only nemoclaw-e2e's dev-dependency turns it on.
cargo tree -e features -i nemoclaw-sdkshows it for neithernemoclaw-clinor any normal workspace build.The Helm tests move to
crates/nemoclaw-e2e/tests/helm_recovery.rs. Setup imports the fixture release with the real Helm provider. The tests then call only the publicdestroy,plan_destroy, andexport, and use the publicProgressstream for fault timing and cancellation. They read bindings from the stage'sterraform.tfstate.The interrupted-destroy test now stops at the real boundary. It no longer runs the SDK's destroy steps by hand. Fault injection starts at
Progress::Destroying, after the saved plan, and the test cancels when the native apply completes. Destroy returnsCancelledbefore its recovery handler runs: the state the old test reproduced by hand.The managed gateway test moves to
crates/nemoclaw-e2e/tests/managed_gateway.rswith the same name, so the live-docker runner'sGATEWAY_TESTSstill selects it. It applies only the runtime stage throughscenario_runtime_stage, as before. A fullapplywould also need sandboxes, so the hook needs fewer SDK internals than a rewrite.Filters and docs: the lifecycle and live-docker filters in
.config/nextest.tomlselect the moved tests, anddocs/contributing/live-tests.mdnames the new location.Dependencies: nemoclaw-e2e gains
base64,bollard, andurlas dev-dependencies; nemoclaw-sdk drops its unusedbollarddev-dependency.Changed assertions
Assertions not listed moved unchanged, with
Fixture::bindingsreading the stage's OpenTofu state instead ofStore::bindings.cancellation_after_successful_apply_retains_a_resumable_destroy_checkpointrecord.destroying() && !record.destroyed()exportrefuses withcannot export while destroy is unfinished.planand.backupfiles) after cancellation, and none after the retryan_interrupted_destroy_recovers_on_retry_without_mutating_during_previewnemoclaw-runtimefiles::tests::atomic_writes_are_private_to_their_owner. It checks thesave_jsonwriter that saves the checkpoint and fails whenatomic_writeuses 0644plan_destroymain.tf.jsonis byte-identical afterplan_destroy. This covers the state and the checkpoint without naming itmanaged_gateway_plan_apply_noop_destroy_and_recovery_use_real_opentofuplan_destroy, the record is pendingexportrefuses withapply is unfinisheddestroy, the record is not pendingexportrefuses withcannot export a destroyed deployment. It checks for unfinished applies first, so the deployment isn't pendingscenario_runtime_stagereturns no changes, and every binding is unchangedValidation
On linux_arm64, against a bundle built from v1:
cargo nextest run -p nemoclaw-e2e --test integration --run-ignored all -E 'test(/^helm_recovery::/)': 5 passed in 50 s, the slowest in 16 s.recover_helm_bindingfails the two after-plan tests and the interrupted-destroy test.files::tests::atomic_writes_are_private_to_their_ownerfails with mode 0644 and passes with 0600.cargo nextest list --profile lifecycle --run-ignored alland--profile live-dockerlist the moved tests, and no SDK test runs OpenTofu.cargo nextest run -p nemoclaw-buildwith the budget, profile, and filter tests: 29 passed.cargo fmt --all --checkandcargo clippy --workspace --all-targets -- -D warnings: clean.cargo ci live-docker's images and documents. CI's Live / Docker job runs it.Remaining for #12881
crates/nemoclaw-e2e/tests/model_live.rsstill decodesintent.jsonand the SDK's internalinference_servicetarget. It runs only by hand on a GPU host, and a rewrite needs such a run to validate.nemoclaw-provider'sruntime_contractandruntime_imagetests decode SDK-compiled targetspecvalues through the publicnemoclaw_sdk::managed::Spec, the type the provider consumes.With those open, this PR does not close the issue.