Skip to content

test(e2e): pin the driver-as-root and comfyui-runtime contracts (EAI-8071) - #291

Open
fredespi wants to merge 8 commits into
mainfrom
e2e-pin-the-contracts-for-eai-8051-and-eai-8053
Open

test(e2e): pin the driver-as-root and comfyui-runtime contracts (EAI-8071)#291
fredespi wants to merge 8 commits into
mainfrom
e2e-pin-the-contracts-for-eai-8051-and-eai-8053

Conversation

@fredespi

Copy link
Copy Markdown
Collaborator

Two more walkthrough defects get pinning coverage, completing the set alongside EAI-8024 (#241) and EAI-8050. Test-only — no product behaviour changes. Each scenario asserts the correct behaviour and is registered as an expected failure in expectations.toml citing its ticket, so CI stays green and the row becomes a stale XPASS the day the bug is fixed.

Pinned as expected failures

Ticket What the scenario pins Lane
EAI-8053 install driver --dkms as root on a host without sudo fails with sudo: not found, because the plan prefixes every command with sudo even when already root mock (root)
EAI-8051 comfyui install can pull CUDA nvidia-* wheels into the managed ROCm runtime, displacing its ROCm torch — installing an optional app breaks the base runtime nightly GPU

EAI-8053 — driver install as root

New driver.feature runs install driver --dkms --yes with a PATH that exposes sh but not sudo, and asserts the run does not fail merely because sudo is absent (not that the install succeeds — it can't in a container). A new @requires-root tag skips the scenario off root, where prefixing sudo is correct, so the row stays honest on non-root lanes. Harness additions are confined to the test crate: a run_rocm_with_only_tools helper (a PATH exposing only named tools) and the @requires-root resolver support (uid read from /proc/self/status, no unsafe).

EAI-8051 — comfyui must not destroy the ROCm runtime

New comfyui.feature (the suite's first ComfyUI coverage) installs a managed runtime, installs ComfyUI, and asserts the runtime's torch is still a ROCm/HIP build with no nvidia-* distributions. @requires-gpu @nightly, run against the scenario's own isolated runtime prefix — never a shared one, since it may corrupt the runtime it checks. It does not assert the install exits 0 (the real install exits non-zero and still leaves the damage). Package enumeration uses importlib.metadata (uv runtimes have no pip) and fails loudly rather than read a broken probe as clean.

Test plan

  • No-GPU mock lane: 51 scenarios, 3 xfail, 0 XPASS, 0 new unexpected failures. EAI-8053 xfails for its exact stated reason (sudo: not found); EAI-8051 skips as @nightly @requires-gpu.
  • cargo test -p e2e-cucumber --lib and cargo clippy -p e2e-cucumber --lib --tests -- -D warnings pass in a Linux container.
  • EAI-8051's GPU-lane behaviour is measured by a nightly app-dev-gpu dispatch (results to follow).

…EAI-8071)

Two test-only scenarios pinning walkthrough defects, each registered as an
xfail in expectations.toml citing its ticket so CI stays green and the row
goes stale the day the bug is fixed.

EAI-8053: `install driver --dkms` prefixes every plan command with a literal
`sudo`, so as root on a host without sudo the first command dies with
`sudo: not found`. New driver.feature runs the install with a PATH that omits
sudo and asserts the run does not fail merely because sudo is absent. Adds a
`@requires-root` tag (skips off root, where the prefix is correct) so the row
stays honest on non-root lanes.

EAI-8051: `comfyui install` installs ComfyUI's deps into the managed ROCm
runtime with no index scoping, so a transitive dep can pull CUDA nvidia-*
wheels in and displace the runtime's ROCm torch. New comfyui.feature installs
an isolated runtime, installs ComfyUI, and asserts the runtime's torch is
still a ROCm build with no nvidia-* distributions. GPU/lifecycle/nightly and
isolated, since it may corrupt the runtime it runs against.

Signed-off-by: fredespi <fredrik.espinoza@gmail.com>
…-for-eai-8051-and-eai-8053

Signed-off-by: fredespi <fredrik.espinoza@gmail.com>

# Conflicts:
#	tests/e2e-cucumber/expectations.toml
Address pre-PR review of the ComfyUI runtime-preservation scenario:

- Drop @lifecycle from the scenario. No lane sets E2E_INCLUDE_LIFECYCLE on a
  GPU host, so @requires-gpu @lifecycle @nightly together made the scenario
  unreachable on every lane. @requires-gpu @nightly matches
  runtime-install-sdk-active, the other scenario that does a real install sdk;
  this scenario mutates only its own isolated runtime prefix, not the OS.
- Enumerate installed distributions via importlib.metadata instead of
  `python -m pip list`. uv-created managed runtimes have no pip module, so the
  pip probe exited non-zero with empty stdout, which the old code read as "no
  nvidia packages" and passed the check on a runtime it never inspected. The
  probe now fails loudly on any error rather than treating it as a clean result.

Signed-off-by: fredespi <fredrik.espinoza@gmail.com>
@fredespi
fredespi requested a review from a team as a code owner August 20, 2026 10:53
@fredespi
fredespi requested a review from r0x0r August 20, 2026 10:53
CI's clippy lane checks the e2e harness test target with -D warnings, which
surfaced two lints the mock-lane gate did not:

- comfyui_steps.rs: map(str::trim).unwrap_or_else(panic) -> map_or_else.
- e2e.rs: split run_rocm_with_only_tools' overlong first doc paragraph.

Signed-off-by: fredespi <fredrik.espinoza@gmail.com>
The helper and its which_on_path were #[cfg(unix)], but driver_steps.rs calls
them unconditionally — cucumber step functions are registered on every platform,
so the Windows build failed with E0425 (cannot find function). The driver
scenario is @requires-os:linux and never runs on Windows, but the step code must
still compile there. Drop the cfg gates and gate only the symlink line (Unix
symlink; a plain copy on other platforms), so the call resolves everywhere.

Verified: Linux clippy --all-targets -D warnings and a Windows cross-check
(x86_64-pc-windows-gnu) both pass.

Signed-off-by: fredespi <fredrik.espinoza@gmail.com>
The EAI-8051 scenario located the managed runtime's venv by parsing `Folder:`
from `rocm examine`, but examine only prints that line for the ACTIVE runtime and
takes a different branch otherwise. On the MI300X GPU lane the baseline step
panicked with "no active-runtime Folder: line" — a miswired step, reported as an
unexpected failure rather than the intended xfail. The isolated `install sdk`
itself succeeded. Read `install_root:` from `rocm runtimes list`, which is printed
unconditionally for every installed runtime, so discovery no longer depends on
which runtime examine considers active.

Signed-off-by: fredespi <fredrik.espinoza@gmail.com>
The EAI-8051 baseline step imported torch in the runtime venv to read
torch.version.hip, but importing torch loads the ROCm shared libraries, which
need the runtime's LD_LIBRARY_PATH/ROCM_PATH — the product sets that env when it
probes torch, our bare interpreter does not. On the MI300X lane the import failed
and a runtime with a perfectly good ROCm torch read as "not a ROCm build".

Judge the build from the torch distribution's version label via
importlib.metadata (`2.x+rocm...` vs `2.x+cu...`) instead — no import, no native
load, so a bare interpreter suffices. The baseline and post-install assertions now
also surface the actual version string for self-diagnosis on failure.

Signed-off-by: fredespi <fredrik.espinoza@gmail.com>
…nner

The GPU lane showed TheRock's managed torch labels its local version with a git
hash (2.11.0+gitd0c8b1f), not +rocm, so requiring "rocm" in the label wrongly
failed the baseline on a healthy ROCm runtime. A CUDA wheel, by contrast, always
carries +cu. The EAI-8051 corruption replaces the ROCm/TheRock torch with a CUDA
one, so judge "still ROCm" as "torch present and NOT a +cu build" — which is
exactly the flip the defect causes and needs no positive ROCm label.

Signed-off-by: fredespi <fredrik.espinoza@gmail.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