Fix Cloud Hypervisor live migration nextest filtering#4563
Conversation
🤖 AI Test SelectionNo test cases were selected for this PR. |
There was a problem hiding this comment.
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_filteroverrides.
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. |
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.
🤖 AI Test SelectionNo test cases were selected for this PR. |
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.
🤖 AI Test SelectionNo test cases were selected for this PR. |
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.
🤖 AI Test SelectionNo 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, |
There was a problem hiding this comment.
Is this unused? I don't see any caller passing this.
There was a problem hiding this comment.
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.
🤖 AI Test SelectionNo test cases were selected for this PR. |
| test_script_args = f"--test-filter {shlex.quote(nextest_filter)}" | ||
| cmd_args = ( | ||
| f"tests --hypervisor {hypervisor} --{test_type} -- " | ||
| f"{test_script_args}" | ||
| ) |
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
Checklist
Test Validation
Key Test Cases:
Impacted LISA Features:
Tested Azure Marketplace Images:
Test Results