22# SPDX-License-Identifier: Apache-2.0
33
44# Runs testkit suites in tmachine environments on CI. Each row of `ROWS` below
5- # names a tmachine environment and installer, the family (a workspace under
6- # tests/suites/) and the package in it, the gateway name the installer
7- # registers, and the runner label for the environment's architecture.
8- # `openshell-test-runner` builds the tests, boots the environment, runs them
9- # inside it and checks the results. The `family` input selects the rows of one
10- # family; leave it empty to run every row.
5+ # names a tmachine environment and installer, the family (the path of a
6+ # workspace under tests/suites/, such as conformance or drivers/podman) and,
7+ # optionally, the package in it, the gateway name the installer registers, and
8+ # the runner label for the environment's architecture. `openshell-test-runner`
9+ # builds the tests, boots the environment, runs them inside it and checks the
10+ # results. The `family` input selects the rows of one family, including the
11+ # workspaces under it (drivers selects drivers/podman); leave it empty to run
12+ # every row.
1113
1214name : E2E Suites
1315
1416on :
1517 workflow_call :
1618 inputs :
1719 family :
18- description : Run only the rows of this family (for example conformance); empty runs every row
20+ description : Run only the rows of this family and the workspaces under it (for example conformance or drivers ); empty runs every row
1921 required : false
2022 type : string
2123 default : " "
6264 # Only amd64 for now: CI has no arm64 runner with KVM for tmachine,
6365 # and the caller only builds amd64 inputs. The gateway is the name the
6466 # installer registers with the CLI: `openshell` for the packages,
65- # `tmachine` for the k3s and binaries installers.
67+ # `tmachine` for the k3s and binaries installers. A row without a
68+ # package runs every package in the workspace; each driver suite is a
69+ # workspace of its own.
6670 rows='[
6771 {"environment":"ubuntu-docker-rootful","installer":"deb","family":"conformance","package":"conformance","gateway":"openshell","runner":"ubuntu-24.04"},
6872 {"environment":"fedora-podman-rootful","installer":"rpm","family":"conformance","package":"conformance","gateway":"openshell","runner":"ubuntu-24.04"},
@@ -75,17 +79,22 @@ jobs:
7579 {"environment":"fedora-podman-rootless","installer":"rpm","family":"features","package":"oci-image","gateway":"openshell","runner":"ubuntu-24.04"},
7680 {"environment":"fedora-podman-rootful-keycloak","installer":"rpm","family":"features","package":"keycloak-provider-refresh","gateway":"openshell","runner":"ubuntu-24.04"},
7781 {"environment":"fedora-podman-rootless-keycloak","installer":"rpm","family":"features","package":"keycloak-provider-refresh","gateway":"openshell","runner":"ubuntu-24.04"},
78- {"environment":"fedora-podman-rootful-userns-default","installer":"binaries","family":"drivers","package":" podman","gateway":"tmachine","runner":"ubuntu-24.04"},
79- {"environment":"fedora-podman-rootful-userns-auto","installer":"binaries","family":"drivers","package":" podman","gateway":"tmachine","runner":"ubuntu-24.04"},
80- {"environment":"fedora-podman-rootful-userns-keep-id","installer":"binaries","family":"drivers","package":" podman","gateway":"tmachine","runner":"ubuntu-24.04"},
81- {"environment":"fedora-podman-rootful-userns-private","installer":"binaries","family":"drivers","package":" podman","gateway":"tmachine","runner":"ubuntu-24.04"},
82- {"environment":"fedora-podman-rootless-userns-default","installer":"binaries","family":"drivers","package":" podman","gateway":"tmachine","runner":"ubuntu-24.04"},
83- {"environment":"fedora-podman-rootless-userns-auto","installer":"binaries","family":"drivers","package":" podman","gateway":"tmachine","runner":"ubuntu-24.04"},
84- {"environment":"fedora-podman-rootless-userns-keep-id","installer":"binaries","family":"drivers","package":" podman","gateway":"tmachine","runner":"ubuntu-24.04"},
85- {"environment":"fedora-podman-rootless-userns-private","installer":"binaries","family":"drivers","package":" podman","gateway":"tmachine","runner":"ubuntu-24.04"}
82+ {"environment":"fedora-podman-rootful-userns-default","installer":"binaries","family":"drivers/ podman","gateway":"tmachine","runner":"ubuntu-24.04"},
83+ {"environment":"fedora-podman-rootful-userns-auto","installer":"binaries","family":"drivers/ podman","gateway":"tmachine","runner":"ubuntu-24.04"},
84+ {"environment":"fedora-podman-rootful-userns-keep-id","installer":"binaries","family":"drivers/ podman","gateway":"tmachine","runner":"ubuntu-24.04"},
85+ {"environment":"fedora-podman-rootful-userns-private","installer":"binaries","family":"drivers/ podman","gateway":"tmachine","runner":"ubuntu-24.04"},
86+ {"environment":"fedora-podman-rootless-userns-default","installer":"binaries","family":"drivers/ podman","gateway":"tmachine","runner":"ubuntu-24.04"},
87+ {"environment":"fedora-podman-rootless-userns-auto","installer":"binaries","family":"drivers/ podman","gateway":"tmachine","runner":"ubuntu-24.04"},
88+ {"environment":"fedora-podman-rootless-userns-keep-id","installer":"binaries","family":"drivers/ podman","gateway":"tmachine","runner":"ubuntu-24.04"},
89+ {"environment":"fedora-podman-rootless-userns-private","installer":"binaries","family":"drivers/ podman","gateway":"tmachine","runner":"ubuntu-24.04"}
8690 ]'
87- matrix=$(jq -c --arg family "${FAMILY}" \
88- '{include: map(select($family == "" or .family == $family))}' <<< "$rows")
91+ # `suite` names the row's tests in the job and artifact names.
92+ matrix=$(jq -c --arg family "${FAMILY}" '{include: map(
93+ select($family == "" or .family == $family or (.family | startswith($family + "/")))
94+ | .package //= ""
95+ | .suite = (if .package == "" then .family else "\(.family)/\(.package)" end)
96+ | .artifact = ([.suite, .environment, .installer] | join("-") | gsub("/"; "-"))
97+ )}' <<< "$rows")
8998 if [ "$(jq '.include | length' <<< "$matrix")" -eq 0 ]; then
9099 echo "::error::No E2E suites match family '${FAMILY}'"
91100 exit 1
94103 echo "matrix=${matrix}" >> "$GITHUB_OUTPUT"
95104
96105 suites :
97- name : E2E suites (${{ matrix.family }}/${{ matrix.package }}, ${{ matrix.environment }}, ${{ matrix.installer }})
106+ name : E2E suites (${{ matrix.suite }}, ${{ matrix.environment }}, ${{ matrix.installer }})
98107 needs : select
99108 strategy :
100109 fail-fast : false
@@ -158,11 +167,15 @@ jobs:
158167 # Retry dependency preparation, then run the suites once. The runner
159168 # builds the suites for the guest, so it needs no prepared archives.
160169 nix build --no-link .#openshell-test-runner || nix build --no-link .#openshell-test-runner
170+ packages=()
171+ if [ -n "${PACKAGE}" ]; then
172+ packages=(--package "${PACKAGE}")
173+ fi
161174 nix run .#openshell-test-runner -- \
162175 --environment "${ENVIRONMENT}" \
163176 --installer "${INSTALLER}" \
164177 --family "${FAMILY}" \
165- --package "${PACKAGE }" \
178+ "${packages[@] }" \
166179 --gateway "${GATEWAY}" \
167180 --results artifacts/test-results
168181
@@ -175,7 +188,7 @@ jobs:
175188 if : always()
176189 uses : actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
177190 with :
178- name : e2e-results-${{ matrix.family }}-${{ matrix.package }}-${{ matrix.environment }}-${{ matrix.installer }}
191+ name : e2e-results-${{ matrix.artifact }}
179192 path : artifacts/test-results
180193 if-no-files-found : ignore
181194 retention-days : 7
0 commit comments