Skip to content

Fix Cloud Hypervisor live migration nextest filtering - #4563

Merged
LiliDeng merged 7 commits into
mainfrom
ch_52
Jul 13, 2026
Merged

Fix Cloud Hypervisor live migration nextest filtering#4563
LiliDeng merged 7 commits into
mainfrom
ch_52

Conversation

@vyadavmsft

Copy link
Copy Markdown
Collaborator

Run Cloud Hypervisor live migration tests through the CLI path and construct the nextest filter as a shell-safe expression. Preserve the base test filter while excluding the serial-only live migration test from the parallel run.

Description

Related Issue

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Refactoring
  • Documentation update

Checklist

  • Description is filled in above
  • No credentials, secrets, or internal details are included
  • Peer review requested (if not, add required peer reviewers after raising PR)
  • Tests executed and results posted below

Test Validation

Key Test Cases:

Impacted LISA Features:

Tested Azure Marketplace Images:

Test Results

Image VM Size Result
PASSED / FAILED / SKIPPED

Copilot AI review requested due to automatic review settings June 26, 2026 20:35
@github-actions

Copy link
Copy Markdown

🤖 AI Test Selection

No test cases were selected for this PR.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Cloud Hypervisor test harness to run live migration tests through the CLI path and to build a shell-safe nextest filter expression while preserving the base filter behavior.

Changes:

  • Route live migration execution through the integration CLI test type and apply a nextest --filterset-based filter.
  • Add helper logic to construct a combined nextest filterset (base substring + include + exclude).
  • Adjust subtest listing and run orchestration to support cli_test_type / cli_test_filter overrides.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
lisa/microsoft/testsuites/cloud_hypervisor/ch_tests.py Switch live migration run to the CLI integration path and pass only/skip plus CLI filtering parameters.
lisa/microsoft/testsuites/cloud_hypervisor/ch_tests_tool.py Add nextest filterset construction and CLI-path execution for filtered runs, plus supporting subtest prep parameters.

Comment thread lisa/microsoft/testsuites/cloud_hypervisor/ch_tests_tool.py Outdated
Run Cloud Hypervisor live migration tests through the CLI path and construct the nextest filter as a shell-safe expression. Preserve the base test filter while excluding the serial-only live migration test from the parallel run.
@github-actions

Copy link
Copy Markdown

🤖 AI Test Selection

No test cases were selected for this PR.

LiliDeng
LiliDeng previously approved these changes Jun 29, 2026
Comment thread lisa/microsoft/testsuites/cloud_hypervisor/ch_tests_tool.py Outdated
Comment thread lisa/microsoft/testsuites/cloud_hypervisor/ch_tests_tool.py Outdated
Replace the custom bash argument quoting helper with shlex.quote and quote the generated bash script as a whole before passing it to bash -lc.

Remove the redundant cli_test_type override by running live migration through the integration test type and selecting live migration cases with the nextest filter.
Copilot AI review requested due to automatic review settings June 29, 2026 19:44
@github-actions

Copy link
Copy Markdown

🤖 AI Test Selection

No test cases were selected for this PR.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Comment thread lisa/microsoft/testsuites/cloud_hypervisor/ch_tests_tool.py
Derive the expected subtest set when running Cloud Hypervisor tests with a nextest CLI filter instead of passing an empty set into result processing.

Fail fast if the filter and include/exclude lists select no subtests so a zero-test run cannot pass silently.
@github-actions

Copy link
Copy Markdown

🤖 AI Test Selection

No test cases were selected for this PR.

Comment thread lisa/microsoft/testsuites/cloud_hypervisor/ch_tests_tool.py Outdated
Drop the only_test_prefixes parameter from the Cloud Hypervisor test runner because no caller supplies it.

Remove the corresponding private prefix-filter branches so the run_tests signature only exposes supported include, exclude, and CLI substring filters.
Copilot AI review requested due to automatic review settings July 1, 2026 19:03
@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown

🤖 AI Test Selection

No test cases were selected for this PR.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Comment thread lisa/microsoft/testsuites/cloud_hypervisor/ch_tests_tool.py
@vyadavmsft
vyadavmsft requested a review from anirudhrb July 6, 2026 00:19
CH integration tests run under cargo-nextest, which rejects the libtest '-- -- --list' flag ('failed to parse test binary arguments --list: arguments are unsupported', exit 96). _list_subtests therefore returned an empty list and _prepare_filtered_subtests failed with 'No Cloud Hypervisor integration subtests matched filter', even though the tests exist and the nextest run path works.

List subtests with 'cargo nextest list --message-format json' instead, run in the dev container via 'dev_cli.sh shell' and mirroring the integration build env (mshv feature, devcli_testenv cfg). The return value stays the same List[str] of '<module>::<test>' names, so the runbook-driven include/exclude (only/skip/cli_test_filter), the no-match validation, and per-subtest result tracking are unchanged.
Copilot AI review requested due to automatic review settings July 9, 2026 00:37
@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

🤖 AI Test Selection

No test cases were selected for this PR.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Comment thread lisa/microsoft/testsuites/cloud_hypervisor/ch_tests_tool.py Outdated
The previous fix listed subtests via 'dev_cli.sh shell -- RUSTFLAGS=..(--cfg devcli_testenv).. cargo nextest list'. dev_cli.sh's shell command runs its arguments as 'bash -c \$*', which re-joins them on spaces and drops quoting, so the space inside the RUSTFLAGS value was split: bash set RUSTFLAGS=--cfg and then tried to run 'devcli_testenv' as a command (exit 127, 'devcli_testenv: command not found'). cargo never ran, the subtest list came back empty, and _prepare_filtered_subtests still failed with 'No subtests matched filter'.

Use the space-free 'RUSTFLAGS=--cfg=devcli_testenv' form so it survives the bash -c hand-off, and make the JSON parser scan each '{' for the nextest object with a 'rust-suites' map, since dev_cli.sh interleaves docker pull and cargo build output on the same stream.
Copilot AI review requested due to automatic review settings July 9, 2026 01:15
@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

🤖 AI Test Selection

No test cases were selected for this PR.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Comment thread lisa/microsoft/testsuites/cloud_hypervisor/ch_tests_tool.py
… of failing

Cloud Hypervisor gates every live migration integration test behind
cfg(not(feature = "mshv")). The mshv integration build
(cargo nextest ... --features mshv) compiles them out, so _list_subtests
correctly returns no live_migration tests and the "live_migration"
substring filter matches nothing.

_prepare_filtered_subtests previously called fail() in that case, turning a
legitimately-empty selection into a hard AssertionError. This made
verify_cloud_hypervisor_live_migration_tests fail on mshv even though the
tests do not exist in that build (they had been silently passing before the
subtest-list assertion was added).

Raise SkippedException instead so an unavailable test family (live migration
on mshv, or an include/exclude filter that removes all matches) is reported
as a clean skip per LISA conventions. KVM builds (no mshv feature) still
compile these tests, so the filter matches and they run normally.
Copilot AI review requested due to automatic review settings July 9, 2026 06:16
@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

🤖 AI Test Selection

No test cases were selected for this PR.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

Comment thread lisa/microsoft/testsuites/cloud_hypervisor/ch_tests_tool.py
Comment thread lisa/microsoft/testsuites/cloud_hypervisor/ch_tests_tool.py
Comment thread lisa/microsoft/testsuites/cloud_hypervisor/ch_tests_tool.py
@LiliDeng
LiliDeng merged commit 6e4261a into main Jul 13, 2026
61 checks passed
@LiliDeng
LiliDeng deleted the ch_52 branch July 13, 2026 15:38
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.

4 participants