Skip to content

test(e2e): observe deployment state through export instead of intent.json - #13000

Merged
cv merged 2 commits into
v1from
test/stop-decoding-sdk-state
Oct 11, 2026
Merged

cv merged 2 commits into
v1from
test/stop-decoding-sdk-state

Conversation

@cv

@cv cv commented Oct 11, 2026 •

Copy link
Copy Markdown
Collaborator

Part of #12881.

Failure

Seven nemoclaw-e2e assertions decoded the SDK's private intent.json to read its pending, succeeded, runtimePending, destroyed, and document fields. docs/state.md calls these files implementation details, so an SDK change to the record breaks system tests that do not test the record.

Decision

Deployment::export and nemoclaw export refuse a deployment whose apply is unfinished or which was destroyed, before they observe anything. The tests ask export instead of reading the file. Where a later public assertion in the same test already shows the outcome, the decode is removed.

Removed assertion Test Now checked by
pending is true after a lost create reply deployment::interrupted_create_preserves_pending_targets_allows_unrelated_intent_and_recovers Export refuses: apply is unfinished; the test's next apply with changed configuration is still refused with unfinished creation requires its original resource configuration
pending is true and succeeded false after a readiness failure deployment::readiness_and_observation_failures_retain_bindings_and_recover_without_recreation Export refuses: apply is unfinished
pending is false and succeeded true after recovery Same test The recovery apply returns Ok; state::tests::recovery_checkpoints_survive_reload_and_reapply (unit) checks the record's transitions
The destroyed record keeps the applied document deployment::destroy_does_not_require_the_inference_credential_or_rewrite_its_reference Export refuses: cannot export a destroyed deployment, so the record survives destroy; state::tests::recovery_checkpoints_survive_reload_and_reapply checks that the document persists through destroy
succeeded is true after a healthy apply deployment::apply_health_failure_retains_resources_and_unchanged_apply_checks_again That apply returns Ok with allows_apply_completion() health, as the test already asserts
pending is false and succeeded false while health is read deployment::successful_apply_checkpoints_mutations_before_reading_health After the apply is cancelled during the health read, export succeeds and returns the document, so the mutation checkpoint came first. succeeded: state::tests::recovery_checkpoints_survive_reload_and_reapply (settled mutations do not imply healthy completion)
destroyed is true after a partial destroy remote_service::partial_runtime_destroy_retains_storage_without_creating_network and partial_ollama_destroy_retains_storage_without_creating_network nemoclaw export refuses: cannot export a destroyed deployment
runtimePending is true after a startup failure remote_service::remote_ollama_recovers_reapplies_and_stops_on_observation_failure_keeping_data and managed_bearer_credentials_survive_recovery_reapply_and_replacement_outside_state nemoclaw export refuses: apply is unfinished; the test's runtime-state and recovery assertions are unchanged

Tests that compare intent.json bytes before and after an operation still do; they check that a file is unchanged without decoding it.

Not changed: model_live decodes intent.json and recompiles the SDK's internal inference_service target to read its spec. That target is no longer an OpenTofu resource, so the test needs a rewrite that a live model run must validate.

Validation

On linux_arm64, against a bundle built from v1:

  • Seven of the nine affected tests passed: the five deployment tests, partial_runtime_destroy_retains_storage_without_creating_network, and remote_ollama_recovers_reapplies_and_stops_on_observation_failure_keeping_data. I did not run partial_ollama_destroy_retains_storage_without_creating_network or managed_bearer_credentials_survive_recovery_reapply_and_replacement_outside_state locally; they share the changed helpers, and the lifecycle step runs them.
  • With the apply's early checkpoint disabled in crates/nemoclaw-sdk/src/deployment/mod.rs, successful_apply_checkpoints_mutations_before_reading_health fails with Conflict("cannot export while apply is unfinished; ..."); restoring the checkpoint passes it.
  • cargo fmt --all --check and cargo clippy -p nemoclaw-e2e --all-targets -- -D warnings: clean.

cv added 2 commits October 11, 2026 05:56
…json

Seven assertions decoded the SDK's private intent.json; model_live also
recompiled the SDK's targets from it to read the compiled service spec.
Export refuses unfinished and destroyed deployments, so the tests now ask
it; model_live reads the applied spec from OpenTofu state.
The inference service is no longer a nemoclaw resource, so the state
lookup would not find it; model_live needs a live model run to rewrite.
@cv cv added area: e2e End-to-end tests, nightly failures, or validation infrastructure v1 NemoClaw v1 branch labels Oct 11, 2026
@github-actions

Copy link
Copy Markdown
Contributor

@cv
cv merged commit f4650bc into v1 Oct 11, 2026
@cv
cv deleted the test/stop-decoding-sdk-state branch October 11, 2026 19:37
cv added a commit that referenced this pull request Oct 11, 2026
Part of #12876: its last criterion, "the testing guide describes the
layers and budgets".

## Failure

`docs/contributing/testing.md` listed the step budgets but didn't
describe the unit, contract, system, and live layers, or which crates
and binaries belong to each. `docs/contributing/integration-tests.md`
had grown one fixture at a time, and some of its text no longer matched
the code:

- it named tests that no longer exist: `harness_codex`, the OpenClaw
interface lifecycle, and Hermes interface modes;
- it described ten Fabric harness tests, but `fabric_deployment` has two
(OpenClaw and Pi);
- its Docker tests are part of the `live-docker` suite, not the fixture
layers.

## Decision

- `testing.md` now has sections for the layers (what each checks, its
binaries, and what belongs there), how to run each layer with the one
`NEMOCLAW_TEST_BUNDLE` input, budgets and per-test limits (where each is
enforced and how to change one), timing reports, and how CI runs each
layer: jobs, partitions, archives, the Windows relay, and live suites on
pull requests. The dependency, image, schema, CLI, cache, and coverage
sections are unchanged.
- `integration-tests.md` now covers the contract and system layers: the
shared harness, each provider's contract binary by module, and the
system modules, built from the current test names.
- The four sections that need a real Docker engine move to
`live-tests.md` under a new Docker Live Suite section, next to the
Docker gateway tests already there. Their two inbound links are updated.
Other anchors are kept.
- After merging `v1` (#12995, #12996, #12998, #12999, #13000), the guide
describes what moved: the system layer's `nemoclaw-sdk` tests are now
only the Helm recovery tests, the OpenShell and Fabric backends'
fake-gateway tests (formerly `nemoclaw-e2e/tests/openshell.rs`) are
provider unit tests, the Kind suite runs `nemoclaw-e2e`'s
`kubernetes_live` and `kubernetes_chart`, and `Build live images` builds
the live images once and decides whether the live suites run.
- The `kubernetes_lifecycle` contract tests' `#[ignore]` reason named
`NEMOCLAW_TEST_TOFU` and `NEMOCLAW_TEST_PROVIDER`; it now names
`NEMOCLAW_TEST_BUNDLE`, which the tests read.
- Every statement was checked against `run_ci.rs`, `ci/timing.rs`,
`.config/`, the workflows, the `v1` ruleset, and the tests.

### Budget enforcement audit

Every budget in `.config/test-budgets.yaml` is enforced on the Linux
runners. In run
[38136353545](https://github.com/NVIDIA/NemoClaw/actions/runs/38136353545)
(linux_amd64), the `test`, `Lifecycle / 1`, `Live / Docker`, `Live /
Kind`, and `Lifecycle timing` logs each print their budget and "Within
budget." with no "reported only" note. The three binary budgets appear
in the `Lifecycle timing` table.

No budget is recorded but unenforced. These gaps remain:

- When `changes live` skips the live suites on a pull request, their
budgets aren't checked for that PR.
- The `test` wall budget covers the nextest run, not the doctests.
- `.config/test-budgets.yaml` isn't checked in the other direction. A
step key that names no step, or a binary budget whose binary has no
lifecycle tests (renamed, or every partition missing its report), passes
silently. `Lifecycle timing` names a partition with no report but
doesn't fail on it.

## Validation

- `cargo run --locked -p nemoclaw-build -- fern check`: 0 errors. Its
one warning is also on `v1`.
- `git diff --check`
- `cargo test -p nemoclaw-build --test integration ci::`: 15 passed.
- I ran the documented commands against a `linux_arm64` bundle:
- the nextest `lifecycle` command filtered to
`openshell-provider::contract` (44 passed);
  - `nemoclaw-sdk --lib -- --ignored helm_recovery` (5 passed);
  - `nemoclaw-e2e sandbox_readiness::` (1 passed);
  - `nemoclaw-provider --test contract service_readiness::` (2 passed);
  - `lifecycle-timing` on an empty directory.
- After the merge, against a rebuilt `linux_arm64` bundle: the same
commands again, plus `kubernetes_lifecycle::` (2 passed) and the
providers' `fake_gateway_tests` (3 and 9 passed); `cargo fmt --all
--check` and `cargo clippy --workspace --all-targets -- -D warnings`.
- No behavior changes: the only code change is an `#[ignore]` reason
string.
@wscurran wscurran added the chore Build, CI, dependency, or tooling maintenance label Oct 28, 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: e2e End-to-end tests, nightly failures, or validation infrastructure chore Build, CI, dependency, or tooling maintenance v1 NemoClaw v1 branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants