Repository navigation
test(e2e): port provider tests from e2e/rust to testkit - #5657
matthewgrossman wants to merge 15 commits into
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. |
|
/ok to test b70615f |
|
Label |
|
/ok to test c7af9e2 |
|
/ok to test b9d5b3e |
Signed-off-by: Matthew Grossman <[email protected]> #5657 makes the same install_provider change in that file along with its typed profile, so this branch leaves it unchanged to avoid a conflict.
Signed-off-by: Matthew Grossman <[email protected]> #5657 makes the same install_provider change in that file along with its typed profile, so this branch leaves it unchanged to avoid a conflict.
b9d5b3e to
b5ef866
Compare
|
/ok to test b5ef866 |
|
/ok to test d79cc8a |
…-openshell#5691) * test(testkit): add providers, run_python, last_json, policy readers and binaries_yaml Shared helpers for suites that run client scripts in a sandbox: attach providers from the sandbox builder, run a Python script and read its JSON result, read a sandbox's policy revisions and active policy, and write a binaries list into hand-written policy YAML. Signed-off-by: Matthew Grossman <[email protected]> * test(host-server): add TEST_HOST Signed-off-by: Matthew Grossman <[email protected]> * test(support): add sandbox-clients crate with connect and http probes A shared home for the clients tests run inside a sandbox. One probe script connects, optionally sends bytes, and reads until the connection ends; connect(), http() and http_raw() run it and return typed results. HTTP parsing happens in Rust and is unit-tested. Requests send Connection: close by default, and raw sends stop after two idle seconds, so a keep-alive server can't stall a read. Signed-off-by: Matthew Grossman <[email protected]> * test(features): use shared helpers in host-gateway The test uses TEST_HOST and the sandbox-clients http probe in place of its own Python client. Its main changes from sh -c "exec sleep infinity" to sleep infinity, which leaves the same final process. Signed-off-by: Matthew Grossman <[email protected]> * test(suites): drop ready_sandbox wrappers and unify long-running commands Tests create a long-running sandbox with the builder chain directly instead of a per-file ready_sandbox helper. The cli and policy-advisor mains change from sh -c "exec sleep infinity" to sleep infinity, which leaves the same final process. connect-ssh-supervision keeps its sh -lc mains. Signed-off-by: Matthew Grossman <[email protected]> * docs(testkit): list the shared sandbox helpers Signed-off-by: Matthew Grossman <[email protected]> * test(suites): use shared sandbox and provider helpers in cli, cdi and keycloak tests The cli tests read sandbox get JSON through Sandbox::get_json, the cdi scenario creates its sandbox with cli_sandbox, and the keycloak refresh test installs its provider with install_provider instead of importing the profile and creating the provider by hand. Signed-off-by: Matthew Grossman <[email protected]> * test: trim unit tests for the shared sandbox helpers The e2e suites exercise the helpers. Keep only the HTTP parser tests for chunked bodies and non-HTTP bytes, which no e2e test reaches yet. Signed-off-by: Matthew Grossman <[email protected]> * test(features): leave the keycloak refresh test to ai-openshell#5657 Signed-off-by: Matthew Grossman <[email protected]> ai-openshell#5657 makes the same install_provider change in that file along with its typed profile, so this branch leaves it unchanged to avoid a conflict. * test(testkit): fail early on sandbox names the gateway rejects The gateway limits sandbox names to 19 characters, which leaves 5 for a suffix after test-<run-id>-. cx.sandbox, cx.cli_sandbox and cx.track now panic at the test's call with that explanation, instead of the test failing later with the gateway's validation error. Context::name is unchanged, since provider and profile names have no such limit. Signed-off-by: Matthew Grossman <[email protected]> * docs(testkit): document how to write a sandbox client The testkit README now explains why clients run in the sandbox, the contract a client script follows, and when a script moves to sandbox-clients. tcp_probe.py points to it, sandbox-clients says it holds network clients only, TESTING.md points Rust tests to run_python, and run_python suggests python_image() when the sandbox has no python3. Signed-off-by: Matthew Grossman <[email protected]> * test(conformance): use the shared TEST_HOST in credential gating Signed-off-by: Matthew Grossman <[email protected]> * fix(support): report DNS failures from the connect probe as dns, not errno Signed-off-by: Matthew Grossman <[email protected]> * refactor(support): drop the unused is_dns_failure helper Signed-off-by: Matthew Grossman <[email protected]> * refactor(support): parse HTTP replies with httparse Signed-off-by: Matthew Grossman <[email protected]> * fix(support): report a stalled send from the connect probe as a timeout Signed-off-by: Matthew Grossman <[email protected]> * docs(testkit): link the sandbox client guide and the server name limit Signed-off-by: Matthew Grossman <[email protected]> --------- Signed-off-by: Matthew Grossman <[email protected]>
|
/ok to test f468936 |
Compatibility review (advisory)New or updated breaking changes; see the full report for all findings. 1. configuration — No explicit risk acceptance foundRelease images and built-in runtime image defaults move from ghcr.io/nvidia/openshell to quay.io/ai-openshell without continued GHCR release/latest publication.
2. cli — No explicit risk acceptance foundStable and prerelease workflows previously updated Snap Store channels, but publish-snap and publish-prerelease-snap now unconditionally skip.
3. rust-sdk — No explicit risk acceptance foundThe exhaustive raw::proto::ProviderCredentialRefreshStrategy enum gains GithubAppInstallation beyond its baseline seven variants.
4. api-behavior — No explicit risk acceptance foundGateway mutation OCSF status_detail changes from rejected:<code>/error:<code> to an optional three-part value such as rejected:aborted:RESOURCE_VERSION_CONFLICT.
Review details
Advisory review; publication gates are unchanged. |
e4fbd5f to
cdae827
Compare
cdae827 to
e93a7f8
Compare
Move provider_files and provider_auto_create from e2e/rust into a providers conformance suite. The auto-create test imports a run-unique profile instead of relying on a globally imported claude-code profile, so it no longer changes shared gateway state. Signed-off-by: Matthew Grossman <[email protected]>
Requests go to the gateway's endpoint with the service URL's host as the Host header, which is how the gateway routes service traffic. Over TLS the client trusts the gateway CA and presents the registered gateway's client certificate, through openshell-crypto's rustls configuration. Signed-off-by: Matthew Grossman <[email protected]>
… suite Signed-off-by: Matthew Grossman <[email protected]>
Signed-off-by: Matthew Grossman <[email protected]>
…mage Signed-off-by: Matthew Grossman <[email protected]>
Signed-off-by: Matthew Grossman <[email protected]>
Signed-off-by: Matthew Grossman <[email protected]>
…lder::providers Signed-off-by: Matthew Grossman <[email protected]>
Signed-off-by: Matthew Grossman <[email protected]>
Signed-off-by: Matthew Grossman <[email protected]>
…file Signed-off-by: Matthew Grossman <[email protected]>
Signed-off-by: Matthew Grossman <[email protected]>
…formance runs in parallel Importing any provider profile supersedes other sandboxes' in-flight provider update --wait (#5927), and other conformance tests import profiles at the same time. Signed-off-by: Matthew Grossman <[email protected]>
…g it for writing The probe wrote to a descriptor opened read-only, which fails even when the file is writable. Signed-off-by: Matthew Grossman <[email protected]>
…em roots A gateway endpoint over https without a registered mTLS bundle got an empty root store, so every service request failed its handshake and the test timed out. Trust the system roots, as the SDK does, and fail clearly when there are none. Signed-off-by: Matthew Grossman <[email protected]>
0bd16a4 to
590bccc
Compare
Summary
Port the provider tests from
e2e/rustto testkit and delete the legacy files. The provider files and auto-create tests join the conformance suite. The service bearer passthrough test moves to a newfeatures/service-exposuresuite.Related Issue
Closes #5656
Part of #5281
Found #5927
Stack
Based on
main, which has #5780's typedtestkit::Profile/Credentialbuilders andProviderBuilder::config. The provider files test attaches its provider with #5691'sSandboxBuilder::providers(..), and the auto-create sandbox runssleep infinity. The other #5691 helpers don't apply: the service-exposure server is the sandbox's main process, which sandbox-clients probes can't be, and no test runs Python scripts, names the host gateway, or writes policy YAML by hand.Changes
cx.service_get(url, headers)requests an exposed sandbox service through the gateway endpoint, with the service URL's authority asHost. It uses the gateway's mTLS bundle when the gateway has one, so tmachine environments need no extra routing. Anhttpsgateway without a registered bundle is verified against the system roots, as the SDK does.Profile::file(path, env_var, content)sets the profile'sfiles, with a unit test comparing it to the YAML it names. The rest of the profile builder andProviderBuilder::configcome frommain(test(testkit): share environment and provider helpers across E2E ports #5780);providers.rsuses them.providers.rsportsprovider_file_open_update_and_detachandauto_created_provider_credential_available_in_sandbox.service-exposurepackage withbearer_passthrough_preserves_authorization_header, plus rows in.github/workflows/e2e-suites.yml.provider_files.rs,provider_auto_create.rs,service_bearer_passthrough.rs, their[[test]]entries, theprovider_auto_createentry intests/tmachine/artifacts.nix, and the now-unusedrustlsandtokio-rustlse2e dependencies.Differences from the legacy tests
provider_filesran on Docker only, and tmachine lanes skippedprovider_auto_create. Service exposure runs on deb docker and rpm podman (rootful and rootless). Legacy ran it on Docker only. It doesn't run on k3s: since feat(helm)!: require opt-in for gateway service routing #5672 the Helm chart turns gateway service routing off, and tmachine's k3s installers can't turn it back on. The test passed on k3s and k3s-ha before feat(helm)!: require opt-in for gateway service routing #5672.providers/*.yamlglobally and usedclaude-code. The port imports its own run-unique profile and passes the credential through the CLI environment. That removes the global import that deferred this move in test(conformance): migrate workspace, upload, and template e2e tests #4246.examples/provider-managed-files/acme-config.yaml; the port builds the sameclient.tomlfile withtestkit::Profile, so the conformance suite doesn't depend on the examples folder. It keeps the legacy path,/run/openshell/providers/<provider>/client.toml, and every assertion.provider update --waitreportsuperseded, even though the update still applies. Other conformance tests import profiles at the same time.tests/suites/unsupported.yamllists it for every conformance row and the docker, podman and kubernetes lanes. It still runs on the vm lane, which uses one worker. Delete the entry when bug: importing any provider profile supersedes other sandboxes' provider --wait #5927 is fixed.cx.name, which is unique per test. They pass the credential only to the CLI process they run, not through the test process's environment, and use no fixed ports.Testing
cargo fmt --checkand lockedcargo clippy -D warningsfor testkit, conformance, features, support, Podman drivers, continuity, ande2e/rust; both lockfile checks; the conformance program checkservicetestsfeatures/service-exposurerows, all threefeatures/keycloak-provider-refreshrows, and the legacy lanes pass onmainin Branch E2E Checks.main, against one Docker gateway: providers and credential-gating conformance (11 passed), andservice-exposure. Earlier, on the test(testkit): share environment and provider helpers across E2E ports #5780 stack: the same conformance tests with 4 workers and the unsupported entry set.Checklist