Skip to content

test(e2e): add the destructive test family and move gateway-changing tests into it - #6252

Draft
matthewgrossman wants to merge 33 commits into
mainfrom
test/5527-destructive-suite/matthewgrossman
Draft

matthewgrossman wants to merge 33 commits into
mainfrom
test/5527-destructive-suite/matthewgrossman

Conversation

@matthewgrossman

Copy link
Copy Markdown
Member

Summary

Add tests/suites/destructive/, a testkit family for tests that change the gateway for every sandbox, and move the legacy e2e/rust tests that do so into it: global settings, Kubernetes HA, shared-supervisor HA and scaling, warm pool, and the SPIRE Broker half of the SPIFFE test.

Stacked on #6215. Until that merges, the diff here includes its commits.

Related Issue

Closes #5527
Part of #5297

Changes

  • testkit::require_disposable_gateway() fails (never skips) unless OPENSHELL_TEST_DISPOSABLE_GATEWAY=1, which every tmachine guest sets. Every destructive test calls it first and restores anything it changes with cx.on_cleanup.
  • Shared supervisor and SPIRE helpers in tests/support/kube (shared_supervisor, spire), using the environment's kubeconfig only.
  • New tmachine installers: k3s-shared-supervisor-ha, k3s-shared-supervisor-scaling, k3s-warm-pool, k3s-warm-pool-shared-supervisor, k3s-spire, k3s-spire-node-local, plus a SPIRE fixture playbook.
  • The warm pool test is no longer #[ignore]d. Its operator-workspace variant is dropped.
  • The SPIRE package runs on one node, so kubernetes-spire-node-local (gateway relocation across nodes) has no CI row yet: test(tmachine): add a multi-node k3s environment for node-local SPIRE Broker coverage #6249.
  • Removes the ported legacy tests, their Cargo features, mise tasks and nextest groups, and the kubernetes-ha-e2e job. The test:e2e-kubernetes label no longer runs anything; the destructive rows run under test:e2e.
  • kubernetes_shared_supervisor_spiffe.rs stays until its identity half is ported (it shares the legacy shared_supervisor module with test(e2e): port Kubernetes driver tests from e2e/rust to drivers/kubernetes #6215's scope).
  • TESTING.md says when a test belongs in the destructive family; CI.md points to it.

CI rows (e2e-suites.yml), each its own guest with "test_threads":1:

Installer Package
deb (ubuntu-docker-rootful) global-settings
k3s global-settings
k3s-ha kubernetes-ha
k3s-shared-supervisor-ha kubernetes-shared-supervisor
k3s-shared-supervisor-scaling kubernetes-shared-supervisor-scaling
k3s-spire kubernetes-spire
k3s-warm-pool kubernetes-warm-pool
k3s-warm-pool-shared-supervisor kubernetes-warm-pool

The legacy nextest profile gave pool_sessions_follow_their_supervisors_gateway and supervisors_spread_evenly_across_gateways 20 minutes; the runner's default per-test limit is 15. If they time out, they need the per-row timeout from #6217.

Testing

  • cargo clippy --all-targets --locked and cargo fmt --check for tests/suites/destructive, tests/support, tests/suites/drivers/kubernetes; every commit builds
  • check_cargo_lockfile_alignment.py, check-conformance-program.sh, nix-instantiate --parse tests/tmachine/config.nix
  • E2E rows in CI
  • E2E tests added/updated

Checklist

  • Follows Conventional Commits
  • Commits are signed off (DCO)

…cile test

Add tests/suites/drivers/kubernetes and tests/support/kube, a Rust kube
client built only from OPENSHELL_TEST_KUBECONFIG and the release namespace.
The k3s and k3s-ha installers publish both, and CI runs the suite on them.

Port start_refreshes_stale_bootstrap_image from e2e/rust and drop
old_and_new_gateways_can_restart_the_same_sandbox, which no lane ran.

Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
Build every k3s installer with a k3sInstaller helper: fixture playbooks
that stage what the gateway depends on (PostgreSQL, an image pull
Secret, OpenBao, the workspace chart), Helm values files applied in
order, optional mTLS, and variables published to tests. k3s-ha becomes
the postgres fixture, an HA values file and mTLS.

Add installers for managed and operator workspace modes and for the
Kubernetes Secrets and Vault credential drivers.

Stage the Agent Sandbox manifest, the OpenBao chart and the images of
everything installers deploy in the cached ubuntu-k3s setup layer, so
installer layers need no network. Move the PostgreSQL and OpenBao
fixtures to tests/support/kube/fixtures and package the
openshell-workspace chart with the Helm artifacts.

Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
Split the Kubernetes driver suite into packages, one per way of
installing the chart: runtime (reconcile), workspace-managed,
workspace-operator and credential-drivers. Each runs in its own
ubuntu-k3s CI row on the matching installer.

Port workspace_namespace_managed, workspace_namespace_operator and
credential_drivers from e2e/rust, reading cluster state through the kube
API instead of kubectl. Merge the managed namespace lifecycle tests into
one, drop the v1alpha1-only stop test, and move the DNS-1123 sandbox name
check to conformance, since the gateway validates names for every
driver. The credential test checks only the backend object; conformance
covers placeholders.

Remove the legacy tests, their mise tasks and their branch-e2e jobs.

Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
Workspace now holds handles scoped to its name and offers sandbox(),
cli_sandbox(), sandboxes() and delete() instead of the raw SDK client and
CLI. Sandbox cleanup is keyed by workspace and name, so sandboxes in
different workspaces may share a name. The Kubernetes workspace suites
use the builder and Sandbox::delete instead of their own create, exec
and delete helpers.

Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
…allers

The legacy Kubernetes lanes ran conformance in managed workspace mode and
on each credential backend; keep that coverage on the k3s rows.

Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
…rapper

Nothing sets OPENSHELL_E2E_CREDENTIAL_DRIVERS since the credential
backend tests moved to the k3s installers. The OpenBao fixture values
now carry the dev-mode and injector settings instead of each Helm call.

Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
The installer records the gateway endpoint once, so registering the
client no longer re-derives whether the gateway serves TLS.

Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
Discover the Sandbox resource once per Cluster, take an object name
explicitly in gateway_can, fail replace_sandbox_object on an object
without a namespace, and add get_in for objects a test requires.

Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
…ests

Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
Pod exec needs kube's ws feature, which pulls a tungstenite release the
root lockfile does not carry. Reading the KV API through the pod proxy
keeps the test dependencies aligned with the workspace.

Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
Helm can return before the StatefulSet creates openbao-0, and kubectl
wait fails at once on a missing pod.

Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
The gateway no longer ships an openai profile. Also match the newline
echo prints in the operator namespace test.

Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
Tests boot the disk cached after setup, which restarted the development
server with no data and a new CA. Run a standalone server that stores
its data on the node, unseals with a static key, and serves a
certificate the installer generates. The runner waits for it after boot,
since the gateway reaches it only on demand.

Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
kube parses any JSON error body as a Kubernetes Status, so an OpenBao
error surfaced as an empty ApiError with code 0. Read the response
status and body directly.

Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
Support crates can keep an error's source chain for client errors that
testkit has no From conversion for.

Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
Look for the credential's unique value among the entries the driver
manages instead of recomputing the driver's storage name, which drops
the provider list lookup. Move the OpenBao pod-proxy read into the
credential suite, its only user, and keep Kubernetes client errors'
source chains in kube-support.

Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
…t dependencies

Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
Name the mount and the credential prefix separately and build the data
and metadata paths from them, instead of rewriting one into the other.

Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
…test

Destructive tests change the gateway for every sandbox on it. Each one first
calls testkit::require_disposable_gateway(), which fails unless
OPENSHELL_TEST_DISPOSABLE_GATEWAY=1. Every tmachine guest publishes it.

Move the global settings override test from e2e/rust into the new
tests/suites/destructive/global-settings package. It deletes the global value
in a cleanup hook, so conformance still starts with it unset. Each destructive
package runs in its own CI row, one test at a time.

Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
…rate

Port the shared supervisor pool helpers and their unit tests from
e2e/rust/tests/shared_supervisor to tests/support/kube, reading the
cluster through the kube client. The k3s installers stage a
kill-container disruption and publish it as OPENSHELL_TEST_KILL_CONTAINER
so tests can SIGKILL a supervisor without docker exec.

Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
…ctive suite

Port kubernetes_ha_rebalancing to tests/suites/destructive/kubernetes-ha.
The tests scale the gateway Deployment and delete its Pods through the
kube client and reach each replica through a local forward to its Pod IP.
They run on the k3s-ha installer, which publishes its replica count as
OPENSHELL_TEST_GATEWAY_REPLICAS. The file sync payload shrinks to 8 MiB.

Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
…ive suite

Port kubernetes_shared_supervisor_ha to
tests/suites/destructive/kubernetes-shared-supervisor. The tests kill
supervisors through the kill-container disruption, restart Deployments
and read the pool's records through the kube client and the gateway's
database, and run on a new k3s-shared-supervisor-ha installer: a
two-member pool behind the three-replica HA gateway. kube-support gains
the gateway replica count and Deployment restart and rollout helpers.

Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
…ructive suite

Port kubernetes_shared_supervisor_scaling to
tests/suites/destructive/kubernetes-shared-supervisor-scaling. It runs on
a new k3s-shared-supervisor-scaling installer that starts a one-member
pool, scales it with helm upgrade of the installed chart, which the k3s
playbook now publishes as OPENSHELL_TEST_KUBE_CHART, and scales back to
one member in cleanup.

Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
Port kubernetes_warm_pool to tests/suites/destructive/kubernetes-warm-pool
and run it, no longer ignored, on new k3s-warm-pool and
k3s-warm-pool-shared-supervisor installers for dedicated and shared
supervisors. Its values move to deploy/helm/openshell/ci. kube-support
gains a gateway restart for either workload kind, every gateway log
line, and an all-namespaces Sandbox API. The operator-managed workspace
variant, which installed the workspace chart from the source tree, is
not ported.

Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
Add a k3s-spire fixture that installs SPIRE in the guest, a spire module in kube-support shared with the identity tests, and two destructive packages: kubernetes-spire (every Broker agent, supervisor failover fencing) and kubernetes-spire-node-local, which needs two nodes and has no CI row yet.

Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
Delete the HA rebalancing, shared supervisor HA and scaling, and warm pool tests from e2e/rust with their features, mise tasks, and nextest groups. Retire the kubernetes-ha-e2e job and the test:e2e-kubernetes label wiring; the destructive rows run under test:e2e. The SPIFFE test stays until its identity half is ported.

Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
@matthewgrossman matthewgrossman added the area:build CI/CD workflows, releases, build targets, packaging, and artifact publication. label Dec 4, 2026
@matthewgrossman matthewgrossman added topic:testing Unit, integration, regression, conformance, E2E tests, coverage, flakes, and test infrastructure. topic:kubernetes Kubernetes operators, CRDs, deployment controllers, and native Kubernetes API integration. labels Dec 4, 2026
@github-actions github-actions Bot added the state:accepted A maintainer decided OpenShell should pursue this issue label Dec 4, 2026
@matthewgrossman matthewgrossman added the test:e2e Requires end-to-end coverage label Dec 4, 2026
…-suite/matthewgrossman

Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>

# Conflicts:
#	.github/workflows/branch-e2e.yml
… table

Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
@github-actions

github-actions Bot commented Dec 4, 2026

Copy link
Copy Markdown

…imit

Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
Print elapsed time after each step of the HA, shared supervisor, and warm pool tests so CI logs show where their time goes. When the warm pool's prepared supervisor dies during the gateway restart, include the gateway's log lines about it.

Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:build CI/CD workflows, releases, build targets, packaging, and artifact publication. state:accepted A maintainer decided OpenShell should pursue this issue test:e2e Requires end-to-end coverage topic:kubernetes Kubernetes operators, CRDs, deployment controllers, and native Kubernetes API integration. topic:testing Unit, integration, regression, conformance, E2E tests, coverage, flakes, and test infrastructure.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(testkit): separate destructive tests from non-destructive ones

1 participant