Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/branch-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ jobs:
CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}

# Run the testkit feature suites (tests/suites/features) on tmachine. The
# environments and suites are listed in e2e-suites.yml.
# environments and suites are listed in tests/suites/ci-matrix.yaml.
feature-specific-integration:
needs: [prepare-integration, build-e2e-bundles]
permissions:
Expand All @@ -482,7 +482,7 @@ jobs:
CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}

# Run the testkit driver suites (tests/suites/drivers) on tmachine. The
# environments and suites are listed in e2e-suites.yml.
# environments and suites are listed in tests/suites/ci-matrix.yaml.
driver-specific-integration:
needs: [prepare-integration, build-e2e-bundles]
permissions:
Expand Down
91 changes: 25 additions & 66 deletions .github/workflows/e2e-suites.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

# Runs testkit suites in tmachine environments on CI. Each row of `ROWS` below
# Runs testkit suites in tmachine environments on CI. Each row, from
# tests/suites/ci-matrix.yaml (expanded by tasks/scripts/e2e_suite_rows.py),
# names a tmachine environment and installer, the family (the path of a
# workspace under tests/suites/, such as conformance or drivers/podman) and,
# optionally, the package in it, the gateway name the installer registers, and
# the runner label for the environment's architecture. `openshell-test-runner`
# optionally, the package in it and the gateway name the installer registers.
# A row without a package runs every package in the workspace; each driver
# suite is a workspace of its own. `openshell-test-runner`
# builds the tests, boots the environment, runs them inside it and checks the
# results. With `prebuilt`, the rows run what the caller built once for the
# run instead: conformance rows the static `openshell-conformance`, the other
Expand Down Expand Up @@ -68,8 +70,8 @@ concurrency:
cancel-in-progress: ${{ inputs['cancel-in-progress'] }}

jobs:
# The rows live here, in one place. Add an environment or a suite by adding a
# row; the runner needs no list of its own.
# The rows come from tests/suites/ci-matrix.yaml. Add an environment or a
# suite there; the runner needs no list of its own.
select:
name: Select E2E suites
runs-on: ubuntu-24.04
Expand All @@ -78,6 +80,17 @@ jobs:
matrix: ${{ steps.rows.outputs.matrix }}
upgrade_source_tag: ${{ steps.baseline.outputs.tag }}
steps:
# The matrix of the revision under test, which the suites job runs.
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ inputs['source-sha'] }}
persist-credentials: false

- uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
with:
version: "0.10.12"
python-version: "3.13"

- name: Select the rows to run
id: rows
env:
Expand All @@ -86,71 +99,17 @@ jobs:
UPGRADE_SOURCE: ${{ inputs.upgrade-source }}
run: |
set -euo pipefail
# Only amd64 for now: CI has no arm64 runner with KVM for tmachine,
# and the caller only builds amd64 inputs. The gateway is the name the
# installer registers with the CLI: `openshell` for the packages,
# `tmachine` for the k3s and binaries installers. A row without a
# package runs every package in the workspace; each driver suite is a
# workspace of its own.
rows='[
{"environment":"ubuntu-docker-rootful","installer":"deb","family":"conformance","package":"conformance","gateway":"openshell","runner":"ubuntu-24.04","test_threads":4},
{"environment":"ubuntu-docker-rootful","installer":"deb-external-docker-driver","family":"conformance","package":"conformance","gateway":"openshell","runner":"ubuntu-24.04","external_driver":true,"test_threads":4},
{"environment":"fedora-podman-rootful","installer":"rpm","family":"conformance","package":"conformance","gateway":"openshell","runner":"ubuntu-24.04","test_threads":4},
{"environment":"fedora-podman-rootless","installer":"rpm","family":"conformance","package":"conformance","gateway":"openshell","runner":"ubuntu-24.04","test_threads":4},
{"environment":"ubuntu-k3s","installer":"k3s","family":"conformance","package":"conformance","gateway":"tmachine","runner":"ubuntu-24.04","test_threads":4},
{"environment":"ubuntu-k3s","installer":"k3s-ha","family":"conformance","package":"conformance","gateway":"tmachine","runner":"ubuntu-24.04","test_threads":4},
{"environment":"ubuntu-k3s-ipv6","installer":"k3s-ha","family":"conformance","package":"conformance","gateway":"tmachine","runner":"ubuntu-24.04","test_threads":4},
{"environment":"ubuntu-docker-rootful-cdi","installer":"deb","family":"features","package":"cdi","gateway":"openshell","runner":"ubuntu-24.04"},
{"environment":"fedora-podman-rootful-cdi","installer":"rpm","family":"features","package":"cdi","gateway":"openshell","runner":"ubuntu-24.04"},
{"environment":"fedora-podman-rootless-cdi","installer":"rpm","family":"features","package":"cdi","gateway":"openshell","runner":"ubuntu-24.04"},
{"environment":"ubuntu-docker-rootful-corporate-proxy","installer":"deb","family":"features","package":"corporate-proxy","gateway":"openshell","runner":"ubuntu-24.04"},
{"environment":"fedora-podman-rootful-corporate-proxy","installer":"rpm","family":"features","package":"corporate-proxy","gateway":"openshell","runner":"ubuntu-24.04"},
{"environment":"fedora-podman-rootless-corporate-proxy","installer":"rpm","family":"features","package":"corporate-proxy","gateway":"openshell","runner":"ubuntu-24.04"},
{"environment":"ubuntu-docker-rootful-keycloak","installer":"deb","family":"features","package":"keycloak-provider-refresh","gateway":"openshell","runner":"ubuntu-24.04"},
{"environment":"ubuntu-docker-rootful-oidc","installer":"deb","family":"features","package":"oidc-auth","gateway":"openshell","runner":"ubuntu-24.04"},
{"environment":"ubuntu-docker-rootful","installer":"deb","family":"features","package":"oci-image","gateway":"openshell","runner":"ubuntu-24.04"},
{"environment":"fedora-podman-rootful","installer":"rpm","family":"features","package":"oci-image","gateway":"openshell","runner":"ubuntu-24.04"},
{"environment":"fedora-podman-rootless","installer":"rpm","family":"features","package":"oci-image","gateway":"openshell","runner":"ubuntu-24.04"},
{"environment":"ubuntu-docker-rootful","installer":"deb","family":"features","package":"host-gateway","gateway":"openshell","runner":"ubuntu-24.04"},
{"environment":"fedora-podman-rootful","installer":"rpm","family":"features","package":"host-gateway","gateway":"openshell","runner":"ubuntu-24.04"},
{"environment":"fedora-podman-rootless","installer":"rpm","family":"features","package":"host-gateway","gateway":"openshell","runner":"ubuntu-24.04"},
{"environment":"ubuntu-k3s","installer":"k3s","family":"features","package":"host-gateway","gateway":"tmachine","runner":"ubuntu-24.04"},
{"environment":"ubuntu-k3s","installer":"k3s-ha","family":"features","package":"host-gateway","gateway":"tmachine","runner":"ubuntu-24.04"},
{"environment":"ubuntu-docker-rootful","installer":"deb","family":"features","package":"routable-host-ip","gateway":"openshell","runner":"ubuntu-24.04"},
{"environment":"fedora-podman-rootful","installer":"rpm","family":"features","package":"routable-host-ip","gateway":"openshell","runner":"ubuntu-24.04"},
{"environment":"ubuntu-k3s","installer":"k3s","family":"features","package":"routable-host-ip","gateway":"tmachine","runner":"ubuntu-24.04"},
{"environment":"ubuntu-k3s","installer":"k3s-ha","family":"features","package":"routable-host-ip","gateway":"tmachine","runner":"ubuntu-24.04"},
{"environment":"ubuntu-k3s-ipv6","installer":"k3s-ha","family":"features","package":"policy-dns-ipv6","gateway":"tmachine","runner":"ubuntu-24.04"},
{"environment":"ubuntu-docker-rootful","installer":"deb","family":"features","package":"connect-ssh-supervision","gateway":"openshell","runner":"ubuntu-24.04"},
{"environment":"fedora-podman-rootless-otlp","installer":"rpm","family":"features","package":"otlp-relay","gateway":"openshell","runner":"ubuntu-24.04"},
{"environment":"ubuntu-docker-rootful","installer":"deb","family":"features","package":"otlp-relay-inactive","gateway":"openshell","runner":"ubuntu-24.04"},
{"environment":"fedora-podman-rootless-spiffe","installer":"rpm","family":"features","package":"provider-token-exchange","gateway":"openshell","runner":"ubuntu-24.04"},
{"environment":"ubuntu-docker-rootful","installer":"deb","family":"features","package":"service-exposure","gateway":"openshell","runner":"ubuntu-24.04"},
{"environment":"fedora-podman-rootful","installer":"rpm","family":"features","package":"service-exposure","gateway":"openshell","runner":"ubuntu-24.04"},
{"environment":"fedora-podman-rootless","installer":"rpm","family":"features","package":"service-exposure","gateway":"openshell","runner":"ubuntu-24.04"},
{"environment":"fedora-podman-rootful-keycloak","installer":"rpm","family":"features","package":"keycloak-provider-refresh","gateway":"openshell","runner":"ubuntu-24.04"},
{"environment":"fedora-podman-rootless-keycloak","installer":"rpm","family":"features","package":"keycloak-provider-refresh","gateway":"openshell","runner":"ubuntu-24.04"},
{"environment":"fedora-podman-rootful-userns-default","installer":"rpm","family":"drivers/podman","gateway":"openshell","runner":"ubuntu-24.04"},
{"environment":"fedora-podman-rootful-userns-auto","installer":"rpm","family":"drivers/podman","gateway":"openshell","runner":"ubuntu-24.04"},
{"environment":"fedora-podman-rootful-userns-keep-id","installer":"rpm","family":"drivers/podman","gateway":"openshell","runner":"ubuntu-24.04"},
{"environment":"fedora-podman-rootful-userns-private","installer":"rpm","family":"drivers/podman","gateway":"openshell","runner":"ubuntu-24.04"},
{"environment":"fedora-podman-rootless-userns-default","installer":"rpm","family":"drivers/podman","gateway":"openshell","runner":"ubuntu-24.04"},
{"environment":"fedora-podman-rootless-userns-auto","installer":"rpm","family":"drivers/podman","gateway":"openshell","runner":"ubuntu-24.04"},
{"environment":"fedora-podman-rootless-userns-keep-id","installer":"rpm","family":"drivers/podman","gateway":"openshell","runner":"ubuntu-24.04"},
{"environment":"fedora-podman-rootless-userns-private","installer":"rpm","family":"drivers/podman","gateway":"openshell","runner":"ubuntu-24.04"},
{"environment":"ubuntu-docker-rootful","installer":"deb","family":"continuity","disruption":"gateway-restart","gateway":"openshell","runner":"ubuntu-24.04"},
{"environment":"ubuntu-docker-rootful","installer":"deb-upgrade-source","family":"continuity","disruption":"upgrade","gateway":"openshell","runner":"ubuntu-24.04","upgrade_source":true,"upgrade_package":"deb"}
]'
# `suite` names the row's tests in the job and artifact names.
rows="$(uv run -q tasks/scripts/e2e_suite_rows.py)"
# The workflow picks the runner, and the bundle target to match, so a
# matrix change can't choose one. Only amd64 for now: CI has no arm64
# runner with KVM for tmachine, and the caller only builds amd64 inputs.
matrix=$(jq -c --arg family "${FAMILY}" --arg external "${EXTERNAL_DRIVERS}" --arg upgrade "${UPGRADE_SOURCE}" '{include: map(
select($family == "" or .family == $family or (.family | startswith($family + "/")))
| select((.external_driver // false) == false or $external == "true")
| select((.upgrade_source // false) == false or $upgrade == "true")
| .package //= ""
| .disruption //= ""
| .suite = ([.family, .package, .disruption] | map(select(. != "")) | join("/"))
| .artifact = ([.suite, .environment, .installer] | join("-") | gsub("/"; "-"))
| .bundle = "openshell-e2e-bundle-\(.family | gsub("/"; "-"))-x86_64-unknown-linux-musl"
| .runner = "ubuntu-24.04"
| .bundle = "openshell-e2e-bundle-\(.bundle_family)-x86_64-unknown-linux-musl"
| del(.bundle_family)
)}' <<< "$rows")
if [ "$(jq '.include | length' <<< "$matrix")" -eq 0 ]; then
echo "::error::No E2E suites match family '${FAMILY}'"
Expand Down
6 changes: 3 additions & 3 deletions CI.md
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ When multiple labels are present, `Branch E2E Checks` builds each generic multi-
The `OpenShell / E2E` required status is evaluated from the `Core E2E result` job inside that workflow. `test:e2e-kubernetes` is optional while Kubernetes HA and credential-driver behavior are under active iteration: failures are visible in the workflow run but do not publish a required CI gate status. `test:e2e:continuity` is optional too.

The continuity suites (`tests/suites/continuity`) check that state created before
a disruption survives it. Each row of `e2e-suites.yml` names one disruption:
a disruption survives it. Each continuity suite in `tests/suites/ci-matrix.yaml` names one disruption:
`gateway-restart` restarts the gateway, and `upgrade` installs the candidate package
over the latest published release. Each upgrade row downloads that release's
package and runtime images itself, with the `prepare-upgrade-source` action and a tag
Expand Down Expand Up @@ -276,8 +276,8 @@ JUnit report, nextest log and, after a failure, the guest's diagnostics as an
### Run a subset of the conformance tests

The conformance lanes run the `conformance` crate in `tests/suites/conformance`
through `.github/workflows/e2e-suites.yml`, which keeps the list of
environments. To run one suite in one environment from a checkout, build the
through `.github/workflows/e2e-suites.yml`, in the environments that
`tests/suites/ci-matrix.yaml` lists. To run one suite in one environment from a checkout, build the
candidate inputs (see [TESTING.md](TESTING.md)) and narrow the tests with a
nextest filterset:

Expand Down
39 changes: 23 additions & 16 deletions TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ find the gateway and CLI.

**tmachine** boots a VM, sets up the engine and any add-ons, and installs
OpenShell. **`openshell-test-runner`** runs your selected suite in that VM
using nextest. A [CI matrix row](.github/workflows/e2e-suites.yml) pairs
the environment and installer with the family and, for features, the package.
using nextest. The [CI matrix](tests/suites/ci-matrix.yaml) lists the suites
that each environment and installer runs.

On a host with virtualization support, build the installer inputs once with
`nix run .#build-artifacts`. Then run a feature or driver suite:
Expand Down Expand Up @@ -343,11 +343,15 @@ built by `nix run .#build-artifacts` or downloaded by CI.
A flaky or broken test is marked `#[ignore = "<issue link>"]`, which takes it
out of every environment until it's fixed.

**CI.** `.github/workflows/e2e-suites.yml` lists the environments and suites as
an explicit matrix and runs the runner once per row. Branch E2E calls it once
**CI.** `tests/suites/ci-matrix.yaml` lists, for each environment and
installer, the suites CI runs there. `.github/workflows/e2e-suites.yml` runs the
runner once per suite, environment and installer (a row), and picks the runner
itself. Keep each list sorted; `tasks/scripts/e2e_suite_rows.py` expands the file
and rejects unsorted lists and unknown suites or installers. Branch E2E calls it once
per family when the `test:e2e` label is set, and a failure fails the Core E2E
result. Release Dev and Release Qualification run the conformance and feature
families. To run a suite in another environment on CI, add a row.
families. To run a suite in another environment on CI, add it to that
environment's list.

### Adding a feature suite

Expand All @@ -365,7 +369,8 @@ suite, with a name that says what the suite tests.
tests/suites/features/Cargo.toml`, then
`uv run tasks/scripts/check_cargo_lockfile_alignment.py --fix`. `cargo fmt`
and `cargo clippy` already cover every package in the workspace.
4. Add a row for the suite to the matrix in `.github/workflows/e2e-suites.yml`.
4. Add `features/<name>` to the lists of the environments it runs in, in
`tests/suites/ci-matrix.yaml`.

If the feature only needs the gateway, run the suite in an existing
environment such as `ubuntu-docker-rootful`, and skip the rest of this
Expand All @@ -377,7 +382,7 @@ it. The environment and the suite share a contract: a set of
`OPENSHELL_TEST_<SERVICE>_*` environment variables that say how to reach the
service.

- **Environment.** Add an environment to `tests/tmachine/config.nix` whose
- **Environment.** Add a feature environment, described below, whose
setup playbook starts the service (with a restart policy, since setup is
cached as a disk) and writes the variables as `KEY=VALUE` lines to
`/etc/openshell-test/env.d/<service>.env`. Pass files the playbook needs
Expand All @@ -388,16 +393,17 @@ service.
without quoting.
- **Fixture.** Put the service's fixture in a support crate under
`tests/support/<service>`, named `<service>-support`, so any suite can
depend on it, or reuse the existing one. It defines the variable names as constants and a
depend on it, or reuse the existing one. The `tests/support` workspace picks
up every directory, so the crate needs no `members` entry. It defines the variable names as constants and a
`<Service>Context::new(cx)` that reads them, waits for the service, and
wraps the testkit `Context`. Each test calls it on its first line.
Nextest runs each test in its own process, so the fixture builds its
clients there from the variables. A missing variable fails the test; it
never skips it.
- **Documentation.** Document the variables in the fixture's module docs, so
anyone can run the suite against their own deployment by setting them, and
add a row for each to the
[environment contract table](tests/support/README.md#environment-contract).
- **Documentation.** Document the variables, and the environment that sets
them, in the fixture's module docs, so anyone can run the suite against
their own deployment by setting them. Don't add them to a shared list; see
the [environment contract](tests/support/README.md#environment-contract).

The Keycloak fixture is `tests/support/keycloak`. Run the suite that uses it
with:
Expand All @@ -419,10 +425,11 @@ nix run .#openshell-test-runner -- run \

A suite that needs setup beyond a container engine runs in a feature
environment, named `<base>-<feature>`, such as `ubuntu-docker-rootful-keycloak`
or `ubuntu-docker-rootful-cdi`. `features` in `tests/tmachine/config.nix` lists
each feature's setup playbooks, the inputs they read, and the bases it supports.
To add one, add an entry there and use the generated environment name in the
suite's row in `.github/workflows/e2e-suites.yml`. The CDI suite
or `ubuntu-docker-rootful-cdi`. Each feature is a file,
`tests/tmachine/features/<feature>.nix`, that lists the feature's setup
playbooks, the inputs they read, and the bases it supports. To add one, add a
file there (`git add` it, since the flake only sees tracked files) and use the
generated environment name in `tests/suites/ci-matrix.yaml`. The CDI suite
(`tests/suites/features/cdi`) runs in `ubuntu-docker-rootful-cdi`, which creates
hardware-free CDI devices and the host files they reference. The environment
tells the suite where its scenarios are with `OPENSHELL_TEST_CDI_SCENARIOS`, the
Expand Down
Loading
Loading