mirror of
https://github.com/NVIDIA/OpenShell.git
synced 2026-10-17 05:31:16 +08:00
* test(helm): Add kube gateway e2e tests Signed-off-by: Taylor Mutch <taylormutch@gmail.com> * ci(helm): add Branch Helm E2E workflow gated on test:e2e-helm Adds a label-gated GitHub Actions workflow that exercises the Helm chart end-to-end against the Rust e2e suite via `mise run e2e:helm`. Pipeline: - pr_metadata gates on the `test:e2e-helm` label via the pr-gate action. - build-gateway / build-supervisor build and push Docker images using the reusable docker-build.yml workflow. - helm-e2e (bare runner): apt-installs z3 build deps so cargo can compile the openshell-policy crate's z3-sys backend, creates a kind cluster via helm/kind-action, materializes the kind kubeconfig at the path mise's [env] block expects, side-loads the freshly built gateway/supervisor images, applies deploy/kube/manifests/agent-sandbox.yaml so the sandboxes.agents.x-k8s.io CRD and reconciling StatefulSet are in place, and finally runs `mise run e2e:helm`. Also expands the `e2e:helm` task to run the full Rust e2e suite (matching `e2e:podman`) instead of only the smoke test, with OPENSHELL_E2E_KUBE_TEST as an opt-in single-test override for local debugging. Extends the e2e-label-help workflow so applying `test:e2e-helm` posts the next-step hint pointing at this workflow. Signed-off-by: Taylor Mutch <taylormutch@gmail.com> * test(helm-e2e): run host-gateway tests on the kube driver Six tests previously skipped on the kubernetes driver — three in host_gateway_alias.rs plus the forward_proxy_l7 + graphql_l7 cases — relied on `host.openshell.internal` reaching either a host process or a sibling docker container. The Helm chart already supports this via `server.hostGatewayIP`, but the e2e wrapper never set it. - with-kube-gateway.sh: auto-detect the host-routable IP (CoreDNS `host.k3d.internal` first to handle Docker Desktop, docker network gateway as a fallback for kind on Linux CI) and pass it to helm install. Also import locally-built images into existing k3d clusters and wait for namespace deletion to complete before exit. - e2e/rust/Cargo.toml + e2e-helm.sh: add an `e2e-host-gateway` feature that gates the three test files; docker and podman runs imply it, helm runs opt in by default (overridable via OPENSHELL_E2E_HELM_FEATURES for remote clusters where the test host is unreachable from pods). - Drop the `skip_if_kube` helper and its callers — feature gating now decides whether the tests compile in. Verified against a local k3d cluster: all six previously-skipped tests pass, smoke regression intact. * refactor(e2e): rename e2e:helm to e2e:kubernetes The runner exercises the gateway on Kubernetes; helm is just the deployment mechanism. Names now describe the target environment. - mise task: `e2e:helm` -> `e2e:kubernetes` - script: e2e/rust/e2e-helm.sh -> e2e/rust/e2e-kubernetes.sh - env var: OPENSHELL_E2E_HELM_FEATURES -> OPENSHELL_E2E_KUBERNETES_FEATURES - workflow: branch-helm-e2e.yml -> branch-kubernetes-e2e.yml (display name "Branch Kubernetes E2E", job "kubernetes-e2e") - PR gate label: test:e2e-helm -> test:e2e-kubernetes (e2e-label-help hint workflow updated to match) PR #1251 needs the new label applied; the old label can be removed. * fix(e2e): prefer IPv4 host-gateway IP from dual-stack docker networks kind dual-stacks its network; the wrapper's awk picked the first non-empty gateway, which was the IPv6 entry (fc00:...). Sandbox pods can't reach the test host's IPv4 listener through that, so the L7 and host-gateway-alias tests failed in CI even though they passed locally against k3d (where host.k3d.internal in CoreDNS short-circuits the docker-network fallback). Restrict the awk filter to IPv4 octets. --------- Signed-off-by: Taylor Mutch <taylormutch@gmail.com>
78 lines
2.9 KiB
TOML
78 lines
2.9 KiB
TOML
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
# Test tasks (Rust + Python)
|
|
|
|
[test]
|
|
description = "Run all tests (Rust + Python)"
|
|
depends = ["test:rust", "test:python"]
|
|
|
|
[e2e]
|
|
description = "Run all end-to-end tests (Rust + Python)"
|
|
depends = ["e2e:rust", "e2e:python"]
|
|
|
|
["e2e:gpu"]
|
|
description = "Run Docker GPU end-to-end tests"
|
|
depends = ["e2e:docker:gpu"]
|
|
|
|
["e2e:k3s:gpu"]
|
|
description = "Run k3s GPU end-to-end tests"
|
|
depends = ["e2e:python:gpu"]
|
|
|
|
["test:rust"]
|
|
description = "Run Rust tests"
|
|
run = "cargo test --workspace"
|
|
hide = true
|
|
|
|
["test:python"]
|
|
description = "Run Python tests"
|
|
depends = ["python:proto"]
|
|
env = { UV_NO_SYNC = "1" }
|
|
run = "uv run pytest python/"
|
|
hide = true
|
|
|
|
["e2e:rust"]
|
|
description = "Run Rust CLI e2e tests against a Docker-backed gateway"
|
|
run = [
|
|
"cargo build -p openshell-cli --features openshell-core/dev-settings",
|
|
"e2e/with-docker-gateway.sh cargo test --manifest-path e2e/rust/Cargo.toml --features e2e-docker",
|
|
]
|
|
|
|
["e2e:python"]
|
|
description = "Run Python e2e tests against a Docker-backed gateway (E2E_PARALLEL=N or 'auto'; default 5)"
|
|
depends = ["python:proto"]
|
|
env = { UV_NO_SYNC = "1", PYTHONPATH = "python" }
|
|
run = "e2e/with-docker-gateway.sh uv run pytest -o python_files='test_*.py' -m 'not gpu' -n ${E2E_PARALLEL:-5} e2e/python"
|
|
|
|
["e2e:python:gpu"]
|
|
description = "Run Python GPU e2e tests"
|
|
depends = ["python:proto"]
|
|
env = { UV_NO_SYNC = "1", PYTHONPATH = "python", OPENSHELL_E2E_DOCKER_GPU = "1" }
|
|
run = "e2e/with-docker-gateway.sh uv run pytest -o python_files='test_*.py' -m gpu -n ${E2E_PARALLEL:-1} e2e/python"
|
|
|
|
["e2e:podman"]
|
|
description = "Run Rust CLI e2e tests against a Podman-backed gateway"
|
|
run = "e2e/rust/e2e-podman.sh"
|
|
|
|
["e2e:podman:gpu"]
|
|
description = "Run GPU e2e against a standalone gateway with the Podman compute driver"
|
|
env = { OPENSHELL_E2E_PODMAN_GPU = "1", OPENSHELL_E2E_PODMAN_TEST = "gpu_device_selection", OPENSHELL_E2E_PODMAN_FEATURES = "e2e-podman-gpu" }
|
|
run = "e2e/rust/e2e-podman.sh"
|
|
|
|
["e2e:kubernetes"]
|
|
description = "Run Rust CLI e2e tests against an OpenShell gateway deployed on Kubernetes via Helm (set OPENSHELL_E2E_KUBE_CONTEXT to reuse a cluster, otherwise creates a local k3d cluster; set OPENSHELL_E2E_KUBE_TEST=<name> to scope to one test)"
|
|
run = "e2e/rust/e2e-kubernetes.sh"
|
|
|
|
["e2e:vm"]
|
|
description = "Start openshell-gateway with the VM compute driver and run the cluster-agnostic smoke e2e"
|
|
run = "e2e/rust/e2e-vm.sh"
|
|
|
|
["e2e:docker"]
|
|
description = "Run smoke e2e against a standalone gateway with the Docker compute driver"
|
|
run = "e2e/rust/e2e-docker.sh"
|
|
|
|
["e2e:docker:gpu"]
|
|
description = "Run GPU e2e against a standalone gateway with the Docker compute driver"
|
|
env = { OPENSHELL_E2E_DOCKER_GPU = "1", OPENSHELL_E2E_DOCKER_TEST = "gpu_device_selection", OPENSHELL_E2E_DOCKER_FEATURES = "e2e-docker-gpu" }
|
|
run = "e2e/rust/e2e-docker.sh"
|