Repository navigation
test: cover middleware effects and export - #14441
Conversation
|
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. |
Authoring session — openingAuthoring cutoff: 2026-11-12 20:20:41 UTC. Scope: this test implementation through commit
Local validation at opening:
The mandatory merge gate in the PR description remains outstanding. Testing Fabric's open PR head will not replace qualification after Fabric merges and V1 updates its pin. |
Local validation — Fabric PR #627 headBoth requested test extensions passed on Linux ARM64 with a temporary, unpublished override of Fabric PR #627. This does not satisfy the merge gate: keep this PR draft and unmerged until #627 lands, V1's pin includes it, and this PR is requalified against that V1 pin. Test commit: The disposable validation tree changed the Fabric source archive/checksum, regenerated its adapter catalog, and updated all three Rust Observed results:
Artifact SHA-256 identities:
|
…ry-tests Signed-off-by: Carlos Villela <[email protected]> # Conflicts: # crates/nemoclaw-e2e/tests/e2e/hcl_live.rs # crates/nemoclaw-e2e/tests/integration/rust/deployment.rs
- The case's fixture writes its request counts to the run's reports, so the docker-dummy run that sends the requests asserts on them directly; the middleware module and its observation probe go. - One sandbox command sends the three requests. - Drop the unchanged reapply and sandbox identity check: the case's unchanged plan already shows no changes. - Bind the middleware ports and addresses inside dummy_case, before the UID and digest. - The export journey's middleware policy keeps only the fields the binding needs. - Document the middleware checks in the live test guide. Signed-off-by: Carlos Villela <[email protected]>
|
/ok to test b033521 |
The dummy case binding ran docker network inspect, so its unit test failed on hosts without Docker, such as the macOS runner. prepare reads the address and passes it in, and the test checks that the binding selects both recorder addresses. Signed-off-by: Carlos Villela <[email protected]>
) The `docker-dummy` live case now checks that a `fail_closed` middleware binding blocks a sandbox request when the middleware service fails. ## Problem Part of #14338. #14343 let explicit sandbox policies carry OpenShell middleware bindings, and #14441 made the `docker-dummy` live case check allow, deny and excluded-destination effects. Nothing in a live run made the middleware service fail, so the issue's last live criterion, that the configured failure behavior applies when the service fails, was untested. The case's binding sets `on_error: fail_closed`, so a broken guard should stop traffic, not let it through. If OpenShell let the request through or NemoClaw dropped the setting, no test would notice. ## Change - The live guard in `nemoclaw-test-fixtures` answers a request to `/fail` with a service error, after recording it as it does for every request. - The `middleware` run block in `docker-dummy.tftest.hcl` sends a fourth request, to `/fail`, last, so no later request depends on how the supervisor treats a failed service. It must return 403. - The run block checks three effects. The allow and deny counts stay exact. The middleware must be called at least once for `/fail`; the count is a floor because OpenShell may call a failing service more than once. The recorder must still see only `/allow` and `/bypass`, so neither the denied nor the failed request arrives. - The case document and the live test guide describe the new request. - Left out on purpose: a `fail_open` run. It needs a second binding on a different destination, and the case has only the two addresses it already uses. The provider's unit tests already treat a change of `on_error` to `fail_open` as drift. - Left out for this change: the export and reapply of the binding on the live deployment. The export/reapply integration journey from #14441 covers it on its own deployment, and this case's unchanged plan covers unchanged reconciliation. This PR leaves #14338 open for a maintainer to decide whether those two meet the issue's last live criterion. ## Beyond CI I did not run `cargo ci live-docker`: this environment has no reachable Docker daemon and cannot fetch the OpenShell dependencies, so the Rust crate was not built here either. What I ran: `rustfmt --check` on the changed Rust file, `tofu fmt -check` on the test file, and the new HCL conditions evaluated with OpenTofu against a sample effects file. Per OpenShell's source at the pinned revision, a failed fail-closed middleware gets the same 403 as a denial, so the new `/fail` assertions rest on that reading until the live Docker lane runs them. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **Documentation** * Clarified that requests are blocked when middleware encounters an error and the binding is configured to fail closed. * Updated the live-test guidance to describe this scenario and its expected response. * **Tests** * Expanded the Docker dummy scenario to cover middleware errors, verify the expected 403 response, and confirm the request does not reach the destination. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Signed-off-by: Deepak Jain <[email protected]>
Extend NemoClaw's tests to observe middleware request effects in the
docker-dummylive lifecycle and to keep an authored middleware binding through bundled CLI export and SDK reapply.Problem
Existing middleware tests check configuration projection and document compilation. They do not observe middleware interception and destination effects in the live Docker lifecycle. The bundled CLI export/reapply journey has no authored middleware binding.
Change
docker-dummy's gateway registers an external gRPC middleware thathcl_live::caseserves on the host, beside an HTTP effect recorder; both write the requests they see tomiddleware-effects.jsonin the run's reports. One sandbox command sends three requests, and the same run block asserts on the counts:cargo ci live-dockerbinds the middleware and recorder ports and the two addresses to each run.Beyond CI
cargo ci live-dockerpassed on linux/arm64 against v1's Fabric pin,b4725580(NVIDIA/NeMo-Fabric#632's head, which includes NVIDIA/NeMo-Fabric#627). With the destination expectation deliberately changed to include/deny, themiddlewarerun block failed and reported{"destination":{"/allow":1,"/bypass":1},"middleware":{"/allow":1,"/deny":1}}.