Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
7461c7a
ci: report where test time goes after each test step
cv Oct 9, 2026
087ffee
ci: read nextest JUnit reports with quick-junit
cv Oct 9, 2026
ca90e4a
Merge origin/v1 into test/layer-budgets
cv Oct 9, 2026
0d08c53
test(e2e): deploy each configuration variant once in deployment
cv Oct 9, 2026
ff263ff
test(e2e): check each redaction rule once through the CLI
cv Oct 9, 2026
fed2f35
test(e2e): keep each harness's remote service checks to what it owns
cv Oct 9, 2026
611c123
test(e2e): surface each gateway capability failure kind once through …
cv Oct 9, 2026
ce7b095
Merge remote-tracking branch 'origin/v1' into test/layer-budgets
cv Oct 9, 2026
f143611
test(e2e): run harness-independent Fabric checks for one harness
cv Oct 9, 2026
36eff22
build: optimize dependencies in development and test builds
cv Oct 9, 2026
18c44e5
perf(onboarding): resolve an unchanged journey once (#12901)
cv Oct 9, 2026
72e023e
test(e2e): plan each catalog response once in inference_discovery
cv Oct 9, 2026
e166a12
Merge remote-tracking branch 'origin/v1' into test/layer-budgets
cv Oct 9, 2026
feda361
test(sdk): export every example from the observations it compiles to
cv Oct 9, 2026
b8e0bab
test(e2e): keep one system lifecycle per drift kind
cv Oct 9, 2026
2577138
test: keep one system lifecycle per drift kind (#12906)
cv Oct 9, 2026
5983679
test(openshell): apply every example's OpenShell resources in contrac…
cv Oct 9, 2026
7326b64
Merge remote-tracking branch 'origin/test/layer-budgets' into test/op…
cv Oct 9, 2026
b96fce9
test(openshell): move OpenShell OpenTofu tests into the provider's co…
cv Oct 9, 2026
d85d417
Merge remote-tracking branch 'origin/v1' into test/layer-budgets
cv Oct 9, 2026
e392c74
Merge branch 'test/layer-budgets' into test/openshell-contract
cv Oct 9, 2026
21348fe
Merge branch 'v1' into test/layer-budgets
cv Oct 9, 2026
6826b53
Merge remote-tracking branch 'origin/v1' into test/layer-budgets
cv Oct 9, 2026
b5020c6
Merge branch 'test/layer-budgets' into test/openshell-contract
cv Oct 9, 2026
febbd38
test(fabric): run each Fabric type through OpenTofu in contract tests
cv Oct 9, 2026
29d86fc
Merge remote-tracking branch 'origin/v1' into test/openshell-contract
cv Oct 9, 2026
6cf929d
Merge branch 'test/openshell-contract' into test/fabric-contract
cv Oct 9, 2026
316ef97
Merge branch 'v1' into test/openshell-contract
cv Oct 9, 2026
665db38
test(provider): move single-type nemoclaw tests into the provider's c…
cv Oct 9, 2026
5a5a2e2
Merge branch 'v1' into test/openshell-contract
cv Oct 9, 2026
8fc53a9
Merge branch 'v1' into test/openshell-contract
cv Oct 9, 2026
0cf0db3
Merge branch 'test/openshell-contract' into test/fabric-contract
cv Oct 9, 2026
cb768cf
Merge branch 'test/fabric-contract' into test/nemoclaw-contract
cv Oct 9, 2026
5df2603
Merge remote-tracking branch 'origin/v1' into test/fabric-contract
cv Oct 9, 2026
aed231b
Merge branch 'test/fabric-contract' into test/nemoclaw-contract
cv Oct 9, 2026
0b54c49
test(fabric): build the capabilities contract test only on Unix
cv Oct 9, 2026
cfc7092
Merge branch 'test/fabric-contract' into test/nemoclaw-contract
cv Oct 9, 2026
e9ab6c1
Merge remote-tracking branch 'origin/v1' into test/nemoclaw-contract
cv Oct 10, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions .config/nextest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,13 @@ default-filter = '''
test(native_state_json_preserves_module_and_instance_identity_without_refresh)
| (package(nemoclaw-sdk) & test(/^deployment::runtime::helm_recovery::tests::/))
| (package(nemoclaw-sdk) & test(runtime_export_declares_the_native_helm_provider_inputs))
| (package(openshell-provider) & binary(=contract))
| (package(fabric-provider) & binary(=contract))
| ((package(nemoclaw-provider) | package(openshell-provider) | package(fabric-provider)) & binary(=contract))
| (package(nemoclaw-e2e) & binary(=integration) & (
test(/^provider_protocol::/) | test(/^service_capacity::/) | test(/^service_readiness::/)
| test(/^sandbox_readiness::/) | test(/^deployment::/)
| test(/^service_storage::/) | test(/^vllm_runtime::/)
| test(/^kubernetes_hcl::/) | test(/^runtime_image::/)
| test(/^export_observations::/) | test(/^fabric_deployment::/)
| test(/^multiple_providers::/) | test(/^remote_service::/)
| test(/^discovery::/) | test(/^inference_discovery::/) | test(/^gateway_readiness::/)
| test(/^inference_discovery::/)
))
'''

Expand Down
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 2 additions & 14 deletions crates/nemoclaw-e2e/tests/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ mod agent_compatibility;
mod cache_provider;
#[path = "deployment.rs"]
mod deployment;
#[path = "discovery.rs"]
mod discovery;
#[path = "docker_fixture.rs"]
mod docker_fixture;
#[path = "docker_provider_proxy.rs"]
Expand All @@ -21,16 +19,12 @@ mod export_observations;
mod fabric_deployment;
#[path = "fabric_live.rs"]
mod fabric_live;
#[path = "gateway_readiness.rs"]
mod gateway_readiness;
#[path = "health.rs"]
mod health;
#[path = "hosted_parity.rs"]
mod hosted_parity;
#[path = "inference_discovery.rs"]
mod inference_discovery;
#[path = "kubernetes_hcl.rs"]
mod kubernetes_hcl;
#[path = "managed.rs"]
mod managed;
#[path = "model_live.rs"]
Expand All @@ -46,26 +40,20 @@ mod provider_protocol;
#[path = "remote_service.rs"]
mod remote_service;
#[cfg(unix)]
#[path = "runtime_image.rs"]
mod runtime_image;
#[path = "sandbox_readiness.rs"]
mod sandbox_readiness;
// The fixture engine listens on a Unix socket.
#[cfg(unix)]
#[path = "service_capacity.rs"]
mod service_capacity;
#[path = "service_readiness.rs"]
mod service_readiness;
// The fixture engine listens on a Unix socket.
#[cfg(unix)]
#[path = "service_storage.rs"]
mod service_storage;
#[path = "spark.rs"]
mod spark;
#[path = "tls.rs"]
mod tls;
// The fixture engine listens on a Unix socket.
#[cfg(unix)]
#[path = "vllm_runtime.rs"]
mod vllm_runtime;
#[path = "web_search.rs"]
mod web_search;

Expand Down
5 changes: 5 additions & 0 deletions crates/nemoclaw-provider/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ autotests = false
name = "integration"
path = "tests/main.rs"

[[test]]
name = "contract"
path = "tests/contract/main.rs"

[dependencies]
nemoclaw-backend = { path = "../nemoclaw-backend" }
nemoclaw-tofu = { path = "../nemoclaw-tofu" }
Expand Down Expand Up @@ -49,6 +53,7 @@ rustix = { workspace = true, features = ["fs"] }

[dev-dependencies]
fabric-provider = { path = "../fabric-provider" }
nemoclaw-test-fixtures = { path = "../nemoclaw-test-fixtures" }
prost.workspace = true
tokio = { workspace = true, features = ["test-util"] }
tempfile.workspace = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// SPDX-License-Identifier: Apache-2.0
#![cfg(unix)]

use nemoclaw_e2e::http_fixture as transport;
use nemoclaw_e2e::tofu::TofuWorkspace;
use crate::http_fixture as transport;
use crate::tofu::TofuWorkspace;
use nemoclaw_sdk::fabric_catalog::{FabricCatalog, IMAGE_CATALOG_LABEL};
use serde_json::{Value, json};
use std::{
Expand Down Expand Up @@ -195,7 +195,7 @@ async fn compiled_discovery_requires_runtime_metadata_but_allows_unknown_capabil
);
assert!(tofu.is_absolute() && provider.is_absolute());
let document =
Document::parse(include_bytes!("../../../examples/onboarding/openclaw.yaml").as_slice())
Document::parse(include_bytes!("../../../../examples/onboarding/openclaw.yaml").as_slice())
.unwrap();
let image = document.spec.sandboxes[0].image.ref_.clone();
let mode = Arc::new(AtomicUsize::new(0));
Expand All @@ -210,7 +210,7 @@ async fn compiled_discovery_requires_runtime_metadata_but_allows_unknown_capabil
json!({"ID":"fixture", "Architecture":"arm64", "ServerVersion":"28.0", "OSType":"linux"})
} else {
assert!(request.path.starts_with("/images/") && request.path.ends_with("/json"));
let mut catalog=nemoclaw_e2e::image_runtime::catalog();
let mut catalog=crate::image_runtime::catalog();
match current.load(Ordering::SeqCst) {
1=>{
catalog.adapters.retain(|adapter|adapter.adapter_id()!="nvidia.fabric.openclaw");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0
#![cfg(unix)]

use nemoclaw_e2e::{http_fixture as docker, openshell::Fixture, tofu::TofuWorkspace};
use crate::{http_fixture as docker, openshell::Fixture, tofu::TofuWorkspace};
use serde_json::{Value, json};
use std::{
fs,
Expand Down Expand Up @@ -98,7 +98,7 @@ async fn managed_gateway_exit_preserves_bootstrap_state_and_allows_recovery_or_t
&["apply", "-auto-approve", "-input=false", "-no-color"],
true,
);
nemoclaw_e2e::assert_same_managed_resources(&fs::read(&state_path).unwrap(), &first);
crate::assert_same_managed_resources(&fs::read(&state_path).unwrap(), &first);
assert!(gateway.state.lock().unwrap().health_reads > 0);
assert!(gateway.state.lock().unwrap().gateway_reads > 0);
running.store(false, Ordering::SeqCst);
Expand All @@ -112,7 +112,7 @@ async fn managed_gateway_exit_preserves_bootstrap_state_and_allows_recovery_or_t
false,
);
assert!(started.elapsed() < Duration::from_secs(5));
nemoclaw_e2e::assert_same_managed_resources(&fs::read(&state_path).unwrap(), &first);
crate::assert_same_managed_resources(&fs::read(&state_path).unwrap(), &first);
graph.as_object_mut().unwrap().remove("data");
fs::write(root.join("main.tf.json"), graph.to_string()).unwrap();
run(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0
//! Managed Kubernetes resources written in HCL, planned without a cluster.

use nemoclaw_e2e::tofu::TofuWorkspace;
use crate::tofu::TofuWorkspace;
use serde_json::{Value, json};
use std::{fs, path::PathBuf};

Expand Down
114 changes: 114 additions & 0 deletions crates/nemoclaw-provider/tests/contract/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// SPDX-License-Identifier: Apache-2.0
//! Contract tests: each nemoclaw type through pinned OpenTofu against fake
//! Docker engines, gateways, and model servers. `every_type_has_a_contract_test`
//! requires one for every type the provider serves.

#[path = "../../../test-support/http.rs"]
mod http_fixture;
/// Fabric catalog fixtures shared with the end-to-end tests.
#[path = "../../../nemoclaw-e2e/src/image_runtime.rs"]
#[allow(dead_code)]
mod image_runtime;

mod discovery;
mod gateway_readiness;
mod kubernetes_hcl;
// Providers launched by OpenTofu reach these fake engines over a Unix socket;
// Windows needs the SSH relay beside them first (#12943).
#[cfg(unix)]
mod runtime_image;
#[cfg(unix)]
mod service_storage;
#[cfg(unix)]
mod vllm_runtime;

pub use nemoclaw_test_fixtures::{openshell, tofu};

/// Failed apply may record new data-source observations and condition
/// results; its managed resources and lineage must still be preserved.
pub fn assert_same_managed_resources(actual: &[u8], expected: &[u8]) {
fn managed(bytes: &[u8]) -> (String, Vec<serde_json::Value>) {
let state: serde_json::Value = serde_json::from_slice(bytes).unwrap();
let resources = state["resources"]
.as_array()
.unwrap()
.iter()
.filter(|resource| resource["mode"] == "managed")
.cloned()
.collect();
(state["lineage"].as_str().unwrap().into(), resources)
}
assert_eq!(managed(actual), managed(expected));
}

/// Types still tested only outside this binary, and why.
const ELSEWHERE: [(&str, &str); 5] = [
(
"gateway_storage",
"nemoclaw-e2e managed and the live Docker gateway tests, which need Docker (#12879)",
),
(
"managed_gateway",
"nemoclaw-e2e provider_protocol, which needs that crate's fixture provider (#12878)",
),
(
"service_capacity",
"nemoclaw-e2e service_capacity, which needs that crate's SSH fixture (#12878)",
),
(
"service_readiness",
"nemoclaw-e2e service_readiness, which needs that crate's SSH fixture (#12878)",
),
(
"inference_capabilities",
"nemoclaw-e2e inference_discovery, only through SDK deployments (#12879)",
),
];

/// Every resource and data source the provider serves appears in a contract
/// test, or in [`ELSEWHERE`] with the reason it is not here yet.
#[test]
fn every_type_has_a_contract_test() {
use tf_provider::Provider;
let provider = nemoclaw_provider::NemoClawProvider::default();
let mut diagnostics = tf_provider::Diagnostics::default();
let types: Vec<String> = provider
.get_resources(&mut diagnostics)
.unwrap()
.into_keys()
.chain(
provider
.get_data_sources(&mut diagnostics)
.unwrap()
.into_keys(),
)
.collect();
let sources = [
include_str!("discovery.rs"),
include_str!("gateway_readiness.rs"),
include_str!("kubernetes_hcl.rs"),
include_str!("runtime_image.rs"),
include_str!("service_storage.rs"),
include_str!("vllm_runtime.rs"),
]
.concat();
let missing: Vec<_> = types
.iter()
.filter(|kind| {
!sources.contains(&format!("nemoclaw_{kind}"))
&& !sources.contains(&format!("\"{kind}\""))
&& !ELSEWHERE.iter().any(|(elsewhere, _)| elsewhere == kind)
})
.collect();
for (kind, _) in ELSEWHERE {
assert!(
!sources.contains(&format!("nemoclaw_{kind}\"")),
"{kind} has a contract test; remove it from ELSEWHERE"
);
}
assert!(
missing.is_empty(),
"types without a contract test: {missing:?}"
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0
//! Authored runtime image checks through pinned OpenTofu.

use nemoclaw_e2e::{http_fixture::Fixture, tofu::TofuWorkspace};
use crate::{http_fixture::Fixture, tofu::TofuWorkspace};
use nemoclaw_sdk::managed::{RUNTIME_SPEC_VERSION, RUNTIME_SPEC_VERSION_LABEL};
use serde_json::{Value, json};
use std::{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0
//! Authored HCL for retained service storage through pinned OpenTofu.

use nemoclaw_e2e::{http_fixture::Fixture, tofu::TofuWorkspace};
use crate::{http_fixture::Fixture, tofu::TofuWorkspace};
use serde_json::{Value, json};
use std::{
collections::BTreeMap,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0
//! Authored HCL for a vLLM container whose runtime contract the provider computes.

use nemoclaw_e2e::http_fixture::Fixture;
use crate::http_fixture::Fixture;
use serde_json::{Value, json};
use std::{fs, path::PathBuf};

Expand Down
21 changes: 18 additions & 3 deletions docs/contributing/integration-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Tests install `terraform-provider-openshell` and `terraform-provider-fabric` fro
cargo build -p nemoclaw-provider -p openshell-provider -p fabric-provider
NEMOCLAW_TEST_TOFU=/absolute/path/to/tofu \
NEMOCLAW_TEST_PROVIDER=/absolute/path/to/terraform-provider-nemoclaw \
cargo test -p nemoclaw-e2e --test integration provider_protocol:: -- --ignored
cargo test -p nemoclaw-provider --test contract provider_protocol:: -- --ignored
```

These tests launch a fixture provider built by that crate and use temporary files.
Expand All @@ -30,7 +30,7 @@ On Unix, run from the repository root to test combined service capacity through
```sh
NEMOCLAW_TEST_TOFU=/absolute/path/to/tofu \
NEMOCLAW_TEST_PROVIDER=/absolute/path/to/terraform-provider-nemoclaw \
cargo test -p nemoclaw-e2e --test integration service_capacity:: -- --ignored
cargo test -p nemoclaw-provider --test contract service_capacity:: -- --ignored
```

This fixture checks shared-host overcommit, deferred reads, preserved state after failed observations, and cleanup without capacity checks.
Expand Down Expand Up @@ -74,6 +74,21 @@ The export fixture checks provider refresh failures through OpenTofu, unchanged
The web-search lifecycle case covers Brave and Tavily at deployment, sandbox, and agent scope, including profile and sandbox-grant drift.
The mixed-search export case checks shared registrations, unused definitions, export without search keys, unchanged reapply, and rejected provider-type or credential-reference drift without changes to saved state.

## NemoClaw Provider Contract

The `nemoclaw-provider` crate's `contract` tests run its types through OpenTofu against fake Docker engines, gateways, and model servers:

```sh
NEMOCLAW_TEST_TOFU=/absolute/path/to/tofu \
NEMOCLAW_TEST_PROVIDER=/absolute/path/to/terraform-provider-nemoclaw \
NEMOCLAW_TEST_BUNDLE=/absolute/path/to/bundle \
cargo test -p nemoclaw-provider --test contract -- --ignored
```

They cover service storage, Kubernetes planning, runtime images and runtime contracts, gateway readiness, and engine and hardware discovery.
`every_type_has_a_contract_test` requires a contract test for every type the provider serves.
Its `ELSEWHERE` list names the types still tested only in `nemoclaw-e2e` and why: the managed gateway, service capacity, and service readiness tests need that crate's fixture binaries, gateway storage needs Docker, and inference capabilities are read only through SDK deployments.

## OpenShell Provider Contract

The `openshell-provider` crate's `contract` tests apply each fixture in `crates/openshell-provider/tests/contract/fixtures` through OpenTofu against a fake OpenShell gateway from `nemoclaw-test-fixtures`.
Expand Down Expand Up @@ -127,7 +142,7 @@ On Unix, build the production provider as above and run from the repository root
```sh
NEMOCLAW_TEST_TOFU=/absolute/path/to/tofu \
NEMOCLAW_TEST_PROVIDER=/absolute/path/to/terraform-provider-nemoclaw \
cargo test -p nemoclaw-e2e --test integration service_readiness:: -- --ignored
cargo test -p nemoclaw-provider --test contract service_readiness:: -- --ignored
```

The fixture uses an isolated SSH/Docker simulator and a builtin OpenTofu consumer, without SDK deployment orchestration or a reachable OpenShell gateway.
Expand Down
2 changes: 1 addition & 1 deletion docs/design/fabric-management.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,5 +156,5 @@ The [image command suite](../../image/test_agent_contract.py) exercises the same
Its successful dummy health results do not qualify a real adapter’s native health or cleanup through OpenShell.
The existing installed Fabric fixture adapter remains authored and packaged in Fabric.
The separate dummy backend is authored in NemoClaw and exercises the image interface without Fabric.
The [discovery tests](../../crates/nemoclaw-e2e/tests/discovery.rs) read that installed discovery output and image metadata through the real OpenTofu/provider planner.
The [discovery tests](../../crates/nemoclaw-provider/tests/contract/discovery.rs) read that installed discovery output and image metadata through the real OpenTofu/provider planner.
[Bundle fixtures](../contributing/integration-tests.md#opentofu-and-bundle-lifecycle) separately exercise deployment recovery, export/reapply and ownership.