Skip to content

[AI Generated] Improve targeted PR test validation - #4855

Open
LiliDeng wants to merge 1 commit into
microsoft:mainfrom
LiliDeng:main
Open

LiliDeng wants to merge 1 commit into
microsoft:mainfrom
LiliDeng:main

Conversation

@LiliDeng

@LiliDeng LiliDeng commented Nov 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

Replace smoke-test fallback behavior with targeted PR validation and explicit coverage requirements.

  • Select changed tests and metadata deterministically, skip complete test-only deletions, and require coverage for affected features, tools, and OS methods.
  • Use the Azure OpenAI Responses v1 API for framework-case ranking and validate selected cases against real metadata and reviewed Marketplace images.
  • Group compatible Azure cases for sequential execution; show dedicated-platform recommendations without substituting Azure smoke tests.
  • Replay only failed head cases against a fixed ancestor using the same resolved image and deployment configuration. Keep raw failures visible and block missing, incomplete, or different baseline results.
  • Skip automatic draft PR validation, allow up to six hours for the validation job, and document trigger and execution limitations.

Validation

  • 53 isolated regression checks passed against the final official-main-based checkout, covering selection boundaries, case lifecycle, metadata/image compatibility, model responses, and head/baseline result gating.
  • Black, flake8, pylint (10.00/10), and focused mypy passed for all four Python scripts.
  • YAML checks confirm the configured agent pool, draft filtering, timeout, and unchanged remaining pipeline settings.
  • A controlled fork pipeline run confirmed that complete-case deletion produces an empty plan and skips model selection and guest execution.

Scope and limitations

  • One commit containing eight production/documentation files; no test fixtures, fault injections, new repository selftests, comment-cleanup integration, or container changes.
  • Draft-to-ready live triggering was not exercised. PR source branches must contain the updated trigger configuration.
  • Fork PR execution remains subject to existing pipeline approval and secret-access policies.

Select changed cases and required feature, tool, and OS coverage using Responses v1. Plan compatible images, provide dedicated-platform recommendations, and execute Azure groups sequentially with fixed-baseline replay for failures. Skip complete case deletions and automatic draft PR validation, and document execution and reporting behavior.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 3, 2026 13:56

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.

🟡 Changes recommended

Unresolved defects in test selection, suite loading, result aggregation, and head/baseline comparability can omit tests or falsely report successful validation.

8 open issues
What changed in this PR

This PR replaces smoke-test fallbacks with targeted validation plans, connecting changed LISA code to required tests and compatible images. It also adds failure-triggered baseline comparisons while preserving raw test results.

Changes:

  • Select changed tests deterministically and enforce feature, tool, and OS coverage requirements.
  • Execute compatible Azure groups sequentially and publish recommendations for dedicated platforms.
  • Compare failed head cases against a fixed ancestor, skip automatic draft validation, and document execution limits.

Suggested validation, not executed during this review:

Key Test Cases:
smoke_test|verify_reboot_in_platform

Impacted LISA Features:
None directly; changes affect validation orchestration and test selection.

Tested Azure Marketplace Images:

  • canonical 0001-com-ubuntu-server-jammy 22_04-lts-gen2 latest
File Description
lisa/​microsoft/​runbook/​ai_selected.yml Allows explicitly selected stable and preview cases.
docs/​run_test/​run.rst Links the new PR validation guide.
docs/​run_test/​pr_validation.rst Documents selection, execution, comparison rules, and limitations.
.github/​scripts/​validation_report.py Renders dedicated-platform recommendation tables.
.github/​scripts/​validation_plan.py Builds metadata-checked plans using reviewed images.
.github/​scripts/​run_selected_cases.py Executes groups and compares failed cases with baseline results.
.github/​scripts/​ai_select_cases.py Adds required coverage, deletion handling, and Responses API selection.
.azuredevops/​azure-pipelines.yml Integrates plans, baseline runs, reporting, draft filtering, and a six-hour timeout.

Review effort: Balanced

Comment on lines +69 to +72
if case.get("classname") == name
or (
case.get("classname") == suite
and re.sub(r" \([^()]*\)$", "", case.get("name", "")) == method
Comment on lines +157 to +179
keys = (
"vm_size",
"osdisk_size_in_gb",
"maximize_capability",
"marketplace",
"security_profile",
"disk_controller_type",
"data_disk_count",
"data_disk_type",
"data_disk_size",
"nic_count",
"network_data_path",
)
for path in directory.rglob("arm_template_parameters.json"):
parameters = json.loads(path.read_text(encoding="utf-8"))
nodes = parameters.get("nodes", {}).get("value", [])
configuration = sorted(
json.dumps({key: node.get(key) for key in keys}, sort_keys=True)
for node in nodes
)
signatures.add(
hashlib.sha256(json.dumps(configuration).encode("utf-8")).hexdigest()
)
Comment on lines +257 to +261
"keep_environment:no",
"-v",
"wait_delete:True",
"-v",
"concurrency:1",
Comment on lines +342 to +346
base = execute_group(
str(executable),
baseline_directory / "source",
base_directory,
runbook,
Comment on lines +130 to +139
for path in sorted(set(case_files.values())):
module = importlib.import_module(path.removesuffix(".py").replace("/", "."))
if Path(module.__file__ or "").resolve() != (repo_root / path).resolve():
raise ValueError(
f"Imported testsuite does not match the repository: {path}"
)
registered = get_cases_metadata()
result: Dict[str, TestCaseMetadata] = {}
for name, path in case_files.items():
module_name = path.removesuffix(".py").replace("/", ".")
Comment on lines +320 to +327
if head_statuses == {"passed"}:
execution_result = "Passed"
elif head_statuses.intersection({"failed", "error"}):
execution_result = "Failed"
elif head_statuses == {"skipped"}:
execution_result = "Skipped"
else:
execution_result = "Incomplete"
changed_lines,
)
related_cases: List[str] = []
for changed_file_path in sorted(changed_testsuite_files):
"-v",
"enable_tests:False",
"-v",
"auth_type:token",

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants