Repository navigation
test: apply, refresh, and tear down the Kubernetes resources in the nemoclaw contract tests - #12972
Merged
Merged
Conversation
…emoclaw contract tests The provider's contract binary checked nemoclaw_kubernetes_storage, nemoclaw_kubernetes_auth, and nemoclaw_kubernetes_gateway only through plan. kubernetes_lifecycle now applies, refreshes, and tears them down through pinned OpenTofu against the in-memory Kubernetes API the SDK tests use. The test writes and deletes the StatefulSet and release record Helm would. The fake moves to crates/test-support/kube_api.rs so both crates include it, and its Kubernetes client helper stays with the SDK tests. The fake now answers an absent object whose name ends in "s", such as the namespace "agents", as 404 instead of an empty list.
Contributor
|
v1 documentation preview: https://nvidia-preview-nemoclaw-v1-pr-12972.docs.buildwithfern.com/nemoclaw |
This was referenced Oct 11, 2026
cv
added a commit
that referenced
this pull request
Oct 11, 2026
## Failure `v1` doesn't compile since #12972. Its new `nemoclaw-provider/tests/contract/kubernetes_lifecycle.rs` calls `TofuWorkspace::new(tofu, provider)`, with OpenTofu and the provider read from `NEMOCLAW_TEST_TOFU` and `NEMOCLAW_TEST_PROVIDER`. #12971 merged first and changed that function to `TofuWorkspace::new(&Bundle, nemoclaw)`. Since #12971, `cargo ci lifecycle` also no longer sets either variable. Each PR passed CI against a `v1` without the other. Every PR's CI now fails at `Lint Rust`: ``` error[E0308]: mismatched types --> crates/nemoclaw-provider/tests/contract/kubernetes_lifecycle.rs:111:44 | 111 | let workspace = TofuWorkspace::new(tofu, provider); | ^^^^ expected `&Bundle`, found `PathBuf` ``` ## Decision Build the workspace with `crate::workspace()`, as the crate's other contract tests do since #12971: OpenTofu and the `openshell` and `fabric` providers from `NEMOCLAW_TEST_BUNDLE`, and the `nemoclaw` provider built from the checkout. That drops the two environment variables and the now-unused `PathBuf` import. ## Validation - `cargo clippy -p nemoclaw-provider --tests -- -D warnings` is clean. - `cargo ci` passed: 1,331 workspace tests and 131 lifecycle tests. Both of the file's tests ran from the bundle and passed: - `kubernetes_resources_apply_observe_the_release_and_tear_down_keeping_storage` - `kubernetes_resources_refuse_replaced_or_missing_objects_without_recreating_them`
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 #12876. Closes #12879.
Failure
The nemoclaw provider's contract binary checked
nemoclaw_kubernetes_storage,nemoclaw_kubernetes_auth, andnemoclaw_kubernetes_gatewayonly throughplan(kubernetes_hcl). Apply, refresh, and teardown ran only in the live Kind suite.Decision
helm_recoveryruns the bundled Helm provider against it too). This PR moves that fake tocrates/test-support/kube_api.rsso the provider contract binary can include it. It is shared as a source module, likehttp.rs, and not throughnemoclaw-test-fixtures, because that crate depends on the SDK. The kube-rs client helper stays in the SDK tests (tests/support/kube_client.rs), so the provider takes nokubedependency.kubernetes_lifecyclecontract tests run the production provider through pinned OpenTofu. The provider connects through a kubeconfig that points at the fake and usesNEMOCLAW_KUBERNETES_STATE. The test writes and deletes the StatefulSet and release record that Helm would, in the bundle's order. The live Kind tests remain the end-to-end check of the chart.kubernetes_resources_apply_observe_the_release_and_tear_down_keeping_storage:runningonce ready, andrelease_presentfollows the release record.destroy = true) keeps the issuer while the release exists, then deletes it once Helm's objects are gone. The namespace and key are kept.tofu destroyrefuses storage.kubernetes_resources_refuse_replaced_or_missing_objects_without_recreating_them: a deleted namespace, a replaced key, a deleted or replaced issuer object, or a replaced StatefulSet fails plan and apply with the ownership error. Nothing is recreated or removed, and state is unchanged.s(such as namespaceagents) returned 200 with an empty list instead of 404. The fake now tells collection paths from object paths by their shape.the_in_memory_api_reports_absent_objects_as_missingcovers the fix.docs/contributing/integration-tests.mddescribes the new tests. It also drops the claim thatELSEWHERElists types, because that list is now empty.Validation
Run locally on linux_arm64:
the_in_memory_api_reports_absent_objects_as_missingfailed before the fake fix and passes after it.kubernetes_lifecycletests pass in about 6 s each with pinned OpenTofu 1.12.6.kubernetes_hclandevery_type_has_a_contract_testalso pass.Operations::read_storage, the drift test fails at the deleted namespace. I reverted the mutation.kubernetes_integration tests pass, plus thehelm_recoverylib tests, including the five ignored ones against a bundle.cargo fmt --allandcargo clippy --workspace --all-targets -- -D warningspass.I did not run Windows locally. The tests reach the fake over loopback TCP, not through the ssh relay, and are not gated.