Repository navigation
test(e2e): migrate the features and drivers suites to testkit - #5137
matthewgrossman wants to merge 5 commits into
Conversation
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
|
🌿 Preview your docs: https://nvidia-preview-pr-5137.docs.buildwithfern.com/openshell |
|
/ok to test b07fbc4 |
|
Label |
|
/ok to test 78af387 |
78af387 to
7a8d936
Compare
|
/ok to test 7a8d936 |
|
/ok to test e9281a5 |
7a8d936 to
e9281a5
Compare
|
/ok to test d0d6e10 |
e9281a5 to
d0d6e10
Compare
|
/ok to test 988d5c3 |
|
Proposal for discussion, not a request to change this PR: let a testkit test register custom cleanup for resources testkit doesn't track. Problem. Testkit deletes tracked sandboxes after a pass, failure or panic, but the OCI suite ( Sketch. cx.on_cleanup("remove images", async move || engine.remove_images().await);
Effect here. Tests. Unit tests for ordering, failure and panic reporting. A deliberate-failure test that registers a hook which writes a marker, then panics, and asserts the test fails and the marker exists (the idea from #4464). Where. Since this PR is what introduces the leaking cleanup, it seems best to land the testkit change first as its own small PR and rebase this one onto it, rather than ship the inline cleanup and rewrite it right after. Happy to discuss, @matthewgrossman. |
|
/ok to test c41046c |
|
/ok to test 6e0ec21 |
c41046c to
6e0ec21
Compare
|
/ok to test 6e0ec21 |
|
Two small follow-ups, neither blocking.
|
|
/ok to test 3941a00 |
Compatibility review (advisory)New or updated breaking changes; see the full report for all findings. 1. state — No explicit risk acceptance found
2. go-sdk — No explicit risk acceptance found
Review details
Advisory review; publication gates are unchanged. |
|
/ok to test 5749613 |
Add the container-engine and podman support crates for suites that build images into the gateway's store or compare against Podman's own containers, and add expect_compute_driver and base_image to testkit. Run the support crates' unit tests in the Rust test lists. Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
Rewrite tests/suites/features/oci-image as testkit tests (package oci-image) that build their images through OPENSHELL_TEST_CONTAINER_ENGINE, which the Docker and Podman environments now publish. Run it through e2e-suites.yml on the Docker rootful, Podman rootful and Podman rootless rows, and retire the tmachine oci-image testsuite, its playbook and its archive. The OCI test images are removed by a testkit cleanup hook registered right after each build, so a panic in the test body no longer leaks them. Hooks run last registered first, so the sandboxes created from an image are deleted before it. The workspace's fmt and clippy entries now cover the whole workspace, so a new suite needs no list edit. Signed-off-by: Matthew Grossman <mgrossman@nvidia.com> Co-authored-by: Evan Lezar <elezar@nvidia.com>
Add fedora-podman-{rootful,rootless}-keycloak environments and run keycloak-provider-refresh there with the rpm installer, replacing the old provider-refresh crate, its tmachine testsuite and its archive. Podman has no daemon to restart Keycloak at boot, so start the container with --restart always and enable podman-restart.service for the user that runs it.
feature-specific-integration now runs the features family through e2e-suites.yml in Branch E2E, Release Dev and Release Qualification, and absorbs Branch E2E's separate e2e-suites job.
The Keycloak support crate is renamed to keycloak-support to match the -support suffix the other support crates take. It moves here, not with them, because the suite this commit replaces depends on it by the old name.
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
Rewrite tests/suites/drivers/podman as a testkit test (package podman) that compares a sandbox's UID map with the one Podman gives a container in the same user-namespace mode. Each fedora-podman-{rootful,rootless}-userns-<mode> environment configures that mode for the binaries installer's gateway and publishes it; the packaged installers refuse such environments rather than test without the mode.
driver-specific-integration now runs the drivers family through e2e-suites.yml, and the e2e-podman tmachine row moves to its own podman-e2e-integration job. Retire the driver-podman testsuite, its playbooks, fixtures and archive.
Each driver suite is its own workspace under tests/suites/drivers/<driver>, with its own lockfile, so a driver can be tested apart from the others. The runner's --family is the path of a workspace under tests/suites/ (drivers/podman), and each part must be a plain name. The family input of e2e-suites.yml also selects the workspaces under it, so "drivers" still selects every driver suite. The suite package is named after the driver, and the support crates take a -support suffix. Branch Checks and the rust tasks format and lint each test workspace as a whole.
The Podman support crate's reference container runs with --pull missing instead of --pull never, so it pulls the image when the engine's store doesn't have it.
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
Co-authored-by: Evan Lezar <elezar@nvidia.com>
Every suite that used the CLI conformance library now runs on testkit, so remove the crate, its lockfile entry and its row in the AGENTS.md architecture table. Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
5749613 to
7c646f5
Compare
|
/ok to test 7c646f5 |
|
Thanks @matthewgrossman. I rebased a and applied some nits. Looks good. |
Summary
Port the remaining suites that still use
crates/openshell-conformance(features/oci-image,features/provider-refresh/keycloakand the Podman user-namespace suite indrivers/podman) to testkit, and run them throughe2e-suites.ymlwith explicit CI rows. This is a parity change: each suite keeps its current environments and installers. The last commit deletescrates/openshell-conformance.Related Issue
Part of #3954
Built on #5219 (testkit cleanup hooks), the base of this PR until it merges. #5219's branch is merged in, not rebased, so its commits keep their SHAs.
Changes
tests/support, packages named<name>-support):container-engine-supportbuilds images into the gateway's image store throughOPENSHELL_TEST_CONTAINER_ENGINE.podman-supportreadsOPENSHELL_TEST_PODMAN_USERNSand computes Podman's own UID map for a mode. testkit gainsContext::expect_compute_driverandtestkit::base_image()(OPENSHELL_TEST_BASE_IMAGE, or the default sandbox image). The support unit tests run in the Rust test lists. The existing Keycloak fixture is renamed tokeycloak-supportto match; its directory doesn't change.tests/suites/features/oci-image, package renamed tooci-image): rewritten as#[testkit::test]tests. The Docker, rootful Podman and rootless Podman environments publishOPENSHELL_TEST_CONTAINER_ENGINE(docker,sudo -n podman,podman).mise run e2e:oci-image(:podman)and the ARM64 Docker lane use the new package name.keycloak-provider-refresh, from test(features): run feature tests against environment services, starting with Keycloak #4891) already matches the old test. This PR adds thefedora-podman-{rootful,rootless}-keycloakenvironments for it and deletes the oldprovider-refresh/keycloakcrate. On Podman, thekeycloakrole now starts the container with--restart alwaysand enablespodman-restart.service(the system unit when rootful, tmachine's user unit when rootless), so Keycloak comes back when a cached disk boots. Docker keepsunless-stopped.tests/suites/drivers/podman, packagepodman; driver suites are named after the driver, and each is its own workspace): one test compares the sandbox's UID map with Podman's for the configured mode and checks that the non-root workload owns and can write/sandbox. As in the old playbooks, the reference container runs and is removed before the sandbox is created: inautomode Podman gives each running container its own range, so the sandbox gets the range the reference released.fedora-podman-{rootful,rootless}-userns-{default,auto,keep-id,private}, runplaybooks/drivers/podman/userns.yaml. It writes the mode's[openshell.drivers.podman]settings to/etc/openshell-test/podman-driver.tomland publishesOPENSHELL_TEST_PODMAN_USERNS. Indefaultmode it removes that file, sogateway.tomlhas nouserns,uidmaporgidmapsettings (the old baseline asserted this).openshell_gatewayrole (binariesinstaller) adds those settings togateway.tomlbefore the gateway starts. The packaged installers fail on such an environment instead of testing without the mode.default-userns-baseline.yaml,tests.yamland theuserns-*.yamlplaybooks.feature-specific-integration(Branch E2E, Release Dev, Release Qualification; job ID kept) now callse2e-suites.ymlwithfamily: features. Branch E2E's separatee2e-suitesjob is folded into it.driver-specific-integration(Branch E2E) calls it withfamily: drivers, which selects every driver workspace (drivers/<driver>).e2e-podmanrow is unchanged and moves to its ownpodman-e2e-integrationjob, which is added to the Core E2E result.e2e-podmanrow.oci-image,provider-refreshanddriver-podmantestsuites, their playbooks, fixtures and test archives.conformanceandfeaturesare one workspace each, and each driver suite is its own workspace with its own lockfile (tests/suites/drivers/podman), so one driver's tests and dependencies can't affect another's build or cache. There is nodriversworkspace. The runner's--familyis the path of a workspace undertests/suites/(drivers/podman) and rejects absolute paths and... Driver rows ine2e-suites.ymlname that path and no package; job and artifact names are unchanged.tests/suites/drivers/podmanis added toALIGNED_WORKSPACES. The fmt/clippy lists (Branch Checks Format and Lint steps,rust:lint,rust:format,rust:format:check) now run once per test workspace (conformance,drivers/podman,features) instead of once per package, so a new feature suite needs no lint-list edit; a new driver suite adds one line to each list. This also lintsfeatures/kubernetes-updatesfor the first time; it raises no warnings.TESTING.mdandCI.mdare updated.CI rows after this PR (
e2e-suites.yml):keycloak-provider-refreshubuntu-docker-rootful-keycloakkeycloak-provider-refreshfedora-podman-{rootful,rootless}-keycloakoci-imageubuntu-docker-rootfuloci-imagefedora-podman-{rootful,rootless}fedora-podman-{rootful,rootless}-userns-{default,auto,keep-id,private}The driver suites run only in Branch E2E, as
driver-specific-integrationdoes today. The Docker Keycloak row now also runs in Release Dev and Release Qualification, because it belongs to the features family.Still to come in this PR: nothing. The last commit deletes
crates/openshell-conformance, itsCargo.lockentry and itsAGENTS.mdarchitecture row. No other code used the crate. tmachine'stestsuiteslist is now justshell(interactive) ande2e-podman.nextest.yamlstays because the runner rows still run nextest in the guest.Cleanup uses the testkit cleanup hooks from #5219, so it also runs after a failure or panic. The OCI suite registers an image-removal hook right after each build; hooks run last registered first, so the sandboxes created from an image are deleted before it is removed. The Keycloak suite's provider and profile deletes moved to hooks in #5219.
Testing
cargo fmtandcargo clippy -D warningsfor every list entry, including each whole test workspace,cargo check --workspace --locked, lockfile checks and alignment,mise run rust:deny:policy,mise run license:check,markdownlint-cli2, actionlint (no new findings), zizmor (no new findings against main),ansible-playbook --syntax-checkon the changed playbooks, andnix build .#tmachine-configtests/supportUID-map normalizationLocal runs:
mise run e2e:oci-imageagainst a local Docker gateway, before the move to cleanup hooks: 6/6 passed, with no images or sandboxes left behind. Changing an expected UID made the test fail and still clean up. The hook-based cleanup is covered by the OCI CI rows.gateway-podman.toml.j2template rendered for the default andprivatemodes and parsed as TOML.sudo -n podmancompared with the old playbooks' context, in a Fedora 44 container:sudo -nsetsHOME=/rootand dropsXDG_RUNTIME_DIR, but rootful Podman's graph root, run root, temp directory and socket are identical to the oldHOME=/root XDG_RUNTIME_DIR=/run/user/0context. Rootless runs astmachineover SSH, where PAM setsXDG_RUNTIME_DIR.Not verified locally (tmachine needs an amd64 KVM host): every tmachine row in the table above, including the Podman OCI rows, the eight user-namespace rows, the Fedora Keycloak rows, and Keycloak restarting after a cached-disk boot.
Checklist