Skip to content

Fix Cloud Hypervisor live migration nextest filtering#4563

Open
vyadavmsft wants to merge 4 commits into
mainfrom
ch_52
Open

Fix Cloud Hypervisor live migration nextest filtering#4563
vyadavmsft wants to merge 4 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.

ref: str = "",
only: Optional[List[str]] = None,
skip: Optional[List[str]] = None,
only_test_prefixes: Optional[List[str]] = None,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is this unused? I don't see any caller passing this.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Good catch. This was leftover from an earlier live-migration filtering approach. The current [cli_test_filter] path now derives the filtered subtest set directly, and no caller passes only_test_prefixes, so I removed it.

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 on lines +501 to +505
test_script_args = f"--test-filter {shlex.quote(nextest_filter)}"
cmd_args = (
f"tests --hypervisor {hypervisor} --{test_type} -- "
f"{test_script_args}"
)
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