Repository navigation
test(e2e): add the destructive test family and move gateway-changing tests into it - #6252
Draft
matthewgrossman wants to merge 33 commits into
Draft
matthewgrossman wants to merge 33 commits into
matthewgrossman wants to merge 33 commits into
Conversation
…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>
…-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>
|
🌿 Preview your docs: https://nvidia-preview-pr-6252.docs.buildwithfern.com/openshell |
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add
tests/suites/destructive/, a testkit family for tests that change the gateway for every sandbox, and move the legacye2e/rusttests 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) unlessOPENSHELL_TEST_DISPOSABLE_GATEWAY=1, which every tmachine guest sets. Every destructive test calls it first and restores anything it changes withcx.on_cleanup.tests/support/kube(shared_supervisor,spire), using the environment's kubeconfig only.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.#[ignore]d. Its operator-workspace variant is dropped.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.kubernetes-ha-e2ejob. Thetest:e2e-kuberneteslabel no longer runs anything; the destructive rows run undertest:e2e.kubernetes_shared_supervisor_spiffe.rsstays until its identity half is ported (it shares the legacyshared_supervisormodule with test(e2e): port Kubernetes driver tests from e2e/rust to drivers/kubernetes #6215's scope).TESTING.mdsays when a test belongs in the destructive family;CI.mdpoints to it.CI rows (
e2e-suites.yml), each its own guest with"test_threads":1:deb(ubuntu-docker-rootful)global-settingsk3sglobal-settingsk3s-hakubernetes-hak3s-shared-supervisor-hakubernetes-shared-supervisork3s-shared-supervisor-scalingkubernetes-shared-supervisor-scalingk3s-spirekubernetes-spirek3s-warm-poolkubernetes-warm-poolk3s-warm-pool-shared-supervisorkubernetes-warm-poolThe legacy nextest profile gave
pool_sessions_follow_their_supervisors_gatewayandsupervisors_spread_evenly_across_gateways20 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 --lockedandcargo fmt --checkfortests/suites/destructive,tests/support,tests/suites/drivers/kubernetes; every commit buildscheck_cargo_lockfile_alignment.py,check-conformance-program.sh,nix-instantiate --parse tests/tmachine/config.nixChecklist