Skip to content

feat: add xtask for parameterized task workflows#2254

Open
krishicks wants to merge 2 commits into
mainfrom
hicks/push-wnynltnmyltl
Open

feat: add xtask for parameterized task workflows#2254
krishicks wants to merge 2 commits into
mainfrom
hicks/push-wnynltnmyltl

Conversation

@krishicks

@krishicks krishicks commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

Summary

This commit adds a cargo xtask framework for orchestrating complex development workflows with typed parameter validation and tested composition.

The initial implementation provides two tasks:

  • e2e runs Podman end-to-end suites locally or in a Lima-managed Linux machine.
  • release-smoke-test installs a supplied Debian package in a Lima machine, creates a sandbox, and verifies a policy-denied curl request.

Machine-backed e2e testing supports Ubuntu 24.04, Ubuntu 26.04, and CentOS Stream 10. Each target is prepared with the OpenShell development environment and rootless Podman, with target-specific setup for packages and container configuration. CentOS Stream coverage runs under enforcing SELinux, labels shared bind mounts correctly, and checks the audit log for unexpected denials.

The Lima provider manages machine lifecycle, persistent ext4 build disks, prepared snapshots for faster reruns, relevant GitHub credentials, and cleanup of incomplete machines. Explicitly retained machines remain available for inspection.

Rust models operating systems, suites, providers, resources, snapshot identities, and machine lifecycle, while focused shell scripts handle guest setup. This structure allows a single parameterized command to exercise an expanding Linux matrix without encoding conditional behavior in the mise task graph.

GitHub Actions does not invoke these tasks as part of this change.

Additional background

There is a desire to run tasks against a matrix of environments, for example we should be able to run the e2e tests for Podman against a variety of Linux environments: Ubuntu with Podman 4.x, 5.x, and 6.x, CentOS Stream 10 with SELinux enabled, etc.

Our current mise task graph models many variants as separate named tasks, with the actual parameter handling and conditional behavior pushed into shell scripts. Although mise supports parameterized tasks, implementing this matrix there would encode conditional behavior in the mise task graph. Encoding it as an xtask lets us model that behavior with reusable Rust types and unit tests.

cargo xtask adds orchestration, parameter validation, and composition in typed and tested Rust, while retaining focused shell scripts for guest setup and existing suite execution. This gives us the ability to have a single, parameterized task that can handle, for example, spinning up an Ubuntu VM, preparing it appropriately, running a test in it, and shutting it down, with optional behavior like enabling snapshots for faster feedback loops.

Usage

Details

E2E tests

# Run the Podman e2e suite locally
cargo xtask e2e --suite podman

# Run it in a Lima machine using the default Ubuntu 26.04 guest
cargo xtask e2e --suite podman --provider lima

# Run one test on Ubuntu 24.04 with a reusable snapshot
cargo xtask e2e \
--suite podman \
--test sandbox_mounts_existing_driver_config_volume \
--provider lima \
--os ubuntu-24.04 \
--snapshot

Release smoke tests

# Test a package using Lima and Ubuntu 26.04; architecture is inferred from its filename
cargo xtask release-smoke-test \
--deb ~/Downloads/openshell_0.0.80-1_arm64.deb

# Test explicitly on Ubuntu 24.04 and ARM64
cargo xtask release-smoke-test \
--deb ~/Downloads/openshell_0.0.80-1_arm64.deb \
--os ubuntu-24.04 \
--arch arm64

# Reuse a prepared Ubuntu 26.04 machine snapshot across runs
cargo xtask release-smoke-test \
--deb ~/Downloads/openshell_0.0.80-1_arm64.deb \
--snapshot

--keep-machine can be added to either command to leave the machine available for inspection.

Related Issue

Changes

Testing

  • mise run pre-commit passes
  • Unit tests added/updated
  • E2E tests added/updated (if applicable)

Checklist

  • Follows Conventional Commits
  • Commits are signed off (DCO)
  • Architecture docs updated (if applicable)

@copy-pr-bot

copy-pr-bot Bot commented Jul 14, 2026

Copy link
Copy Markdown

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.

@krishicks krishicks marked this pull request as ready for review July 14, 2026 00:29
Run cargo fmt for both the root workspace and the standalone e2e Rust workspace
from the rust format and format-check tasks. Apply rustfmt to the e2e sources
so the expanded formatting check passes.

Signed-off-by: Kris Hicks <khicks@nvidia.com>
This commit adds a cargo xtask framework for orchestrating complex development
workflows with typed parameter validation and tested composition.

The initial implementation provides two tasks:

* e2e runs Podman end-to-end suites locally or in a Lima-managed Linux machine.
* release-smoke-test installs a supplied Debian package in a Lima machine,
  creates a sandbox, and verifies a policy-denied curl request.

Machine-backed e2e testing supports Ubuntu 24.04, Ubuntu 26.04, and CentOS
Stream 10. Each target is prepared with the OpenShell development environment
and rootless Podman, with target-specific setup for packages and container
configuration. CentOS Stream coverage runs under enforcing SELinux, labels
shared bind mounts correctly, and checks the audit log for unexpected denials.

The Lima provider manages machine lifecycle, persistent ext4 build disks,
prepared snapshots for faster reruns, relevant GitHub credentials, and cleanup
of incomplete machines. Explicitly retained machines remain available for
inspection.

Rust models operating systems, suites, providers, resources, snapshot
identities, and machine lifecycle, while focused shell scripts handle guest
setup. This structure allows a single parameterized command to exercise an
expanding Linux matrix without encoding conditional behavior in the mise task
graph.

GitHub Actions does not invoke these tasks as part of this change.

Additional background:

There is a desire to run tasks against a matrix of environments, for example we
should be able to run the e2e tests for Podman against a variety of Linux
environments: Ubuntu with Podman 4.x, 5.x, and 6.x, CentOS Stream 10 with
SELinux enabled, etc.

Our current `mise` task graph models many variants as separate named tasks,
with the actual parameter handling and conditional behavior pushed into shell
scripts. Although `mise` supports parameterized tasks, implementing this matrix
there would encode conditional behavior in the `mise` task graph. Encoding it
as an xtask lets us model that behavior with reusable Rust types and unit
tests.

`cargo xtask` adds orchestration, parameter validation, and composition in
typed and tested Rust, while retaining focused shell scripts for guest setup
and existing suite execution. This gives us the ability to have a single,
parameterized task that can handle, for example, spinning up an Ubuntu VM,
preparing it appropriately, running a test in it, and shutting it down, with
optional behavior like enabling snapshots for faster feedback loops.

Signed-off-by: Kris Hicks <khicks@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant