ch_tests_tool: parse nextest JUnit output for cloud-hypervisor tests#4495
Open
anirudhrb wants to merge 1 commit into
Open
ch_tests_tool: parse nextest JUnit output for cloud-hypervisor tests#4495anirudhrb wants to merge 1 commit into
anirudhrb wants to merge 1 commit into
Conversation
The cloud-hypervisor integration suite now emits per-suite JUnit XML via cargo nextest. Prefer that structured output over the legacy cargo stdout scraping so subtest results are accurate and resilient to log-format churn upstream. - Collect JUnit XMLs from the SSH user's $HOME/workloads/junit/, which is where dev_cli.sh's docker container (run with --user $(id -u):$(id -g) and bind-mounting $HOME/workloads) writes them as the SSH user. - Resolve $HOME on the remote node before each use, falling back to /root/workloads/junit if resolution fails. - Wipe any stale JUnit dir from a previous run on the same node before starting tests so results can never be misattributed across runs. - Parse <testcase> elements into CloudHypervisorTestResult, mapping failure/error -> FAILED, skipped -> SKIPPED, otherwise PASSED. Subtests expected but missing from every JUnit file stay QUEUED. Last retry wins, matching nextest's final-outcome reporting. - When 'cargo nextest' appears in stdout but no JUnit files are produced, fail with a clear diagnostic instead of silently falling back to the stdout parser. - Fall back to the existing stdout parser when no JUnit files are present and nextest wasn't invoked (classic cargo test path). Signed-off-by: Anirudh Rayabharam <anrayabh@microsoft.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the Cloud Hypervisor test runner tool to prefer parsing cargo nextest JUnit XML output (copied back from the VM) over the legacy stdout scraping, improving subtest result fidelity and resilience to upstream log-format changes.
Changes:
- Collect nextest-generated JUnit XML files from the remote node and parse
<testcase>elements intoCloudHypervisorTestResultstatuses. - Add a guardrail to fail with a clear diagnostic when nextest appears to have run but no JUnit output is found.
- Proactively remove any stale remote JUnit output directory before running tests to avoid misattributing results across runs.
LiliDeng
approved these changes
May 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The cloud-hypervisor integration suite now emits per-suite JUnit XML via cargo nextest. Prefer that structured output over the legacy cargo stdout scraping so subtest results are accurate and resilient to log-format churn upstream.
$HOME/workloads/junit/, which is where dev_cli.sh's docker container (run with--user $(id -u):$(id -g)and bind-mounting$HOME/workloads) writes them as the SSH user.Related Issue
Type of Change
Checklist
Test Validation
Key Test Cases:
Impacted LISA Features:
Tested Azure Marketplace Images:
Test Results