Skip to content

test(e2e): reduce the Rust Kind gateway test to what the kind HCL scenario cannot cover - #14119

Merged
cv merged 3 commits into
v1from
test/14061-kind-shrink
Nov 3, 2026
Merged

cv merged 3 commits into
v1from
test/14061-kind-shrink

Conversation

@sandl99

@sandl99 sandl99 commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

Failure

Part of #14061. Follow-up to #14097, which added the kind-openshift-agents HCL 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.

Gateway test check Owner after this PR
Install, unchanged plan, destroy that keeps storage, authenticated access with the development token kind-openshift-agents too; the Rust test keeps these steps as setup for the checks below
The development gateway refuses a token signed by another key Rust gateway test, kept. NemoClaw configures the gateway's authentication; the OIDC test only checks the OIDC profile.
Removing and reinstalling the gateway keeps the namespace, encryption key, and PVCs with their UIDs Rust gateway test, kept. Fixtures cannot show a real volume reattaching.
No Helm executable is needed Rust gateway test, kept: OpenTofu runs with an empty PATH. The CLI passes the caller's PATH, and CI runners have Helm.
On a real OpenShift cluster, pods admitted under restricted-v2 with the namespace's first UID and group (NEMOCLAW_TEST_KUBE_RUNTIME=openshift) Removed. This branch only ran by hand and never in CI; a real OpenShift case is on #14061's follow-up checklist.
Switching retained volumes to Delete before deleting the namespace, for clusters with Retain Removed. kind uses Delete; the docs point manual runs on other clusters to Remove Retained Resources.

Also:

  • Rename the test to the_gateway_refuses_a_foreign_token_and_reinstalls_on_its_retained_storage and document why it remains.
  • Cut kind-openshift-agents from three agents to two; separate identities across agents are an integration item for Migrate v1 system tests to HCL integration tests #14060.
  • Replace live_docker.rs's line-based binding and live_kind.rs's binding with one helper, nemoclaw_build::ci::live::bind_case.
  • Drop 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, and cargo ci test (1,748 tests, including both binding tests) passed on darwin_arm64.
  • Live / Kind in this PR's CI runs the reduced gateway test, the two-agent scenario, and the OIDC, registry, and chart tests.

…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
@copy-pr-bot

copy-pr-bot Bot commented Nov 3, 2026

Copy link
Copy Markdown

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.

@sandl99

sandl99 commented Nov 3, 2026

Copy link
Copy Markdown
Collaborator Author
Authoring session — opening
Field Status Value Evidence or limit
Harness recorded Pi 1.2.0 (TUI) Session metadata and installed release; cutoff before publication
Skills recorded nemoclaw-contributor-implement-issue (complete read); nemoclaw-contributor-create-pr (complete read) Tool reads in the session record to cutoff
Instruction files partial AGENTS.md on main (injected); AGENTS.md on v1 (complete read); PULL_REQUEST_TEMPLATE.md (complete read); SESSION_REPORT_TEMPLATE.md (complete read) WRITING.md and E2E authoring guidance were read only in part
Tool calls partial typescript: 485 Wrapper calls to cutoff, including 24 failed results; nested shell and git calls inside the wrapper are not counted
Session window recorded 2026-11-02T05:51Z to 2026-11-03T03:56Z; to publication First event to cutoff, including idle time
Compactions recorded 0 Complete record to cutoff; it has context elisions but no compaction
Models recorded claude-opus-5-5 Model change event; no later change
Reasoning levels recorded medium; high Thinking-level changes, in order

@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
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 sandl99 changed the title test(e2e): remove the Rust Kind gateway test that the kind HCL scenario covers test(e2e): reduce the Rust Kind gateway test to what the kind HCL scenario cannot cover Nov 3, 2026
@sandl99
sandl99 marked this pull request as ready for review November 3, 2026 04:29
@sandl99 sandl99 added v1 NemoClaw v1 branch area: e2e End-to-end tests, nightly failures, or validation infrastructure labels Nov 3, 2026
@cv
cv merged commit 1fc0edf into v1 Nov 3, 2026
54 checks passed
@cv
cv deleted the test/14061-kind-shrink branch November 3, 2026 09:03
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.
@wscurran wscurran added area: ci CI workflows, checks, release automation, or GitHub Actions area: docs Documentation, examples, guides, or docs build area: integrations Third-party service integration behavior area: security Security controls, permissions, secrets, or hardening integration: openclaw OpenClaw integration behavior platform: k8s Affects Kubernetes deployments chore Build, CI, dependency, or tooling maintenance labels Nov 3, 2026
@cv cv added this to the Roadmap: GTC DC 2026 milestone Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: ci CI workflows, checks, release automation, or GitHub Actions area: docs Documentation, examples, guides, or docs build area: e2e End-to-end tests, nightly failures, or validation infrastructure area: integrations Third-party service integration behavior area: security Security controls, permissions, secrets, or hardening chore Build, CI, dependency, or tooling maintenance integration: openclaw OpenClaw integration behavior platform: k8s Affects Kubernetes deployments v1 NemoClaw v1 branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants