Skip to content

Commit c3b0417

Browse files
feat(runner): add the test runner, environments and the cpu-tests plan
`openshell-test` expands a plan (tests/plans/*.yaml) into one job per environment, builds the family's nextest archive for the guest, boots the environment through the tmachine Session API, runs nextest in it and brings back the JUnit report and logs. No per-suite Ansible playbook is involved. The runner points the tests at the system under test with environment variables: OPENSHELL_GATEWAY (the gateway the installer registered, from the environment's `gateway` field), OPENSHELL_BIN (the installed CLI) and OPENSHELL_TEST_CAPABILITIES (from the environment definition). Nextest runs with `--test-threads 1` and a slow-timeout that terminates a hung test. The JUnit report is checked against the catalog, so a missing or skipped expected test fails the job; `#[ignore]` tests are not expected and nextest's skipped case for them is accepted. `--strict` fails on an unsupported environment, an environment with nothing left to run, or an empty selection. `--emit-github-matrix` prints the GitHub Actions matrix for a plan, so the plan is the only list of what runs where. Environments are defined for amd64 and arm64 Ubuntu with Docker, k3s and Fedora Podman; tests/plans/cpu-tests.yaml selects only the amd64 Ubuntu rootful Docker + Debian package environment, the one CI can provision today. Most of this comes from #4629, adapted to testkit finding the gateway the way the CLI does instead of reading a target file. Co-authored-by: Evan Lezar <elezar@nvidia.com> Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
1 parent b587d66 commit c3b0417

19 files changed

Lines changed: 4777 additions & 0 deletions

‎tests/environments/docker.yaml‎

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
# Docker-backed environments, by Evan Lezar (NVIDIA/OpenShell#4629).
5+
#
6+
# The ID must equal <backend>.<os><version without dots>-<arch>.<runtime>.<installer>.
7+
# `tmachine` names the environment and installer in tests/tmachine/config.nix
8+
# that provision it. `gateway` is the name the installer registers the gateway
9+
# under with the CLI (`openshell gateway add --name`); the packaged installers
10+
# register `openshell`. `capabilities` is what the environment gives tests; see
11+
# tests/testkit/README.md.
12+
environments:
13+
- id: tmachine.ubuntu2404-amd64.docker-rootful.deb
14+
backend: tmachine
15+
machine: { os: ubuntu, version: "24.04", arch: amd64 }
16+
runtime: docker-rootful
17+
installer: deb
18+
tmachine: { environment: ubuntu-docker-rootful, installer: deb }
19+
gateway: openshell
20+
capabilities: { compute_driver: docker, rootless: false, gpu: false, persistent_workspace: true }
21+
- id: tmachine.ubuntu2404-arm64.docker-rootful.deb
22+
backend: tmachine
23+
machine: { os: ubuntu, version: "24.04", arch: arm64 }
24+
runtime: docker-rootful
25+
installer: deb
26+
tmachine: { environment: ubuntu-docker-rootful, installer: deb }
27+
gateway: openshell
28+
capabilities: { compute_driver: docker, rootless: false, gpu: false, persistent_workspace: true }

‎tests/environments/k3s.yaml‎

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
# Kubernetes (k3s) environments, by Evan Lezar (NVIDIA/OpenShell#4629). See
5+
# docker.yaml for the fields. The k3s installers register the gateway as
6+
# `tmachine`.
7+
environments:
8+
- id: tmachine.ubuntu2404-amd64.k3s.k3s
9+
backend: tmachine
10+
machine: { os: ubuntu, version: "24.04", arch: amd64 }
11+
runtime: k3s
12+
installer: k3s
13+
tmachine: { environment: ubuntu-k3s, installer: k3s }
14+
gateway: tmachine
15+
capabilities: { compute_driver: kubernetes, rootless: false, gpu: false, persistent_workspace: true }
16+
- id: tmachine.ubuntu2404-arm64.k3s.k3s
17+
backend: tmachine
18+
machine: { os: ubuntu, version: "24.04", arch: arm64 }
19+
runtime: k3s
20+
installer: k3s
21+
tmachine: { environment: ubuntu-k3s, installer: k3s }
22+
gateway: tmachine
23+
capabilities: { compute_driver: kubernetes, rootless: false, gpu: false, persistent_workspace: true }
24+
- id: tmachine.ubuntu2404-amd64.k3s.k3s-ha
25+
backend: tmachine
26+
machine: { os: ubuntu, version: "24.04", arch: amd64 }
27+
runtime: k3s
28+
installer: k3s-ha
29+
tmachine: { environment: ubuntu-k3s, installer: k3s-ha }
30+
gateway: tmachine
31+
capabilities: { compute_driver: kubernetes, rootless: false, gpu: false, persistent_workspace: true }
32+
- id: tmachine.ubuntu2404-arm64.k3s.k3s-ha
33+
backend: tmachine
34+
machine: { os: ubuntu, version: "24.04", arch: arm64 }
35+
runtime: k3s
36+
installer: k3s-ha
37+
tmachine: { environment: ubuntu-k3s, installer: k3s-ha }
38+
gateway: tmachine
39+
capabilities: { compute_driver: kubernetes, rootless: false, gpu: false, persistent_workspace: true }

‎tests/environments/podman.yaml‎

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
# Podman-backed environments, by Evan Lezar (NVIDIA/OpenShell#4629). See
5+
# docker.yaml for the fields.
6+
environments:
7+
- id: tmachine.fedora44-amd64.podman-rootful.rpm
8+
backend: tmachine
9+
machine: { os: fedora, version: "44", arch: amd64 }
10+
runtime: podman-rootful
11+
installer: rpm
12+
tmachine: { environment: fedora-podman-rootful, installer: rpm }
13+
gateway: openshell
14+
capabilities: { compute_driver: podman, rootless: false, gpu: false, persistent_workspace: true }
15+
- id: tmachine.fedora44-arm64.podman-rootful.rpm
16+
backend: tmachine
17+
machine: { os: fedora, version: "44", arch: arm64 }
18+
runtime: podman-rootful
19+
installer: rpm
20+
tmachine: { environment: fedora-podman-rootful, installer: rpm }
21+
gateway: openshell
22+
capabilities: { compute_driver: podman, rootless: false, gpu: false, persistent_workspace: true }
23+
- id: tmachine.fedora44-amd64.podman-rootless.rpm
24+
backend: tmachine
25+
machine: { os: fedora, version: "44", arch: amd64 }
26+
runtime: podman-rootless
27+
installer: rpm
28+
tmachine: { environment: fedora-podman-rootless, installer: rpm }
29+
gateway: openshell
30+
capabilities: { compute_driver: podman, rootless: true, gpu: false, persistent_workspace: true }
31+
- id: tmachine.fedora44-arm64.podman-rootless.rpm
32+
backend: tmachine
33+
machine: { os: fedora, version: "44", arch: arm64 }
34+
runtime: podman-rootless
35+
installer: rpm
36+
tmachine: { environment: fedora-podman-rootless, installer: rpm }
37+
gateway: openshell
38+
capabilities: { compute_driver: podman, rootless: true, gpu: false, persistent_workspace: true }

‎tests/plans/cpu-tests.yaml‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
# Tests that need no GPU. `type` names a family under tests/suites/ (a Cargo
5+
# workspace of testkit suites). Omit `suites` to run every suite in the family,
6+
# or list suite names (a suite is a file under <crate>/tests/) to run only
7+
# those. `environments` are IDs from tests/environments/.
8+
#
9+
# CI runs this plan from .github/workflows/e2e-suites.yml, one job per
10+
# environment listed here. To add coverage, add an environment to an entry or an
11+
# entry for another family; no workflow change is needed.
12+
#
13+
# Only amd64 environments are listed: Branch E2E has no arm64 runner with KVM
14+
# for tmachine yet. The arm64 environments in tests/environments/ are defined
15+
# so a plan can use them once one exists.
16+
matrix:
17+
- type: conformance
18+
environments:
19+
- tmachine.ubuntu2404-amd64.docker-rootful.deb

0 commit comments

Comments
 (0)