Skip to content

test(e2e): run SDK-compiled cases under tofu test against shared fixtures - #13849

Merged
cv merged 51 commits into
v1from
test/v1-hcl-integration-openclaw-nvidia
Oct 30, 2026
Merged

cv merged 51 commits into
v1from
test/v1-hcl-integration-openclaw-nvidia

Conversation

@sandl99

@sandl99 sandl99 commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

Outcome

Stacked on #13723 (poc/v1-hcl-e2e-openclaw-hosted, merged at ade79c6730, which includes #14022 and runs the live scenarios as hcl_live). Merge #13723 first.

Integration scenarios run under tofu test from the same scenario documents as #13723's live E2E suites. Each scenario compiles a NemoClaw document with the production SDK and runs the real OpenShell, Fabric, host, vLLM, and Ollama providers against fixtures. The Docker provider is mocked with mock_provider. A scenario needs only YAML and HCL; no Rust changes per scenario.

Reason

The live E2E suites check whether agents answer on real infrastructure. These scenarios check, on every PR and without infrastructure or credentials, what the graph and provider handoffs produce:

  • the SDK's Docker inputs;
  • gateway storage and readiness;
  • inference registrations and credentials;
  • sandbox bindings and policy;
  • the Fabric configuration each agent starts with;
  • retention during teardown.

Design

crates/nemoclaw-e2e/hcl/
  cases/<scenario>.yaml                    # shared scenario catalog (live E2E and integration)
  main.tf, tests/, verifier/               # live E2E root (#13723), unchanged
  integration/                             # integration root
    main.tf
    harness/main.tf                        # copied beside each compiled scenario: fixture setup + observations
    modules/fixtures, modules/observed
    tests/<scenario>.tftest.hcl            # same <scenario> name as cases/

The runner, tests/hcl_integration/mod.rs, works as follows:

  1. Start the fixtures once, on one fixed engine socket.
  2. Compile each cases/<scenario>.yaml into cases/<scenario>/ of a work copy of the integration root, beside the harness.
  3. Run tofu init once.
  4. For each scenario, reset the fixtures and run tofu test -filter=tests/<scenario>.tftest.hcl.
  5. Check what OpenTofu's cleanup left: only storage NemoClaw retains, no gateway objects or Fabric runtimes, no deleted storage, no unknown engine request, and no leaked fixture credential.
  6. On failure, keep redacted evidence.

Other parts:

  • Fixtures (tests/hcl_integration/fixtures.rs): the existing OpenShell gRPC and streaming-exec fixture, plus the existing stateful fake engine, now shared through crates/test-support/docker_engine.rs. The fake engine adds declared images and containers, and an inference upstream that records requests.
  • fixture provider (nemoclaw-fixture-control): one data source, fixture_state. Its declare JSON input configures the fixtures, and its observations JSON output returns what they recorded.
  • Test file shape: fixtures (targeted plan), deploy, verify (a no-op apply with assertions), and teardown (sets permit_destroy). Assertions use real resource and data-source attributes and the recorded facts. modules/observed exposes agents keyed by sandbox, matching the live verifier's per-target view.

Scenarios

Scenario Checks
docker-openclaw-nvidia (live E2E document) The assistant OpenClaw agent on NVIDIA hosted inference: gateway Docker inputs and storage, readiness through the mocked container ID, one registration with env:NVIDIA_INFERENCE_API_KEY, the sandbox's binding and policy, the agent started with its compiled configuration. Every sandbox the document declares is checked, so the live document can add or remove sandboxes
docker-openclaw-vllm (live E2E document) Unauthenticated amd64 vLLM (RTX PRO 6000 profile) with an isolated sandbox: data volume only, no credential storage, no key read, registration without credential, agent model and address. The fake engine reports each service image's declared architecture
docker-openclaw-vllm-bearer vLLM with bearer authentication: credential storage created on the engine and mounted, key read, registration holding the generated key (file:CONTAINER:/credentials/inference-key)
docker-openclaw-ollama Managed Ollama: Docker inputs from the runtime launch, runtime image on the engine, readiness from the status file, registration and policy at the service address
docker-hosted-ollama-two-agents OpenClaw on hosted inference and Hermes on Ollama: separate registrations, each sandbox bound to and reaching only its own provider
docker-vllm-shared-two-agents One authenticated vLLM shared by OpenClaw and Hermes: one registration per harness holding the generated key, isolated bindings
openshift-external-two-providers OpenShift with Anthropic Messages and NVIDIA providers: each registration's API, base URL, and credential; multi-route OpenClaw; single-route Hermes
kubernetes-gateway-driver-mismatch Gateway reports Docker for a Kubernetes document: the workspace precondition rejects the plan (expect_failures), and nothing reaches OpenShell, Fabric, or the upstream

External Kubernetes deployments are not repeated here, because the kubernetes_agents system test already covers them through the SDK.

Verification

On darwin_arm64 at de3eeb5eb1, with a bundle built by cargo ci bundle from this checkout (OpenTofu 1.12.9):

  • cargo clippy -p nemoclaw-e2e --all-targets -- -D warnings passed. test(e2e): define verification scenarios in HCL #13723 removed nemoclaw-backend from nemoclaw-e2e's dependencies; the runner now takes it as a dev-dependency.
  • cargo ci --base origin/poc/v1-hcl-e2e-openclaw-hosted passed every step: 1701 unit tests, including every_scenario_test_names_a_case, and 161 lifecycle tests. The four hcl_integration shards took 67.7 s together, the slowest 21.1 s.
  • every_scenario_test_names_a_case failed when cases/docker-openclaw-vllm.yaml or cases/docker-openclaw-nvidia.yaml was moved away, naming both roots' test files, and passed once each was restored.
  • Earlier negative checks (reverted) each failed only their own scenario: a wrong credential source, a removed teardown run, an expected key read in the unauthenticated vLLM scenario, and the correct driver in the mismatch scenario.
  • GitHub CI on 8d823cd504 passed all 40 checks.

CI

The scenarios run once per pull request, in CI / Bundle's Lifecycle jobs on Linux and macOS, from the bundle and test archive those jobs already use. Each job sets NEMOCLAW_INTEGRATION_EVIDENCE. The runner appends each scenario's result there, and the job summary lists the results. A failed job uploads the directory, with failed scenarios' redacted OpenTofu output and observations, as hcl-integration-evidence-PLATFORM-SHARD-ATTEMPT.

The runner deals the scenarios across four tests (scenarios_in_shard_1 to scenarios_in_shard_4), each about 20 s, so each stays within the lifecycle budget of 90 s per test. As one test, the scenarios took 66–88 s on CI runners. The shards share the fixed engine socket, so the hcl-integration nextest test group runs them one at a time on a runner.

Limits

  • Not run: agents are not invoked and no inference is performed; the live E2E suites cover that. The vLLM and Ollama runtimes are declared containers and files, not running services.
  • Not covered:
    • the SDK's plan, apply, export, and destroy flow, and interrupted-operation recovery;
    • managed Kubernetes with Helm;
    • gateway TLS and bearer credentials, which the runner drops for the plaintext fixture gateway.
  • Hard-coded names: Docker test files name the generated Docker alias, which follows from the fixed engine socket, and the container resources the IDs are pinned on. Mocked images all report one ID. OpenTofu 1.14's shared mock files (mock_provider { source = ... }) can move the mock into one file once the pin moves.
  • Shared documents: live E2E edits to cases/*.yaml change these scenarios. every_scenario_test_names_a_case fails with the unit tests when a test file in hcl/tests or hcl/integration/tests has no matching case.
  • Runtime budget: four shard tests share the scenarios, about 20 s each on CI. With much larger scenario counts, SHARDS in the runner needs to grow to keep each shard within the 90 s per-test budget.

Signed-off-by: San Dang [email protected]

sandl99 and others added 13 commits October 26, 2026 18:35
…ures

Add a shared tofu test runner for integration cases. Each case is a NemoClaw document, main.tf, and a .tftest.hcl file. The runner compiles the document with the SDK, points it at the OpenShell gRPC, Docker engine, and inference fixtures, runs the bundle's OpenTofu and NVIDIA providers with the Docker provider mocked, and checks what teardown leaves.

A test-only fixture provider lets HCL declare engine images, containers, and upstream replies, and read recorded requests and fixture state. The first case is Docker + OpenClaw + NVIDIA hosted inference with one agent.

Signed-off-by: San Dang <[email protected]>
@copy-pr-bot

copy-pr-bot Bot commented Oct 27, 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.

@wscurran wscurran added area: e2e End-to-end tests, nightly failures, or validation infrastructure integration: openclaw OpenClaw integration behavior labels Oct 27, 2026
sandl99 and others added 14 commits October 28, 2026 14:22
Add three integration cases that need only a NemoClaw document, main.tf, and a .tftest.hcl file: a managed Ollama service, a managed vLLM service with bearer authentication, and two agents on hosted inference and Ollama.

The shared fixtures gain what these services need once: declared containers with a start time, volume mounts, files and their metadata, and optional lookup by name; credential provenance from declared container files; response headers in the HTTP fixture; and a teardown rule that follows references and data sources from retained storage. Providers of managed services keep their own endpoint.

Signed-off-by: San Dang <[email protected]>
## Outcome

The two HCL E2E suites in #13723 now have one hard outcome assertion
across their configured agent targets. A fast policy test rejects
additional HCL test blocks or assertions. The existing wrapper still
requires successful teardown.

## Reason

Live E2Es should prove that the configured agent responds through Fabric
and that owned resources are cleaned up. The POC's separate gateway,
sandbox, binding, policy, and vLLM assertions make the live suite carry
checks that can be covered at faster layers.

## Changes

- Keep one `agents_answer` assertion in each HCL suite, requiring an
attempted and valid response for every target.
- Add a nonignored Rust test that checks each suite has exactly one
approved `integration.tftest.hcl`. Changing a hard verdict requires
changing this policy test in the same review.
- Update the bundle-backed fixture test to show that a diagnostic health
flag alone does not fail HCL, while an invalid response does. The
wrapper's existing destroy check remains the cleanup verdict.

This is stacked on #13723 (`poc/v1-hcl-e2e-openclaw-hosted`). The guard
covers the HCL suites only. The Rust Brev E2E is outside its scope.

## Verification

- `PROTOC=$PWD/.tools/protoc-36.2/bin/protoc cargo test --offline
--locked -p nemoclaw-e2e --bin nemoclaw-hcl-e2e`: 2 passed, 1
bundle-backed fixture test ignored.
- `PROTOC=$PWD/.tools/protoc-36.2/bin/protoc cargo clippy --offline
--locked -p nemoclaw-e2e --bin nemoclaw-hcl-e2e --tests -- -D warnings`:
passed.
- `cargo fmt --all -- --check` and `git diff --check`: passed.
- Bundle-backed validation is pending CI. Local `cargo ci bundle` could
not run because this host has Rust 1.98.1 and V1 pins 1.99.1.
- Reviewed the three-file diff; no secrets or credentials added.

## DCO Sign-Off

Signed-off-by: Rebecca Sliter <[email protected]>

Co-authored-by: Rebecca Sliter <[email protected]>
Add five integration cases with only a NemoClaw document, main.tf, and a .tftest.hcl file: vLLM without authentication, one authenticated vLLM service shared by two agents, three agents on an external Kubernetes gateway, two hosted providers on an OpenShift gateway, and a Kubernetes document rejected by a gateway that reports Docker.

The shared layers gain a fixture_gateway data source for the compute driver the gateway reports. The runner drops an external gateway's credential and TLS for the plaintext fixture gateway, names the fixture image's metadata bundle in image metadata variables, redirects only engines a document names, and fails a case that has no test file or no passing run.

Signed-off-by: San Dang <[email protected]>
Split the runner into a short case runner and a fixtures module, reduce the fixture provider to one data source, fixture_state, with a declare input and observations output, and add shared docker and observed modules so cases declare engine state from nemoclaw.yaml and read keyed observations.

The runner now sets the openshell and fabric providers' destroy from var.permit_destroy, so cases need no provider blocks, and checks only fixture-side teardown and retention refusals.

Signed-off-by: San Dang <[email protected]>
…into test/v1-hcl-integration-openclaw-nvidia

Signed-off-by: San Dang <[email protected]>

# Conflicts:
#	crates/openshell-provider/tests/contract/gateway_storage.rs
Integration scenarios now pair hcl/cases/<scenario>.yaml, shared with the live E2E suites, with hcl/integration/tests/<scenario>.tftest.hcl. The runner compiles each document once beside a generic harness, runs tofu init once, and runs tofu test -filter per scenario with the fixtures reset between scenarios.

The hosted and local vLLM scenarios use the E2E documents directly. The external Kubernetes scenario is removed because kubernetes_agents covers it. One fixed engine socket gives every scenario the same Docker alias, and a sandbox described by image metadata runs the fixture image. The fake engine lists running declared containers for the gateway port check, and coverage-instrumented providers receive LLVM_PROFILE_FILE.

Signed-off-by: San Dang <[email protected]>
…into test/v1-hcl-integration-openclaw-nvidia
Restore the existing Qwen/OpenClaw example context limit while preserving the GPU memory budget, assertions and cleanup. Merge v1 to retain its exact rust-cache allow-list pin alongside the GPU Rust installer.

Signed-off-by: San Dang <[email protected]>
… fixtures

The vLLM integration scenario now compiles the live RTX PRO 6000 document, whose vLLM image is amd64. The fixture engine reported every image as arm64, so the image check refused it and every shard failed. The fixtures module now declares a service image's architecture from its document.

Signed-off-by: San Dang <[email protected]>
Address review: replace the separate nemoclaw-hcl-e2e binary with two
ignored tests in the integration binary. hcl_live::case applies the case's
YAML with the bundled CLI and runs its tofu test file; the verifier calls
hcl_live::probe from the same binary for each target, which reuses
nemoclaw_e2e::state to find the agent. The verifier lists failing targets,
so each scenario asserts in one line.

Live / HCL now builds the bundle, test executable, and OpenClaw image once
and downloads them in each lane, so the GPU runner compiles nothing. A
separate always() step destroys the deployment, so cleanup also runs after
a cancelled or timed-out job, and its receipt is uploaded with the reports.

Signed-off-by: San Dang <[email protected]>
A test file in hcl/tests or hcl/integration/tests whose hcl/cases/<name>.yaml is missing now fails with the unit tests in Build and test, before a bundle exists, instead of failing every integration shard in Lifecycle. Review on #13849 found such a rename after the base renamed the vLLM case.

Signed-off-by: San Dang <[email protected]>
@sandl99

sandl99 commented Oct 30, 2026

Copy link
Copy Markdown
Collaborator Author

@cv Thanks. Status of each finding:

  1. Missing case: fixed by fix(e2e): name the vLLM live case after its test #14022, which you merged into this branch (9fb19d947d).
  2. vLLM architecture: fixed in 8d823cd504. The fixtures module passes each service's hardware.architecture from its document, and the fake engine reports it for that image (arm64 otherwise). CI passed all 40 checks on that head.
  3. Missing cases before the bundle: added every_scenario_test_names_a_case in 9a0d2b91fd. It runs with the unit tests and fails when a test file in hcl/tests or hcl/integration/tests has no hcl/cases/<name>.yaml. Moving docker-openclaw-vllm.yaml or docker-openclaw-nvidia.yaml away made it fail and name both roots' files.
  4. Description: updated for one assistant agent, no components/, the four shards under Limits, the architecture fix, and the base at e71ee1fa0a.

Signed-off-by: San Dang <[email protected]>

#13723 now runs live scenarios as ignored integration tests and removed nemoclaw-backend from nemoclaw-e2e's dependencies. The integration runner names the providers' diagnostics variable from it, so it is a dev-dependency here. The integration docs name hcl_live::case for the live scenarios.
Base automatically changed from poc/v1-hcl-e2e-openclaw-hosted to v1 October 30, 2026 15:57
@cv
cv enabled auto-merge (squash) October 30, 2026 16:01
@github-actions

Copy link
Copy Markdown
Contributor

@cv
cv merged commit 9218767 into v1 Oct 30, 2026
54 checks passed
@cv
cv deleted the test/v1-hcl-integration-openclaw-nvidia branch October 30, 2026 16:20
@wscurran wscurran added area: ci CI workflows, checks, release automation, or GitHub Actions area: providers Inference provider integrations and provider behavior area: security Security controls, permissions, secrets, or hardening chore Build, CI, dependency, or tooling maintenance integration: hermes Hermes integration behavior provider: anthropic Anthropic or Claude provider behavior provider: nvidia NVIDIA inference endpoint, NIM, or NVIDIA provider behavior provider: ollama Ollama local model provider behavior provider: vllm vLLM local or hosted provider behavior labels Oct 30, 2026
sandl99 added a commit that referenced this pull request Nov 2, 2026
…14088)

<!-- SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION &
AFFILIATES. All rights reserved. -->
<!-- SPDX-License-Identifier: Apache-2.0 -->

## Failure

`nemoclaw-e2e` builds one test binary, `integration` (`tests/main.rs`),
with three kinds of test in it: system tests against local fixtures,
live tests against real Docker, Kubernetes, images, or inference, and
non-ignored offline checks.
Only the module lists in `.config/nextest.toml` say which is which.
`hcl/` also mixes the shared NemoClaw documents (`hcl/cases`), the live
HCL (`hcl/main.tf`, `hcl/tests`, `hcl/verifier`), and the integration
`tofu test` root (`hcl/integration`), whose runner lives in
`tests/hcl_integration/`.

Related to #14060 and #14061; this PR resolves neither. #14063 will be
rebased on top of it.

## Decision

Split the binary into two trees, following the repository's
`tests/<layer>/main.rs` convention. This PR moves and renames files
only: no test, assertion, fixture behavior, or scenario changes. Rust
module names and test names are unchanged, so nextest filters and test
IDs keep working; only the binary ID changes.

```
Before                                   After
crates/nemoclaw-e2e/                     crates/nemoclaw-e2e/
├── hcl/                                 ├── cases/                  # from hcl/cases
│   ├── cases/                           ├── fixtures/               # unchanged (hosted parity)
│   ├── integration/                     ├── src/
│   │   ├── main.tf                      └── tests/
│   │   ├── harness/ modules/ tests/         ├── integration/        # binary integration: local fixtures only
│   ├── main.tf                              │   ├── main.rs
│   ├── tests/                               │   ├── hcl/            # from hcl/integration
│   └── verifier/                            │   ├── tofu_test/      # from tests/hcl_integration
├── fixtures/                                │   ├── helm_recovery.rs, helm_recovery/
├── src/                                     │   └── deployment.rs, remote_service.rs, ...
└── tests/                                   ├── e2e/                # binary e2e: live tests
    ├── main.rs        # binary integration  │   ├── main.rs
    ├── brev.rs        # binary brev         │   ├── hcl/            # from hcl/: main.tf, tests/, verifier/
    ├── fixtures/                            │   ├── fixtures/       # from tests/fixtures
    ├── hcl_integration/                     │   ├── service_images/
    ├── helm_recovery/                       │   └── hcl_live.rs, kubernetes_live.rs, ...
    ├── service_images/                      └── brev.rs             # binary brev, unchanged
    └── *.rs (41 modules)
```

In every other crate, `integration` is the ordinary unit-test binary;
`testing.md` now says so once.

### Placement

| Module | Binary | Reason |
|---|---|---|
| `deployment`, `export_observations`, `fabric_deployment`,
`kubernetes_agents`, `multi_agent`, `multiple_providers`,
`remote_service`, `helm_recovery` (+ `destroy_faults`),
`travel_example`, `travel_team_example` | `integration` | System tests
against fixture gateways, simulated engines and SSH hosts, and the
in-memory Kubernetes API. |
| `hcl_integration` | `integration` | The `tofu test` runner. Its
directory is now `tests/integration/tofu_test/`, declared with `#[path =
"tofu_test/mod.rs"] mod hcl_integration;` so that test names, the
`hcl-integration` test group filter, and documentation stay the same. |
| `docker_engine`, `kube_api`, `transport` (`crates/test-support`) |
`integration` | Used only by `hcl_integration` and `helm_recovery`. |
| `docker_fixture` | `integration` | Tests `nemoclaw_e2e::http_fixture`,
which the system tests and the `tofu test` fixtures use. |
| `fabric_bridge`, `tls`, `web_search` | `integration` | Test the
providers against the fake OpenShell gateway
(`nemoclaw_e2e::openshell::Fixture`), the system tests' gateway. They
use no real infrastructure. |
| `agent_compatibility` | `integration` | Tests `image_runtime` binding
and policy, which the system tests use through `image_runtime::engine`
and `metadata_bundle`. |
| `openshell_contract_fixtures` | `integration` | Keeps the
`openshell-provider` contract fixtures in sync with the SDK; it serves
the lifecycle layer, not the live suites. |
| `cache_provider`, `docker_provider_proxy`, `docker_registry`,
`dummy_agent`, `interfaces_live`, `managed_gateway` | `e2e` |
`live-docker` profile. |
| `kubernetes_live` (+ `kubernetes_oidc`, `kubernetes_registry`,
`kubernetes_requests`), `kubernetes_chart` | `e2e` | `live-kind`
profile. `kubernetes_requests` and `kubernetes_registry` hold
non-ignored checks of `kubernetes_live`'s helpers, and are its `#[path]`
submodules. |
| `hcl_live`, `fabric_live`, `model_live`, `hosted_parity`, `spark`,
`managed`, `existing_ollama`, `managed_ollama`, `remote_models`,
`shared_service`, `service_images` | `e2e` | Opt-in live tests. The
non-ignored checks in `fabric_live`, `hosted_parity`, and
`interfaces_live` test those modules' own helpers and stay with them. |
| `pseudo_terminal` | `e2e` | Helper for `interfaces_live`; its
non-ignored tests check that helper. |
| `registry_fixture` | `e2e` | Helper for `docker_registry` and
`kubernetes_registry`. |

Every `#[cfg(...)]` gate is unchanged: a script compared each of the 41
module declarations in the old `tests/main.rs` with the new `main.rs`
files and found each declared exactly once with the same gate.

Crate-root `fixtures/` (hosted parity) stays where it is. Moving it
would also change `tools/e2e/brev-v1-guest.sh` and `live-tests.md` and
gain nothing for this split.

### Consumers updated

- `crates/nemoclaw-e2e/Cargo.toml`: `[[test]]` targets `integration`
(`tests/integration/main.rs`) and `e2e` (`tests/e2e/main.rs`); the
comment explains the split.
- Source paths: `include_str!`/`include_bytes!` gain one `../`.
`#[path]` attributes to `crates/test-support` are updated. The `tofu
test` runner reads `CARGO_MANIFEST_DIR/cases` and
`CARGO_MANIFEST_DIR/tests/integration/hcl`. `hcl_live` reads
`cases/<case>.yaml` and runs OpenTofu in `tests/e2e/hcl`, still relative
to the crate directory that the workflow uses as its working directory.
Paths inside the HCL harness are unchanged, because the integration root
moved as one directory.
- `every_scenario_test_names_a_case` reads `tests/e2e/hcl/tests` and
`tests/integration/hcl/tests` and looks up each name in `cases/`. It is
still a non-ignored test.
- `.config/nextest.toml`: `lifecycle` selects `package(nemoclaw-e2e) &
binary(=integration)` whole. `live-docker` and `live-kind` keep their
module filters, now on `binary(=e2e)`. The `hcl-integration` test group
and its `max-threads = 1` limit are unchanged.
`.config/test-budgets.yaml` names no `nemoclaw-e2e` binary, so it is
unchanged.
- `.github/workflows/hcl-e2e.yml`: builds and copies the `e2e`
executable, runs `candidate/e2e hcl_live::case`, and pins images in
`crates/nemoclaw-e2e/cases/`. The working directory stays
`crates/nemoclaw-e2e`.
- `cargo ci archive` derives its binaries from the profiles, so on Linux
it now archives `nemoclaw-e2e::e2e` for the live jobs; no code change
was needed. No determinator rule or `tools/` script names the moved
paths. `brev.yml` and `brev-v1-guest.sh` use only the unchanged `brev`
binary and crate-root `fixtures/`.
- Docs: `testing.md` (layer table, unit, system, and live text),
`integration-tests.md` (`tofu test` paths and the system-test binary),
`live-tests.md` (every `nemoclaw-e2e` command now names `--test e2e`,
plus the `cache_provider.tf` link), and links in `docs/provider.md`,
`docs/security.md`, `docs/design/fabric-management.md`, and
`examples/hcl/travel-team/README.md`. The remaining `--test integration`
commands for `nemoclaw-e2e`, including the one in
`.agents/skills/add-fabric-harness/SKILL.md`, run modules that are in
`integration`.

### Not moved cleanly

- `tests/main.rs` was rewritten as two new files, so Git records it as
deleted and `tests/integration/main.rs` and `tests/e2e/main.rs` as
added; `git log --follow` does not connect them. Every other file is a
rename.
- `tests/e2e/fixtures/gateway_readiness.tf` had no consumer before this
PR and still has none. It moved with `tests/fixtures`; this PR does not
decide whether to remove it.
- `hcl_live::probe`'s `#[ignore]` reason names its caller's path, so it
now reads `tests/e2e/hcl/verifier`. Two include lines also changed
wrapping after `cargo fmt`.

## Validation

On darwin_arm64 at `a98fc08603`:

- **Test lists.** I ran `cargo nextest list --workspace --all-targets
--profile P --run-ignored only` for `lifecycle`, `live-docker`, and
`live-kind`, and the `ci` profile's non-ignored list, before the move
(`origin/v1` at `24b35280fb`) and after it. After removing the
`nemoclaw-e2e::integration`/`nemoclaw-e2e::e2e` binary ID, each pair of
sets is identical, and no test changed ignored state:

  | Profile | Before | After | `nemoclaw-e2e` after |
  |---|---|---|---|
  | `lifecycle` | 162 | 162 | 62 in `integration` |
  | `live-docker` | 8 | 8 | 4 in `e2e` |
  | `live-kind` | 7 | 7 | 7 in `e2e` |
| `ci` (non-ignored) | 1748 | 1748 | 14 `integration`, 12 `e2e`, 2
`brev`, 9 lib |
| All `nemoclaw-e2e` tests | 116 | 116 | 76 `integration`, 28 `e2e`, 3
`brev`, 9 lib |

These lists cover macOS only. The Linux-only modules (`docker_registry`,
`existing_ollama`, `managed_ollama`, `remote_models`, `service_images`,
`shared_service`) are covered by the module-declaration comparison above
and by CI's Linux jobs.
- `cargo ci --base origin/v1` passed all selected steps (tools, fmt,
clippy, build, test, schema, bundle, lifecycle) in 466 s. Test: 1748
passed. Lifecycle: 162 passed, the same count as the baseline list,
including all four `hcl_integration::scenarios_in_shard_*` tests.
- `cargo nextest run -p nemoclaw-e2e --test integration --test e2e
--profile ci`: 26 passed.
- `cargo run -p nemoclaw-build -- fern check`: 0 errors (Node 25.9.0
locally; CI uses 24.22.1).
- `git log --follow` works on moved files, for example
`tests/integration/tofu_test/mod.rs` (through #13849) and
`cases/docker-openclaw-nvidia.yaml` (through #13723).

`CI / Bundle` on `a98fc08603` passed every job:

- Lifecycle: 162 tests on linux_amd64, linux_arm64, and darwin_arm64
(two partitions of 81 each), and 138 on windows_amd64 (three partitions
of 46), which omits the Unix-only modules.
- `Live / Docker` ran the `e2e` binary's live-docker tests on
linux_amd64 and linux_arm64: 7 tests, then one in each of the three
gateway runs, all passed.
- `Live / Kind` ran the `e2e` binary's 7 live-kind tests on linux_amd64
and linux_arm64, all passed.

Merging `origin/v1` at `c17761c8fe` (merge commit `84cf54f5e9`) brought
in #14064 and #14080. Git applied #14064's change to
`tests/hcl_integration/fixtures.rs` through the rename, and the merged
`tests/integration/tofu_test/fixtures.rs` is identical to v1's file.
After the merge:

- The `nemoclaw-e2e` test lists for every profile are unchanged from
`a98fc08603`. The other changes, all from #14064, are in the provider
`contract` binaries: `lifecycle` now lists 123 tests.
- `cargo ci --base origin/v1` passed in 251 s: test 1748 passed,
lifecycle 123 passed.
- `CI / Bundle` on `84cf54f5e9` passed. The first `linux_amd64 / Live /
Kind` attempt ran all 7 tests and passed them, but took 304 s against
the 270 s budget in `.config/test-budgets.yaml`, so the job failed. Two
`kubernetes_live` tests took about 197 s each, against the 150 s
per-test limit. The rerun took 234 s and stayed within budget. The `e2e`
binary's code is the same as at `a98fc08603`, where this job took 231 s.

No live suite ran locally: Docker was not running.
After merge, dispatch `Live / HCL` (`hcl-e2e.yml`). It is manual-only,
and its executable name, case path, and OpenTofu directory changed.
cv pushed a commit that referenced this pull request Nov 3, 2026
## Failure

The v1 system tests repeated the same deployment flows in many Rust
scenarios. Graph outcomes such as registrations, bindings, policy, agent
configuration, isolation, and unchanged reconciliation were checked
through the SDK lifecycle, often with export, reapply, and destroy
repeated at the end of each test. Several assertions froze counts or
authored defaults that did not identify the behavior under test. The
`tofu test` integration layer from #13849 already compiled shared
documents against the same fixtures, but only covered eight documents
and could not apply examples or authored HCL.

Resolves #14060. Pull requests into `v1` don't close issues; close
#14060 after merge.

## Decision

Move graph outcomes into `tofu test` scenarios that reuse the existing
runner, fixtures, harness, and `observed` module, and keep Rust only for
what OpenTofu's test framework cannot observe.

**Runner and fixtures**

- A test file names the modules it applies: `./cases/<name>` (shared
catalog), `./examples/<path>` for an example document compiled
unchanged, or `./examples/<path>` for an authored HCL directory copied
with the bundle's NVIDIA provider versions pinned.
- Fixtures can declare the models the upstream lists, a sandbox creation
or deletion delay, and a one-time gateway change (stop one agent
runtime, change an agent's model inside its sandbox, or forget
registrations). Observations add gateway effects, the most sandboxes
created at once, and current sandbox IDs and registration names. The
teardown check names what remains.
- The harness adds `gateway_change`, `sandbox_create_delay_ms`, and
`baseline`, and outputs `gateway` and `baseline` so a later run can
compare with an earlier one.
- The runner now builds on every platform. Windows reaches the fixture
engine through the `ssh` relay that the lifecycle step puts on `PATH`,
and skips scenarios with a managed Docker gateway, recording them as
skipped in the CI summary.

**New scenarios**

| Scenario | Replaces | Owns |
|---|---|---|
| `kubernetes-external-three-agents`
(`examples/kubernetes/external-gateway.yaml` unchanged) |
`kubernetes_agents`, Fabric harness tests, stopped runtime, missing
registration, concurrent sandboxes, agent removal | Shared registration
and credential reference, per-agent configuration, concurrent creation,
unchanged apply with no gateway effects or agent starts, restart in the
same sandbox, re-registration without sandbox changes, one sandbox's
replacement leaving the others |
| `external-multiple-providers` (+ `-writer` case) |
`multiple_providers` | Provider union per sandbox, two deployments with
separate workspaces and owners, reapplying one after the other changes
nothing |
| `kubernetes-search-scopes` | Registration count in
`export_observations::mixed_search_export…` | One inference and one web
search registration per harness, each with the credential its
deployment, sandbox, or agent scope names; the unused integration is not
registered |
| `kubernetes-slow-sandbox-delete` |
`deployment::destroy_waits_for_graceful_sandbox_stop_without_retrying` |
A 31 s sandbox deletion is requested once, and the replacement follows |
| `travel` | `travel_example` | Authored example with Docker mocked:
readiness, registration, policy, agent configuration, unchanged apply |
| `travel-team` | `travel_team_example` | Per-role attachments, grants,
toolsets, and a hosted-model change replacing only the scheduler's and
buyer's sandboxes |

**Rust that remains** covers SDK and CLI behavior: CLI output, saved
state and intent, export, interrupted and cancelled operations, saved
plans, and provider errors, which `expect_failures` cannot expect. The
six export/reapply tests become one test that applies a document with
integrations, an authored inference API, native settings, grants,
exposures, and a tool limit, then checks each kind of observed drift
with one table. `remote_service` and `helm_recovery` stay as they were,
except two Ollama rows that repeat the vLLM storage and post-pull image
checks.

**Builds on #14088** (merged), which split `nemoclaw-e2e` into the
`integration` and `e2e` binaries. This PR then organizes
`crates/nemoclaw-e2e/tests/integration` by format:

```
tests/integration/
├── main.rs
├── hcl/              # tofu test scenarios: main.tf, harness/, modules/, tests/
├── tofu_test/        # their runner, the hcl_integration module
├── rust/    # Rust tests for what tofu test cannot express
│   ├── deployment.rs, export_observations.rs, fabric_deployment.rs
│   ├── multi_agent.rs, remote_service.rs
│   └── helm_recovery.rs, helm_recovery/
└── agent_compatibility.rs, docker_fixture.rs, fabric_bridge.rs,
    openshell_contract_fixtures.rs, tls.rs, web_search.rs   # offline checks, run with the unit tests
```

`main.rs` declares each `rust/` file with `#[path]`, so module and test
names do not change. Migrating the failure cases further is a later
step.

**Assertions removed or consolidated:** exact effect and change counts,
repeated export/reapply tails, the text row of the startup-failure test
(renderer tests own it), authored defaults such as `max_turns` and
temperature, the OpenShift duplicate of the Kubernetes example, and the
Service-host policy check that SDK `kubernetes_inference` tests cover.

**OpenTofu 1.12 limits found and documented** in
`docs/contributing/integration-tests.md`: assertions cannot reference
runs, only the latest applying run's outputs per module are kept,
cleanup silently skips the destroy when the last run's variables
reference a dropped run, and a JSON array never equals a list.

## Validation

- `cargo ci` (fmt, clippy, build, test, schema, bundle, lifecycle)
passed on darwin_arm64.
- `hcl_integration`: 14 scenarios pass in 4 shards. With the 31 s
deletion, the slowest local shard took 52 s; the others took 18 to 27 s.
- Retained Rust boundary tests in `deployment`, `export_observations`,
`fabric_deployment`, and `multi_agent`: 19 pass.
- Each new scenario detected a deliberate, reverted regression: a
timestamp-triggered replacement on unchanged apply, two deployments with
one owner, an extra researcher change during the hosted-model change, a
second replaced sandbox, and teardown without `destroy = true`.
`every_scenario_test_names_its_inputs` failed on a missing example.
- Same machine and bundle, `cargo ci lifecycle` on `24b35280fb` versus
this branch: 162 → 140 tests, 151.8 s → 112.7 s wall, 1204 s → 894 s
summed; the `nemoclaw-e2e` system tests went from 62 tests and 1046 s to
40 tests and 742 s. `hcl_integration` grew from 8 scenarios in 52 s to
12 in 67 s.
- Net: Rust −1813 lines, HCL +801, case YAML +102.
- `kubernetes-external-three-agents` also owns two checks moved out of
`export_observations`: no sandbox runs an inference or runtime probe,
and a model changed inside another sandbox is not drift.
- `kubernetes-search-scopes` detected a deliberate, reverted regression:
the Pi agent using the deployment's Tavily search instead of its own.
- After merging #14088 and moving the Rust tests to `rust/`: `cargo ci`
passed every step, including test (1748 tests), bundle, and lifecycle
(140 tests). After moving four more checks into HCL, `cargo ci
lifecycle` passed 139 tests. After merging `v1` with #14088 and #14064,
whose shared fixture state now holds declarations and observations,
`cargo ci` passed every step: 1748 tests, bundle, and lifecycle (100
tests; the slowest scenario shard took 47 s). The `integration` binary
lists 40 ignored tests: the 36 failure cases and the 4 scenario shards.

Deferred to CI: Linux and Windows lifecycle. The Windows path of the
runner is untested locally; no Windows target is installed here.

---------

Signed-off-by: San Dang <[email protected]>
@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: e2e End-to-end tests, nightly failures, or validation infrastructure area: providers Inference provider integrations and provider behavior area: security Security controls, permissions, secrets, or hardening chore Build, CI, dependency, or tooling maintenance integration: hermes Hermes integration behavior integration: openclaw OpenClaw integration behavior provider: anthropic Anthropic or Claude provider behavior provider: nvidia NVIDIA inference endpoint, NIM, or NVIDIA provider behavior provider: ollama Ollama local model provider behavior provider: vllm vLLM local or hosted provider behavior v1 NemoClaw v1 branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants