Repository navigation
test(e2e): reduce the Rust Kind gateway test to what the kind HCL scenario cannot cover - #14119
Merged
Merged
Conversation
…io covers The kind-openshift-agents scenario installs the managed gateway through the CLI and the bundled Helm provider, reaches it with the development token, plans no changes, and destroys it keeping storage, which is the Rust gateway test's successful path. Delete that test and the runtime graph, Helm release, and OpenShift admission helpers only it used. Cut the scenario to two agents; separate identities across several agents are an integration check now. Bind the docker and kind case templates through one placeholder helper. Refs #14061
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
Collaborator
Author
Authoring session — opening
|
8 tasks
Contributor
Restore the Rust Kind gateway test, reduced to what the HCL scenario cannot show: the development gateway refuses a token signed by another key, and removing and reinstalling it keeps the namespace, encryption key, and PVCs with their UIDs, with OpenTofu run on an empty PATH. The OpenShift admission branch, which only ran by hand, and the volume reclaim-policy cleanup for clusters other than kind are gone. Refs #14061
sandl99
marked this pull request as ready for review
November 3, 2026 04:29
# Conflicts: # .config/test-budgets.yaml
cv
pushed a commit
that referenced
this pull request
Nov 3, 2026
… HCL case (#14125) <!-- SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. --> <!-- SPDX-License-Identifier: Apache-2.0 --> ## Failure Part of #14061. Stacked on #14119. Two Kind happy paths were still Rust live tests: `kubernetes_live::registry` (an agent image pulled from a private registry with the cluster's pull Secret) and `kubernetes_live::oidc` (a managed gateway that accepts an existing OIDC issuer's tokens). Both used the shared Rust Kind deploy flow (`deploy_image_and_export`), its stub model and request helpers, and `registry_fixture.rs`. That code and the SDK's separate issuer image test (`live-docker`) had no other callers. ## Decision Fold both paths into the existing `kind-openshift-agents` case instead of adding a second Kind case. A second case would not fit the 270 s `live-kind` budget: `tofu test` runs files one after another, and the case already takes about 135 s. **OIDC.** The case switches from the `development` profile to the `oidc` profile. The reduced Rust gateway test from #14119 still covers the development profile, including the foreign-token refusal. - The issuer is the SDK's own development issuer (`issuer::objects`, the pinned issuer image) in its own namespace, standing in for an identity provider. Its NetworkPolicy is left out because it admits only a gateway in the issuer's namespace. - `cargo ci` builds without the SDK, and the bundle has no TLS provider. OpenTofu also cannot sign a token. So a small probe, `hcl_live::issuer`, creates the issuer's key material, its objects, and one token for the case's audience (the deployment UID). The `kind` module runs it in `run "cluster"` and releases the objects through its chart, with the issuer CA in the deployment's namespace. - The token is written only to `work/credentials/NEMOCLAW_TEST_OIDC_TOKEN` (mode 0600). The `cli` and `verifier` modules export each file in that directory as the variable it names. The token never becomes an OpenTofu value, output, report, or log line. It is valid for one hour. **Registry.** `cargo ci live-kind` starts a pinned `registry:3` that requires a login on the kind network. It pushes the agent image there with `ctr` and uploads a new index digest, so the node must fetch the index from the registry. The node's CRI host configuration for that registry allows HTTP pulls and holds no credentials. The case names the image by its registry reference and sets `imagePullSecrets: [agent-registry]`. The `kind` chart creates that Secret from `TF_VAR_pull_credentials` in the pre-created namespace, as an operator would. The registry is removed afterward, unless `NEMOCLAW_KEEP_KIND_CLUSTER` keeps the cluster. The case's assertions are unchanged: apply succeeds, each agent answers from its recorded runtime with the stub's reply, a plan has no changes, and destroy keeps only `openshell_kubernetes_storage.runtime`. With the `oidc` profile and the private image, apply and the replies also show that the gateway accepts the issuer's token and that the pods pulled their image with the Secret. **Deleted.** `kubernetes_registry.rs`, `kubernetes_oidc.rs`, `registry_fixture.rs`, `kubernetes_requests.rs` (`gateway`, which `hcl_live::probe` uses, moves into `kubernetes_live.rs`), `deploy_image_and_export` and its document, identity, `Sandbox`-object, and diagnostics helpers, `state::agent_sandbox_id`, the SDK issuer image test, its `live-docker` selector, and the `live-kind` registry override. ### Removed checks and their owners | Removed check | Owner | |---|---| | A private agent image pulled with the cluster's pull Secret; the agent answers | This case | | The gateway accepts an existing issuer's token; the agent answers | This case (apply, and the probe through the gateway) | | Destroy keeps the gateway's storage | This case (`retained`); UID survival stays in the Rust gateway test | | The `oidc` profile runs no development issuer | Contract: `kubernetes_managed_compile::an_existing_oidc_issuer_replaces_the_development_issuer`, `kubernetes_operations::an_oidc_profile_writes_no_issuer_and_identifies_authentication_by_its_namespace` | | OpenTofu state holds no registry credentials | Contract: the schema accepts only Secret names (`config_kubernetes::image_pull_references_accept_only_unique_kubernetes_secret_names`, which also rejects a password field), and compile references them by name | | Destroy keeps the operator's namespace (UID, labels) and pull Secret | Contract: `kubernetes_operations::an_operators_namespace_and_pull_secret_survive_apply_and_destroy` | | The issuer image serves both documents over HTTPS | This case: the gateway fetches discovery and JWKS from the image, run from `issuer::objects` | | Unchanged apply and the export's apply keep identities and state; export reproduces the document, including image and Secret references; each sandbox has its own ID with its agent bound to it | #14060 (existing Kubernetes item) | | A token read from `token.env` is not kept in connection state | Contract: `kubernetes_connect::an_oidc_connection_passes_the_variable_tokenenv_names` | | Registry rejects a wrong password | Dropped: it tests `registry:3`. The anonymous 401 stays as the setup's readiness check | | Failure diagnostics (pod states, events, Fabric messages) and their unit test | Dropped: test-helper output, not a check | **Needs a maintainer decision.** These checks have no other owner, and this PR deletes them. Before approving, please accept or reject each proposal; I will restore any check you want kept: | Check | Proposal | |---|---| | A token for another audience is refused; the refused plan leaves the state directory byte-identical and echoes no token | Drop from E2E: audience validation is OpenShell's, and the authored table reaching the chart is covered by `kubernetes_managed_compile::authored_tables_reach_the_chart_gateway_config`. Add "a plan refused by gateway authentication leaves state unchanged and echoes no token" to #14060. Alternative: keep one narrow Rust security check. | | No regular file in the whole state directory holds a token; a renewed token plans with no changes and exports the document | #14060 (fixture gateway, `oidc` document, two tokens, then search the state directory) | | Destroy removes every `Sandbox` object within 60 s | Drop: OpenShell deletes the objects; the case's destroy covers NemoClaw's part | | The issuer image returns 404 for other paths and stays within its memory limit for 10 s | Drop: the case runs `issuer::objects` for the whole scenario | Net (Rust / HCL / chart and case YAML / docs / CI config): −1,959 / +86 / +46 / −18 / −11 lines; 542 added and 2,398 deleted. Of the Rust added, 269 lines are the registry setup and its unit test in `run_ci/kind_registry.rs`, moved from the deleted test fixture. ## Validation - `cargo ci fmt`, `cargo ci clippy`, and `cargo ci test` (1,745 tests) passed on darwin_arm64. The new tests are `kind_registry::tests::each_run_pushes_a_new_index_without_changing_image_contents` and the binding test against the real case template, which now checks the issuer URL, the audience, and the registry reference. - `tofu fmt -check -recursive` passed in `tests/e2e/hcl` with the bundled OpenTofu 1.12.9. - The `kind` module initialized against the bundle's provider mirror. `tofu console` evaluated its registry, pull Secret, issuer, audience, and model locals for a bound case, with `TF_VAR_pull_credentials` parsed from the environment. - Ran `hcl_live::issuer` from the built e2e binary. It wrote the six issuer objects and a 0600 token whose `iss` and `aud` match the case. The chart rendered offline with the bundled Helm provider's `helm_template`: pull Secret and CA ConfigMap in the deployment namespace, and issuer objects without the NetworkPolicy in the issuer namespace. - After the first Live / Kind run failed, I ran the case's `cluster` run block locally under `tofu test` with the Helm provider mocked and the real `hcl_live::issuer` binary. It passed and wrote the issuer objects and the token to `work/credentials`. - `Live / Kind` at 0d4ad2b failed on both architectures before any deployment. The registry started and the image push succeeded. The other four tests passed. `tofu test` rejected `var.pull_credentials`: a test file's `var` read from `TF_VAR_*` is the raw string. 578f92b lets the `kind` module read `TF_VAR_pull_credentials` itself, as it reads the context. - `Live / Kind` at 578f92b passed on both architectures. `hcl_live::case` ran the whole scenario: apply with the private image and the OIDC token, both agents' replies, an unchanged plan, and destroy. | Platform | `hcl_live::case` | nextest suite | `cargo ci live-kind` step | |---|---|---|---| | linux_amd64 | 110.2 s | 110.2 s | 249 s | | linux_arm64 | 109.9 s | 109.9 s | 199 s | The limits are 150 s per test and 270 s for the suite. The case took 133 s and 138 s with three agents in #14097. The suite now ends with the case, so it is about 140 s under its budget. I left `.config/test-budgets.yaml` unchanged, because one run is not enough to lower it.
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.
Failure
Part of #14061. Follow-up to #14097, which added the
kind-openshift-agentsHCL E2E scenario but removed only the Rust three-agents test: it added 541 lines and deleted 172. The Rust gateway test still repeated the scenario's successful path, and the docker and kind case bindings repeated each other.Decision
Reduce the Rust gateway test to the checks the scenario cannot make, rather than delete it: removing it entirely would leave two checks without an owner.
kind-openshift-agentstoo; the Rust test keeps these steps as setup for the checks belowPATH. The CLI passes the caller'sPATH, and CI runners have Helm.restricted-v2with the namespace's first UID and group (NEMOCLAW_TEST_KUBE_RUNTIME=openshift)Deletebefore deleting the namespace, for clusters withRetainDelete; the docs point manual runs on other clusters to Remove Retained Resources.Also:
the_gateway_refuses_a_foreign_token_and_reinstalls_on_its_retained_storageand document why it remains.kind-openshift-agentsfrom three agents to two; separate identities across agents are an integration item for Migrate v1 system tests to HCL integration tests #14060.live_docker.rs's line-based binding andlive_kind.rs's binding with one helper,nemoclaw_build::ci::live::bind_case.NEMOCLAW_TEST_KUBE_RUNTIME, which only the OpenShift branch read.Net: +108/−370 across 10 files; the gateway test shrinks by 193 lines.
Validation
cargo ci fmt,cargo ci clippy, andcargo ci test(1,748 tests, including both binding tests) passed on darwin_arm64.Live / Kindin this PR's CI runs the reduced gateway test, the two-agent scenario, and the OIDC, registry, and chart tests.