Repository navigation
test(contract): render the pinned gateway chart with tofu test - #14174
Merged
Merged
Conversation
Move the three Rust chart-render tests from Live / Kind into an openshell-provider contract module. chart.rs writes the SDK's values to inputs/; hcl/chart/tests hold the expectations, including that the development gateway refuses unauthenticated users and trusts only the deployment's own issuer and audience. Part of #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
|
Contributor
This was referenced Nov 4, 2026
Each chart contract test pulls the pinned chart from ghcr.io; one took 8.1 s on linux_amd64, over openshell-provider::contract's 8 s limit.
4 of 8 tasks
# Conflicts: # internal-docs/contributing/live-tests.md
sandl99
marked this pull request as ready for review
November 5, 2026 03:09
cv
pushed a commit
that referenced
this pull request
Nov 5, 2026
## Failure `tests/e2e/rust/interfaces_live.rs` (806 lines, plus `pseudo_terminal.rs`) checked OpenClaw's, Hermes's, and Deep Agents Code's interfaces through a model stand-in in the test process, mixing the successful path with refusal, recovery, and leak checks. #14061 item 1 moves the successful path to HCL E2E with real inference. ## Decision Closes #14061 (parent #13933). Stacked on #14178 (#14176, #14174). Follows the maintainer's item 1 decision. - **New case `docker-openclaw-hermes-interfaces`** in `cargo ci live-docker`, on a stub model (review by @cv): OpenClaw with its Control UI on 18789; Hermes with its API server on 8642 and dashboard on 9119. A new `tests/e2e/hcl/model` module runs the stub with the bundled Docker provider: the pinned `nginx-unprivileged` image on the host network at the case's model port, listing one model, answering every chat completion with one reply (streamed when asked), and refusing any request without the run's key. - **New `tests/e2e/hcl/interface` module and `hcl_live::interface` probe**: per request, read the reported token with `openshell sandbox exec`, forward the port with `openshell forward service`, send one request with the token as a Bearer credential. Reports hold status codes; tokens and bodies stay in the private `work` directory; the module outputs only failing target names. - **Scenario:** apply must report the three interfaces with their ports, sign-in, and token files; the Control UI page loads and its configuration accepts the token; Hermes's API lists models and answers with the stub's reply, which also shows NemoClaw sent the configured key; Hermes's dashboard page loads with its session token; destroy keeps only gateway storage. - **`cargo ci live-docker`:** installs the pinned OpenShell CLI again, binds the case (UID, gateway port and subnet, stub address, OpenClaw and Hermes images, a fresh model key), and runs each HCL case (`docker-dummy`, this one) as its own nextest command. Its wall limit is raised to 480 s until a few runs measure the new total. - **Deleted:** `interfaces_live.rs`, `pseudo_terminal.rs`, `live::interfaces_document` and its test. `tests/e2e/rust/` is now empty. | Rust check | New owner | |---|---| | Apply reports ports, token paths, sign-in | Scenario `apply` assertion | | OpenClaw Control UI loads; configuration accepts the token | `interfaces` run | | Hermes API accepts its token and answers a chat completion | `interfaces` run, with the stub's reply | | Hermes dashboard page loads with its session token | `interfaces` run | | Missing or wrong tokens refused; dashboard killed; tokens kept out of output and state; undeclared interface rejected at plan | #14060 integration items | | Deep Agents Code terminal; Hermes browser chat (pseudo-terminal) | Dropped (maintainer decision) | | Every model request carried the configured key | The stub refuses any request without the run's key | **Fixes for the first Live / HCL run of every migrated case** (run 41804342269 and 41833590603; all other cases passed, including this PR's new one): - `hcl/cli` now reports the CLI's error message. With `--output json`, the CLI writes a failed command's redacted message in its JSON on standard output, so failed applies showed an empty message. - `docker-hermes-v0-parity` (#14082) failed at plan: the current Hermes adapter requires read access to `/opt/nemo-relay/plugins/switchyard`, which the v0 export's explicit filesystem policy predates. The case grants it, and `hosted_parity`'s projection adds it like the v1 images' user and group. - `docker-openclaw-hermes-vllm` (#14090) failed at Hermes's start: Qwen3-4B's 40,960-token window is below the 64,000 tokens Hermes requires, as `docs/inference.md` states. The case is now `docker-openclaw-vllm-shared`, two OpenClaw agents sharing the model; `docker-openclaw-hermes-ollama` keeps Hermes on a managed model. Not done here: `cargo ci live-docker` still builds the Deep Agents Code image, which nothing in that suite uses now; removing it touches the live image publishing lists and is left as a follow-up. Net: +393 / −1,270 across 17 files. ## Validation - Local (macOS): `cargo ci fmt`, `cargo ci test` (1,753 tests), `cargo clippy --all-targets --all-features` for `nemoclaw-e2e` and `nemoclaw-build` pass. - The scenario passes against a fake CLI and probe, and fails naming `api_chat` when the reply is not `FOUR`. - Live: the `docker-openclaw-hermes-interfaces` lane runs on a `run-hcl-e2e/**` push of this branch. Refs #14061
…eway test (#14176) ## Failure The default Kubernetes path, the `kubernetes` runtime with the `development` authentication profile as in `examples/kubernetes/managed-development.yaml`, had no HCL E2E case with agents. Its only live coverage was the Rust gateway test `kubernetes_live::the_gateway_refuses_a_foreign_token_and_reinstalls_on_its_retained_storage`, which deploys no agents and drives the compiled graph directly instead of the CLI. #14061 item 7 moves that coverage to HCL E2E. ## Decision Part of #14061 (parent #13933). Stacked on #14174, which adds the chart contract that now owns the development gateway's issuer configuration. - **New case `kind-kubernetes-development`**: one OpenClaw agent, default `kubernetes` runtime and `development` profile, image from the run's private registry. Runs: `cluster`, `apply` (CLI with an empty `PATH`), `reply`, `destroy` (keeps exactly `openshell_kubernetes_storage.runtime`), `redeploy` (apply again; the storage must not be created again), `reply_after_redeploy`. It skips the unchanged plan, which `kind-openshift-oidc` checks, and the final destroy, because the runner deletes the cluster; both keep the case within the per-test limit. - **Rename** `kind-openshift-agents` → `kind-openshift-oidc` (case, scenario, docs). - `hcl/kind` module: the OpenShift UID-range annotations and the OIDC issuer are released only when the case selects them. - `hcl/cli`: new `empty_path` input runs the CLI with an empty `PATH`. - `live_kind.rs` runs each kind case as its own nextest command, joining the JUnit reports as `live-docker` does. - **Deleted** `tests/e2e/rust/kubernetes_live.rs` (557 lines); the probe's port-forward helper moves into `hcl_live.rs`. | Rust gateway test check | New owner | |---|---| | Gateway installs, authenticates with the development token, destroy keeps storage | `kind-kubernetes-development` | | No Helm program needed (empty `PATH`) | `kind-kubernetes-development` (`empty_path = true`) | | Remove and reinstall keeps the namespace, key, and PVCs | `kind-kubernetes-development` `redeploy`: the retained storage refreshes instead of being created again, and the agent answers | | Gateway trusts only the deployment's own issuer | `hcl/chart/tests/kubernetes.tftest.hcl` (#14174) | | A foreign-signed token is refused | Dropped as OpenShell's enforcement (maintainer decision 7.A) | | Planning creates no namespace; Helm keeps one release | SDK `kubernetes_operations` tests; Helm provider behavior | **Time:** the two cases now run one after the other, so Live / Kind's total is about the sum of both. The OIDC case took about 135 s; the development case is expected near 150 s, close to the current 300 s step limit and 180 s per-test limit (temporarily raised while #14087 is open). This PR's Live / Kind run gives the measured times; if they exceed the limits, the limits need a decision rather than a smaller case. Net: +380 / −662 across 15 files. ## Validation - Local (macOS): `cargo ci fmt`, `cargo ci clippy`, `cargo ci test` (1,758 tests) pass; `live_kind` binding tests cover both case templates. - `tofu validate` of `hcl/kind` passes; with each case, the module selects the OpenShift range and the issuer only for `kind-openshift-oidc`. - Live / Kind on linux_amd64 and linux_arm64 in this PR's CI is the live evidence. Refs #14061
cv
enabled auto-merge (squash)
November 5, 2026 09:23
cv
pushed a commit
that referenced
this pull request
Nov 5, 2026
## Failure `tests/e2e/rust/managed_gateway.rs` drove the SDK's `test-scenarios` runtime-stage hook against real Docker. Its successful path is covered by every Docker HCL E2E case; #14061 item 2 moves its remaining checks to their owners and deletes it. ## Decision Part of #14061 (parent #13933). Now targets `v1`: #14174 and #14176 have merged, and #14179 (the agent interfaces on a stub model in `cargo ci live-docker`, plus the fixes for the two failing Hermes Live / HCL cases) was squash-merged into this branch, so this PR also carries its changes; see #14179 for that part's description and evidence. | `managed_gateway` check | New owner | |---|---| | Plan creates no gateway container or storage | `openshell-provider` contract `hcl/gateway`: now also plans `openshell_gateway_storage` for Docker; the engine fixture asserts every request is a read | | Unchanged runtime apply | Every Docker HCL E2E case's unchanged plan | | Second deployment with the same port and subnet refused at plan | `nemoclaw-provider` `planning_tests.rs` (subnet) and the gateway prerequisite check (port in use) | | Swapped encryption key refused, state unchanged | Provider observation and storage tests (checklist item already ticked) | | `plan --destroy` preview; export refused after destroy | Integration `export_observations` and the Docker HCL E2E destroy runs | | **Re-apply after destroy keeps storage, new gateway container** | `docker-dummy` (`cargo ci live-docker`): `redeploy` must not create `openshell_gateway_storage.runtime` again and must create `docker_container.managed_gateway_runtime`; the agent replies again; a final destroy keeps only the storage | | Stopped or removed gateway container recreated | Dropped: Docker's behavior (maintainer decision, item 2) | The redeploy went to the `docker-dummy` E2E case instead of an HCL integration scenario, as the maintainer approved for the Kubernetes redeploy in #14176: it is a successful operator flow, it needs the real retained volume, and it adds about 10-15 s to `live-docker`. Also removed: the SDK's now-unused `scenario_runtime_stage` hook (the `helm_recovery` integration tests still use the other `test-scenarios` hooks), and the `live-recovery` gateway document and state directory `cargo ci live-docker` wrote for the deleted test. Net: +104 / −391 across 12 files. ## Validation - Local (macOS): `cargo ci fmt`, `cargo ci test` (1,758 tests), `cargo ci lifecycle` pass; `cargo clippy` with `test-scenarios` passes. - `gateway_settings_plan_without_contacting_a_host` passes with the new storage resource; the fixture answers absent volumes, helpers, and networks and panics on any write. - Live / Docker in this PR's CI runs the extended `docker-dummy` scenario. Refs #14061
cv
added a commit
that referenced
this pull request
Nov 5, 2026
…rrupted (#14169) Managed Kubernetes and OpenShift gateways recover from an install that fails: Helm removes the failed release itself, a release that a stopped install leaves is named with the command that removes it, and an interrupted first apply keeps the bindings it created. ## Problem An apply that failed or was interrupted while Helm installed the gateway release left a deployment that neither apply nor destroy could recover (#14155): - When Helm's 600-second wait timed out, the release stayed `failed` in the cluster, but the pinned Helm provider (3.3.0) returned the error without saving the release in the state. The next apply failed with `cannot re-use a name that is still in use`, and destroy failed with `observation is incomplete`; only `helm uninstall`, then destroy and apply, recovered the deployment. - In a state directory without a state file, OpenTofu saved an interrupted apply's snapshot with only the last resource it updated, so the storage binding was lost and plan and destroy refused. Resolves #14155, with #14224, which lets the first interrupt finish the operations in progress. ## Change - The gateway release sets `atomic`: when its install fails or Helm's wait times out, Helm uninstalls the release before the Helm provider returns, and the error carries Helm's reason. The namespace, the credential key, and the gateway's volume claims stay. A failed upgrade now rolls back, as `helm upgrade --atomic` does. - A second interrupt, a crash, or a killed process can still stop the install and leave the release `pending-install`. When the cluster records the gateway release and the state does not bind it, plan, apply, and destroy stop before changing anything, name the release, and give its `helm uninstall` command (`Error::UnboundRelease`). NemoClaw can't tell that release from another owner's, so it leaves it. - The `kind-kubernetes-development` live case refuses the gateway's StatefulSet with an admission policy between its destroy and redeploy (the `hcl_live::admission` probe): the install must fail with the refusal, leave no record of the release, and keep the retained storage bound. It replaces the same check in the Rust gateway live test that #14174 retired. - When the state file is missing, a refresh-only apply of an empty configuration creates it before the first plan, which avoids the OpenTofu bug without reading the deployment's data sources before the managed gateway exists. - Rejected: the first version of this pull request recorded each install in `helm-install.json` and let destroy remove a leftover release through a separate OpenTofu root; `atomic` covers the common failures with much less code. `upgrade_install` doesn't help: Helm refuses to upgrade a `pending-install` release, and it would take over a release by name alone. - Upstream boundaries: Helm's own `atomic` option removes a failed install, the existing authentication observation establishes that a release record exists, and NemoClaw removes no release that it can't establish as its own. `internal-docs/design/scope.md` records both workarounds: - the state file, until OpenTofu fixes opentofu/opentofu#4809 (since v1.11.0); - `atomic` and the unbound-release check, until the Helm provider saves a failed install as tainted again, hashicorp/terraform-provider-helm#1886 (since 3.0.0). #14227 tracks removing both. ## Beyond CI On the single-node OpenShift 4.22.18 cluster from #14139, with this branch's bundle at 06be60b, which already carried #14224's change, and the document from #14155's runs (OIDC profile, one OpenClaw sandbox): - Helm's 600-second wait timed out while the gateway's OIDC issuer was unreachable. The apply failed with "release nc-6fe4115dbd9285c4-gateway failed, and has been uninstalled due to atomic being set: context deadline exceeded" and left no release record. The state kept storage and authentication, and the namespace kept the gateway's volume claim and its key. With the issuer back, plan installed the release again without refusing, apply completed in 67 seconds, and the agent replied. - One interrupt during the install, with the issuer reachable again 2 seconds later: the CLI printed the stopping notice, Helm's install completed after 49 seconds, and the apply stopped with exit code 130. The state bound the release; a reapply completed in 32 seconds, and the agent replied. - Two interrupts 10 seconds apart: the apply stopped at once, leaving the release `pending-install` without a binding while the state kept storage and authentication. Plan and destroy stopped within 5 seconds, named the release and its `helm uninstall` command, and left the release records unchanged. After that command, apply completed in 67 seconds, and the agent replied. --------- Co-authored-by: Claude Opus 5.5 <[email protected]> Co-authored-by: Carlos Villela <[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.
Failure
kubernetes_chart's three tests render the pinned OpenShell gateway chart with the SDK's values. They need no cluster, but they ran in Live / Kind as Rust, with their expectations written in Rust. #14061 tracks moving them to a contract test, and the maintainer decided (item 7.A) that a chart render check should own NemoClaw's part of the development gateway's authentication, so the live foreign-token refusal inkubernetes_livecan be dropped later.Decision
Part of #14061 (parent #13933).
openshell-providercontract modulehcl/chart: ahelm_templatedata source with the bundled Helm provider, pulling the chart by digest.chart.rsonly writes the SDK's values for each scenario toinputs/(Kubernetes, pull Secrets, OpenShift plus the observed identity) and the objects NemoClaw prepares; thetests/*.tftest.hclfiles hold every expectation.crates/nemoclaw-e2e/tests/e2e/rust/kubernetes_chart.rs(292 lines) and itslive-kindselector.hcl/chart/tests/kubernetes.tftest.hcl,openshift.tftest.hclkubernetes.tftest.hclpull-secrets.tftest.hclopenshift.tftest.hclkubernetes.tftest.hcl(item 7.A)The three tests take about 3.5 s locally, under
openshell-provider::contract's 8 s per-test limit. Likefailures/gateway_storage.rs, rendering needs network access toghcr.io.Net: +304 / −309 across 12 files (Rust −215, HCL +185, docs).
Validation
cargo ci fmt,cargo ci clippy,cargo ci test(1,758 tests),cargo ci lifecycle(98 tests) pass.cargo test -p openshell-provider --test contract -- --ignored chart::with the darwin bundle: 3 passed in about 3.5 s.kubernetes.tftest.hcl.Refs #14061