Skip to content

test ai pick case scenario#4367

Open
LiliDeng wants to merge 1 commit intomainfrom
lildeng/3_20_001
Open

test ai pick case scenario#4367
LiliDeng wants to merge 1 commit intomainfrom
lildeng/3_20_001

Conversation

@LiliDeng
Copy link
Copy Markdown
Collaborator

@LiliDeng LiliDeng commented Mar 20, 2026

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 March 20, 2026 03:32
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 introduces an AI-driven GitHub Actions workflow to select and run relevant LISA test cases for PR validation, along with a dedicated runbook, and a small tweak to provisioning smoke-test panic labeling.

Changes:

  • Added a new GitHub Actions workflow (ai-test-selection.yml) that calls a selector script to choose test cases and then runs LISA in Azure.
  • Added an AI test selection helper script (.github/scripts/ai_select_cases.py) and a new runbook (lisa/microsoft/runbook/ai_selected.yml) intended for running selected cases.
  • Updated provisioning smoke-test serial-console panic stage label in one failure path.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

File Description
lisa/microsoft/testsuites/core/provisioning.py Adjusts the SerialConsole.check_panic() stage string used when SSH port readiness fails.
lisa/microsoft/runbook/ai_selected.yml Adds a runbook intended to run testcases by a variable-provided name pattern.
.github/workflows/ai-test-selection.yml Adds a multi-job workflow to select tests via GitHub Models, run selected LISA tests on Azure, and report results back to the PR.
.github/scripts/ai_select_cases.py Implements test enumeration + GitHub Models call + outputs selected case list and a runbook fragment.

Copilot AI review requested due to automatic review settings March 20, 2026 06:00
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 5 out of 5 changed files in this pull request and generated 5 comments.

Copilot AI review requested due to automatic review settings March 20, 2026 10:15
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 5 out of 5 changed files in this pull request and generated 5 comments.

Copilot AI review requested due to automatic review settings March 20, 2026 11:44
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 5 out of 5 changed files in this pull request and generated 3 comments.

Copilot AI review requested due to automatic review settings March 20, 2026 13:28
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 5 out of 5 changed files in this pull request and generated 5 comments.

Copilot AI review requested due to automatic review settings March 20, 2026 15:00
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 5 out of 5 changed files in this pull request and generated 5 comments.

@microsoft microsoft deleted a comment from github-actions bot Mar 20, 2026
Copilot AI review requested due to automatic review settings March 20, 2026 15:48
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 5 out of 5 changed files in this pull request and generated 3 comments.

Comment on lines +3 to +6
on:
pull_request:
branches:
- main
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

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

This workflow runs on pull_request and uses Azure secrets/OIDC. For PRs from forks, secrets are not available (leading to failures), and more importantly, you generally don’t want to run privileged Azure jobs for untrusted contributors. Add a guard (job-level if) to only run the Azure portions when the PR is from the same repository (e.g., github.event.pull_request.head.repo.fork == false) and/or when the author is trusted, while still allowing the “select tests” and “report” steps to run safely.

Copilot uses AI. Check for mistakes.
Comment on lines +142 to +147
- name: Azure Login (OIDC)
uses: azure/login@v2
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

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

This workflow runs on pull_request and uses Azure secrets/OIDC. For PRs from forks, secrets are not available (leading to failures), and more importantly, you generally don’t want to run privileged Azure jobs for untrusted contributors. Add a guard (job-level if) to only run the Azure portions when the PR is from the same repository (e.g., github.event.pull_request.head.repo.fork == false) and/or when the author is trusted, while still allowing the “select tests” and “report” steps to run safely.

Copilot uses AI. Check for mistakes.
Copilot AI review requested due to automatic review settings March 21, 2026 01:37
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 5 out of 5 changed files in this pull request and generated 9 comments.

Comment on lines +11 to +15
permissions:
contents: read
pull-requests: write
id-token: write
models: read
Copy link

Copilot AI Mar 21, 2026

Choose a reason for hiding this comment

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

The workflow grants pull-requests: write and id-token: write at the top level, but the ai-select-tests job checks out and executes PR-controlled code (.github/scripts/ai_select_cases.py). This combination is a security risk (a PR can modify the script to use the elevated token/OIDC). Reduce permissions to the minimum per-job (e.g., ai-select-tests: contents: read, pull-requests: read, models: read; no id-token), and only grant pull-requests: write to the report job; also consider checking out trusted code for the selector or setting persist-credentials: false.

Copilot uses AI. Check for mistakes.
Comment on lines +47 to +49
TOTAL=$(gh api /repos/${{ github.repository }}/commits/$SHA/check-runs \
--jq '[.check_runs[] | select(.name | test("flake8|pylint|mypy|shellcheck|docs|test|example"; "i"))] | length')
if [ "$TOTAL" -gt 0 ]; then
Copy link

Copilot AI Mar 21, 2026

Choose a reason for hiding this comment

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

The workflow calls the Checks API endpoint /commits/$SHA/check-runs, which typically requires checks: read permission. The workflow permissions block doesn't request checks: read, so this step may 403 and fail the job. Add checks: read (or switch to an endpoint covered by existing permissions) so the CI-status gate is reliable.

Copilot uses AI. Check for mistakes.
fi

PR_NUMBER="${{ needs.ai-select-tests.outputs.pr_number }}"
gh pr comment $PR_NUMBER --body "$(echo -e "$BODY")"
Copy link

Copilot AI Mar 21, 2026

Choose a reason for hiding this comment

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

If ai-select-tests fails before setting outputs (e.g., CI gate exits non-zero), report still runs (if: always()) but needs.ai-select-tests.outputs.pr_number will be empty and gh pr comment will fail. Make the report job re-determine the PR number (or guard when it's missing) and consider making the CI gate a soft-skip that sets case_count=0 rather than failing the job.

Suggested change
gh pr comment $PR_NUMBER --body "$(echo -e "$BODY")"
if [ -z "$PR_NUMBER" ]; then
PR_NUMBER="${{ github.event.pull_request.number }}"
fi
if [ -z "$PR_NUMBER" ]; then
echo "No PR number available; skipping PR comment."
exit 0
fi
gh pr comment "$PR_NUMBER" --body "$(echo -e "$BODY")"

Copilot uses AI. Check for mistakes.
Comment on lines +123 to +148
# ── Step 2: Run selected LISA test cases on Azure ──
run-lisa-tests:
name: Run LISA Tests
needs: ai-select-tests
if: needs.ai-select-tests.outputs.case_count > 0
runs-on: ubuntu-latest
timeout-minutes: 120

permissions:
id-token: write
contents: read

steps:
- name: Checkout trusted code
uses: actions/checkout@v4
with:
ref: ${{ github.event.repository.default_branch }}
path: trusted

- name: Azure Login (OIDC)
uses: azure/login@v2
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}

Copy link

Copilot AI Mar 21, 2026

Choose a reason for hiding this comment

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

run-lisa-tests uses Azure secrets and runs on the pull_request event. For PRs from forks, secrets won't be available and this job will fail (potentially blocking contributions). Add a guard to only run this job for same-repo PRs (or move the secret-using portion behind workflow_dispatch / an approval gate).

Copilot uses AI. Check for mistakes.
Comment on lines +1 to +3
name: AI Test Case Selection

on:
Copy link

Copilot AI Mar 21, 2026

Choose a reason for hiding this comment

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

The PR description is still the template with the main Description/Type/Checklist sections left blank. Please add a short description of what this workflow/selector is intended to do and why it’s being added so reviewers can validate scope and risk.

Copilot uses AI. Check for mistakes.
Comment on lines +111 to +112
export PR_CHANGED_FILES=$(cat /tmp/changed_files.txt)
export PR_DIFF=$(head -c 30000 /tmp/pr_diff.txt)
Copy link

Copilot AI Mar 21, 2026

Choose a reason for hiding this comment

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

export PR_CHANGED_FILES=$(cat ...) and export PR_DIFF=$(head -c ...) are unquoted command substitutions. Because the diff/file list contains spaces and newlines, this will break the export command (word-splitting/globbing) and likely fail the workflow before the Python script runs. Quote these expansions (or pass file paths to the script and read the files in Python) to preserve the content correctly.

Suggested change
export PR_CHANGED_FILES=$(cat /tmp/changed_files.txt)
export PR_DIFF=$(head -c 30000 /tmp/pr_diff.txt)
export PR_CHANGED_FILES="$(cat /tmp/changed_files.txt)"
export PR_DIFF="$(head -c 30000 /tmp/pr_diff.txt)"

Copilot uses AI. Check for mistakes.
Comment on lines +223 to +224
# Delete resource groups created by LISA (prefixed with 'intlisa')
for rg in $(az group list --query "[?starts_with(name, 'intlisa')].name" -o tsv); do
Copy link

Copilot AI Mar 21, 2026

Choose a reason for hiding this comment

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

The cancellation cleanup deletes resource groups with prefix intlisa, but there are no references in the codebase to LISA creating RGs with that prefix; LISA commonly generates names starting with lisa-. As written, this cleanup likely won't remove leaked resources on cancellation. Align the prefix/tag filter with actual RG naming (or capture the RG name from LISA outputs and delete that specific RG).

Suggested change
# Delete resource groups created by LISA (prefixed with 'intlisa')
for rg in $(az group list --query "[?starts_with(name, 'intlisa')].name" -o tsv); do
# Delete resource groups created by LISA (prefixed with 'lisa-')
for rg in $(az group list --query "[?starts_with(name, 'lisa-')].name" -o tsv); do

Copilot uses AI. Check for mistakes.
Comment on lines +85 to +88
req = urllib.request.Request(url, data=data, headers=headers, method="POST")
with urllib.request.urlopen(req) as resp:
result = json.loads(resp.read().decode("utf-8"))
return result["choices"][0]["message"]["content"]
Copy link

Copilot AI Mar 21, 2026

Choose a reason for hiding this comment

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

urllib.request.urlopen(req) is called without a timeout, so the workflow can hang until the job-level timeout if the Models endpoint stalls. Pass an explicit timeout (and consider catching URLError/HTTPError to fail gracefully) to keep the CI behavior predictable.

Copilot uses AI. Check for mistakes.
Comment on lines +123 to +137
return (
"## PR Changed Files\n"
f"{changed_files}\n\n"
"## PR Diff (truncated to key changes)\n"
f"{diff[:8000]}\n\n"
"## Available Test Cases\n"
f"{case_summary}\n\n"
"Select the test cases that should run for this PR. "
"IMPORTANT: Avoid selecting stress tests (e.g. stress_reboot, "
"stress_*) unless the PR directly modifies stress test code or "
"core functionality that stress tests specifically validate. "
"Prefer lighter functional tests over stress tests.\n"
"Return a JSON array of case names only, e.g. "
'["smoke_test", "verify_cpu_count"].'
)
Copy link

Copilot AI Mar 21, 2026

Choose a reason for hiding this comment

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

diff[:8000] is a hard-coded truncation limit that materially affects test selection quality/cost but isn’t documented or centralized. Consider making this a named constant with a brief rationale (and keep it consistent with the workflow’s head -c 30000 limit) to make future tuning safer.

Copilot uses AI. Check for mistakes.
Copilot AI review requested due to automatic review settings March 23, 2026 01:59
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 5 out of 5 changed files in this pull request and generated 3 comments.

Comment on lines +111 to +112
export PR_CHANGED_FILES=$(cat /tmp/changed_files.txt)
export PR_DIFF=$(head -c 30000 /tmp/pr_diff.txt)
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

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

The environment variable exports lose newlines and can mangle diff/file lists due to word-splitting (e.g., export PR_CHANGED_FILES=$(cat ...)). Quote the command substitutions so the Python script receives the intended content verbatim.

Suggested change
export PR_CHANGED_FILES=$(cat /tmp/changed_files.txt)
export PR_DIFF=$(head -c 30000 /tmp/pr_diff.txt)
export PR_CHANGED_FILES="$(cat /tmp/changed_files.txt)"
export PR_DIFF="$(head -c 30000 /tmp/pr_diff.txt)"

Copilot uses AI. Check for mistakes.
--jq '[.check_runs[] | select(.name | test("flake8|pylint|mypy|shellcheck|docs|test|example"; "i")) | select(.conclusion == "failure")] | length')
if [ "$FAILED" -gt 0 ]; then
echo "CI has $FAILED failed checks, skipping AI test selection"
exit 1
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

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

The CI-status gate says it’s “skipping AI test selection” when failures are detected, but it exits with code 1, which fails the job/workflow. If the intent is to skip selection (not fail), consider exiting 0 and setting outputs (case_count=0, case_names=) so downstream jobs and reporting behave predictably.

Suggested change
exit 1
# Do not fail the workflow; indicate that no tests should be selected.
if [ -n "${GITHUB_OUTPUT:-}" ]; then
echo "case_count=0" >> "$GITHUB_OUTPUT"
echo "case_names=" >> "$GITHUB_OUTPUT"
fi
exit 0

Copilot uses AI. Check for mistakes.
Comment on lines +86 to +114
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Get PR diff
env:
GH_TOKEN: ${{ github.token }}
run: |
gh pr diff ${{ steps.get-pr.outputs.pr_number }} --name-only > /tmp/changed_files.txt
gh pr diff ${{ steps.get-pr.outputs.pr_number }} > /tmp/pr_diff.txt
echo "Changed files:"
cat /tmp/changed_files.txt

- name: Run AI test case selector
id: select
env:
GITHUB_TOKEN: ${{ github.token }}
RUNBOOK_OUTPUT: ai_selected_cases.yml
run: |
export PR_CHANGED_FILES=$(cat /tmp/changed_files.txt)
export PR_DIFF=$(head -c 30000 /tmp/pr_diff.txt)
python .github/scripts/ai_select_cases.py

Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

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

This workflow checks out and executes .github/scripts/ai_select_cases.py from the PR branch while granting pull-requests: write and models: read. That allows untrusted PR code to run with write permissions (and could be abused to spam/modify PR comments, etc.). Consider checking out trusted code (default branch) for the selector script (similar to the trusted/ approach used later), or switching to pull_request_target with a trusted checkout, and only using the PR diff/content via GitHub API.

Copilot uses AI. Check for mistakes.
@github-actions
Copy link
Copy Markdown

✅ AI Test Selection — PASSED

12 test case(s) selected (view run)

Count
✅ Passed 12
❌ Failed 0
⏭️ Skipped 0
Total 12
Test case details
Test Case Status Time (s) Message
smoke_test (lisa_0_0) ✅ PASSED 41.118
verify_deployment_provision_synthetic_nic (lisa_0_2) ✅ PASSED 33.795
verify_deployment_provision_ephemeral_managed_disk (lisa_0_4) ✅ PASSED 41.498
verify_deployment_provision_standard_ssd_disk (lisa_0_3) ✅ PASSED 35.789
smoke_test_check_serial_console_pattern (lisa_0_1) ✅ PASSED 79.294
verify_deployment_provision_premiumv2_disk (lisa_0_6) ✅ PASSED 33.708
verify_deployment_provision_premium_disk (lisa_0_5) ✅ PASSED 40.824
verify_reboot_in_platform (lisa_0_8) ✅ PASSED 46.775
verify_deployment_provision_sriov (lisa_0_7) ✅ PASSED 55.880
verify_deployment_provision_ultra_datadisk (lisa_0_9) ✅ PASSED 40.495
verify_deployment_provision_swiotlb_force (lisa_0_11) ✅ PASSED 83.800
verify_stop_start_in_platform (lisa_0_10) ✅ PASSED 233.427

@microsoft microsoft deleted a comment from github-actions bot Mar 23, 2026
@microsoft microsoft deleted a comment from github-actions bot Mar 23, 2026
@microsoft microsoft deleted a comment from github-actions bot Mar 23, 2026
@microsoft microsoft deleted a comment from github-actions bot Mar 23, 2026
@github-actions
Copy link
Copy Markdown

✅ AI Test Selection — PASSED

12 test case(s) selected (view run)

Count
✅ Passed 12
❌ Failed 0
⏭️ Skipped 0
Total 12
Test case details
Test Case Status Time (s) Message
verify_deployment_provision_ephemeral_managed_disk (lisa_0_4) ✅ PASSED 35.304
verify_deployment_provision_synthetic_nic (lisa_0_2) ✅ PASSED 55.407
verify_deployment_provision_standard_ssd_disk (lisa_0_3) ✅ PASSED 56.591
smoke_test_check_serial_console_pattern (lisa_0_1) ✅ PASSED 46.855
smoke_test (lisa_0_0) ✅ PASSED 57.446
verify_deployment_provision_premium_disk (lisa_0_5) ✅ PASSED 67.806
verify_deployment_provision_ultra_datadisk (lisa_0_9) ✅ PASSED 34.454
verify_deployment_provision_premiumv2_disk (lisa_0_6) ✅ PASSED 48.910
verify_deployment_provision_sriov (lisa_0_7) ✅ PASSED 49.698
verify_reboot_in_platform (lisa_0_8) ✅ PASSED 45.343
verify_stop_start_in_platform (lisa_0_10) ✅ PASSED 87.080
verify_deployment_provision_swiotlb_force (lisa_0_11) ✅ PASSED 109.622

Copilot AI review requested due to automatic review settings March 27, 2026 05:32
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 4 out of 4 changed files in this pull request and generated 5 comments.

Comment on lines +8 to +12
1. Reads the PR diff (changed files + patch) from environment variables
set by the GitHub Actions workflow.
2. Enumerates all LISA test cases under microsoft/testsuites.
3. Calls the GitHub Models API (GPT-4o) to decide which test cases
are relevant to the code changes.
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

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

Docstring says test cases are enumerated under microsoft/testsuites, but the script’s primary search path is lisa/microsoft/testsuites (with a fallback). Consider updating the docstring to match the actual directory layout to avoid confusion for maintainers.

Copilot uses AI. Check for mistakes.
Comment on lines +1 to +3
name: AI Test Case Selection

on:
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

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

The PR description template is still largely blank (no concrete description of what/why, and no test validation filled in). Please add a description explaining what this PR does and why.

Copilot uses AI. Check for mistakes.
--jq '[.check_runs[] | select(.name | test("flake8|pylint|mypy|shellcheck|docs|test|example"; "i")) | select(.conclusion == "failure")] | length')
if [ "$FAILED" -gt 0 ]; then
echo "CI has $FAILED failed checks, skipping AI test selection"
exit 1
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

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

This step exits with status 1 when other CI checks have failed. That will mark the AI workflow itself as failed (adding another red check) even though the intent is to skip selection. Consider exiting 0 and setting outputs (e.g., case_count=0) or using continue-on-error so the workflow reports a clean skip instead of a failure.

Suggested change
exit 1
exit 0

Copilot uses AI. Check for mistakes.
run-lisa-tests:
name: Run LISA Tests
needs: ai-select-tests
if: needs.ai-select-tests.outputs.case_count > 0
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

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

This workflow runs Azure OIDC login and uses repository secrets. On pull_request events from forks, secrets aren’t available and you generally don’t want to attempt Azure runs for untrusted PRs. Add an explicit guard (e.g., only run when github.event.pull_request.head.repo.fork == false) to avoid noisy failures and reduce exposure.

Suggested change
if: needs.ai-select-tests.outputs.case_count > 0
if: >
needs.ai-select-tests.outputs.case_count > 0 &&
(github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false)

Copilot uses AI. Check for mistakes.
Comment on lines +291 to +323
import xml.etree.ElementTree as ET
import glob, os

junit_files = glob.glob("lisa-results/**/lisa.junit.xml", recursive=True)
if not junit_files:
exit(0)

tree = ET.parse(junit_files[0])
root = tree.getroot()

rows = []
passed = failed = skipped = 0
for suite in root.iter("testsuite"):
for tc in suite.iter("testcase"):
name = tc.get("name", "unknown")
time_s = tc.get("time", "0")
failure = tc.find("failure")
skip = tc.find("skipped")
if failure is not None:
status = "❌ FAILED"
msg = (failure.get("message") or "")[:120]
failed += 1
elif skip is not None:
status = "⏭️ SKIPPED"
msg = (skip.get("message") or "")[:120]
skipped += 1
else:
status = "✅ PASSED"
msg = ""
passed += 1
rows.append((name, status, time_s, msg))

# Summary
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

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

The embedded Python here-doc is indented (the Python code starts with leading spaces, and the PYEOF terminator is also indented later). Bash requires the heredoc terminator to start at column 0 unless using <<-, and the current indentation will also trigger Python IndentationError. Left-align the heredoc content/terminator (or switch to python3 - <<'PYEOF' / <<- with tabs) so this block runs correctly.

Suggested change
import xml.etree.ElementTree as ET
import glob, os
junit_files = glob.glob("lisa-results/**/lisa.junit.xml", recursive=True)
if not junit_files:
exit(0)
tree = ET.parse(junit_files[0])
root = tree.getroot()
rows = []
passed = failed = skipped = 0
for suite in root.iter("testsuite"):
for tc in suite.iter("testcase"):
name = tc.get("name", "unknown")
time_s = tc.get("time", "0")
failure = tc.find("failure")
skip = tc.find("skipped")
if failure is not None:
status = "❌ FAILED"
msg = (failure.get("message") or "")[:120]
failed += 1
elif skip is not None:
status = "⏭️ SKIPPED"
msg = (skip.get("message") or "")[:120]
skipped += 1
else:
status = "✅ PASSED"
msg = ""
passed += 1
rows.append((name, status, time_s, msg))
# Summary
import xml.etree.ElementTree as ET
import glob, os
junit_files = glob.glob("lisa-results/**/lisa.junit.xml", recursive=True)
if not junit_files:
exit(0)
tree = ET.parse(junit_files[0])
root = tree.getroot()
rows = []
passed = failed = skipped = 0
for suite in root.iter("testsuite"):
for tc in suite.iter("testcase"):
name = tc.get("name", "unknown")
time_s = tc.get("time", "0")
failure = tc.find("failure")
skip = tc.find("skipped")
if failure is not None:
status = "❌ FAILED"
msg = (failure.get("message") or "")[:120]
failed += 1
elif skip is not None:
status = "⏭️ SKIPPED"
msg = (skip.get("message") or "")[:120]
skipped += 1
else:
status = "✅ PASSED"
msg = ""
passed += 1
rows.append((name, status, time_s, msg))
# Summary

Copilot uses AI. Check for mistakes.
@github-actions
Copy link
Copy Markdown

❌ AI Test Selection — FAILED

103 test case(s) selected (view run)

Count
✅ Passed 77
❌ Failed 28
⏭️ Skipped 8
Total 113
Test case details
Test Case Status Time (s) Message
verify_azure_network_watcher (lisa_0_2) ✅ PASSED 208.717
verify_azure_disk_encryption_provisioned (lisa_0_4) ❌ FAILED 25.793 failed. ResourceNotFoundError: (ResourceGroupNotFound) Resource group 'azure-northcentralus-general-737b65ad-b7b7-43e1-a
verify_azure_disk_encryption_enabled (lisa_0_3) ❌ FAILED 29.878 failed. ResourceNotFoundError: (ResourceGroupNotFound) Resource group 'azure-northcentralus-general-737b65ad-b7b7-43e1-a
verify_azuremonitoragent_linux (lisa_0_1) ⏭️ SKIPPED 9.124 before_case skipped: Ubuntu 22.04.5 LTS is not supported.
verify_azure_performance_diagnostics (lisa_0_0) ⏭️ SKIPPED 9.048 before_case skipped: Ubuntu 22.04.5 LTS is not supported.
verify_application_health_extension (lisa_0_9) ✅ PASSED 160.329
verify_key_vault_extension (lisa_0_13) ❌ FAILED 5.562 failed. ResourceNotFoundError: (ResourceGroupNotFound) Resource group 'azure-northcentralus-general-737b65ad-b7b7-43e1-a
verify_vm_agent (lisa_0_5) ✅ PASSED 40.656
verify_cpu_count (lisa_0_65) ✅ PASSED 2.102
verify_dhcp_client_timeout (lisa_0_66) ✅ PASSED 2.503
verify_dns_name_resolution (lisa_0_56) ✅ PASSED 2.980
verify_dns_name_resolution_after_upgrade (lisa_0_57) ✅ PASSED 177.952
verify_initrd_modules (lisa_0_68) ✅ PASSED 52.566
verify_hyperv_modules (lisa_0_69) ✅ PASSED 6.481
verify_lis_modules_version (lisa_0_67) ⏭️ SKIPPED 0.257 skipped: Ubuntu not supported. This test case only supports Redhat distros.
verify_reload_hyperv_modules (lisa_0_70) ✅ PASSED 331.977
verify_metricsextension (lisa_0_6) ⏭️ SKIPPED 9.149 skipped: Unsupported system: 'Ubuntu 22.04.5 LTS'. MetricsExtension doesn't support this version.
verify_vm_assess_patches (lisa_0_10) ✅ PASSED 187.299
verify_vm_install_patches (lisa_0_11) ✅ PASSED 697.897
verify_vmbus_devices_channels (lisa_0_53) ✅ PASSED 12.231
verify_vmbus_heartbeat_properties (lisa_0_54) ✅ PASSED 13.199
verify_ringbuffer_settings_change (lisa_0_34) ✅ PASSED 9.658
verify_device_channels_change (lisa_0_35) ✅ PASSED 8.387
verify_device_enabled_features (lisa_0_36) ✅ PASSED 6.397
verify_device_gro_lro_settings_change (lisa_0_37) ✅ PASSED 7.469
verify_device_rss_hash_key_change (lisa_0_38) ✅ PASSED 7.208
verify_device_rx_hash_level_change (lisa_0_39) ✅ PASSED 8.285
verify_device_msg_level_change (lisa_0_40) ✅ PASSED 12.466
verify_device_statistics (lisa_0_41) ✅ PASSED 323.169
verify_existing_script_run (lisa_0_91) ✅ PASSED 61.448
verify_custom_script_run (lisa_0_92) ✅ PASSED 63.861
verify_script_run_with_named_parameter (lisa_0_93) ✅ PASSED 63.721
verify_script_run_with_unnamed_parameter (lisa_0_94) ✅ PASSED 32.921
verify_private_uri_script_run_failed (lisa_0_97) ❌ FAILED 0.559 failed. ClientAuthenticationError: Server failed to authenticate the request. Please refer to the information in the www
verify_sas_uri_script_run (lisa_0_98) ❌ FAILED 0.534 failed. ClientAuthenticationError: Server failed to authenticate the request. Please refer to the information in the www
verify_script_run_with_protected_parameter (lisa_0_95) ✅ PASSED 32.880
verify_script_run_with_timeout (lisa_0_99) ✅ PASSED 33.111
verify_script_run_with_timeout_failed (lisa_0_100) ✅ PASSED 63.332
verify_script_run_with_valid_user (lisa_0_101) ✅ PASSED 94.198
verify_script_run_with_invalid_user (lisa_0_102) ✅ PASSED 124.922
verify_public_uri_script_run (lisa_0_96) ❌ FAILED 0.587 failed. ClientAuthenticationError: Server failed to authenticate the request. Please refer to the information in the www
verify_sriov_disable_enable (lisa_0_44) ✅ PASSED 68.230
verify_sriov_provision_with_max_nics (lisa_0_48) ⏭️ SKIPPED 0.000 deployment skipped: gen1 image shouldn't run on gen2 vm size. BadRequest: The selected VM size 'Standard_D2ads_v6' canno
verify_sriov_basic (lisa_0_43) ✅ PASSED 44.138
verify_sriov_reload_modules (lisa_0_49) ⏭️ SKIPPED 0.000 deployment skipped: gen1 image shouldn't run on gen2 vm size. BadRequest: The selected VM size 'Standard_D2ads_v6' canno
verify_sriov_disable_enable_pci (lisa_0_45) ✅ PASSED 61.661
verify_sriov_disable_enable_on_guest (lisa_0_46) ✅ PASSED 53.052
verify_sriov_add_max_nics (lisa_0_47) ✅ PASSED 237.839
verify_sriov_ethtool_offload_setting (lisa_0_50) ✅ PASSED 364.909
verify_sriov_interrupts_change (lisa_0_52) ✅ PASSED 229.712
verify_irqbalance (lisa_0_51) ✅ PASSED 323.581
verify_valid_password_run (lisa_0_71) ✅ PASSED 67.216
verify_openssh_key_run (lisa_0_72) ✅ PASSED 37.142
verify_password_and_ssh_key_run (lisa_0_73) ✅ PASSED 33.835
verify_pem_certificate_ssh_key_run (lisa_0_75) ✅ PASSED 33.327
verify_no_password_and_ssh_key_run_failed (lisa_0_74) ✅ PASSED 66.703
verify_ssh2_key_run (lisa_0_76) ✅ PASSED 64.843
verify_remove_username_run (lisa_0_77) ✅ PASSED 64.499
verify_valid_expiration_run (lisa_0_78) ✅ PASSED 64.275
verify_exclude_disk_support_restore_point (lisa_0_8) ✅ PASSED 165.827
verify_vmsnapshot_extension (lisa_0_7) ✅ PASSED 274.896
verify_private_script_without_sas_run_failed (lisa_0_87) ❌ FAILED 0.670 failed. ClientAuthenticationError: Server failed to authenticate the request. Please refer to the information in the www
verify_private_sas_script_run (lisa_0_89) ❌ FAILED 0.566 failed. ClientAuthenticationError: Server failed to authenticate the request. Please refer to the information in the www
verify_base64_script_with_command_run (lisa_0_84) ✅ PASSED 61.573
verify_public_script_run (lisa_0_79) ❌ FAILED 0.549 failed. ClientAuthenticationError: Server failed to authenticate the request. Please refer to the information in the www
verify_second_public_script_run (lisa_0_80) ❌ FAILED 0.527 failed. ClientAuthenticationError: Server failed to authenticate the request. Please refer to the information in the www
verify_script_in_both_settings_failed (lisa_0_81) ❌ FAILED 0.562 failed. ClientAuthenticationError: Server failed to authenticate the request. Please refer to the information in the www
verify_public_script_protected_settings_run (lisa_0_82) ❌ FAILED 0.522 failed. ClientAuthenticationError: Server failed to authenticate the request. Please refer to the information in the www
verify_public_script_without_command_run (lisa_0_83) ❌ FAILED 0.579 failed. ClientAuthenticationError: Server failed to authenticate the request. Please refer to the information in the www
verify_public_script_with_base64_script_run (lisa_0_85) ❌ FAILED 0.581 failed. ClientAuthenticationError: Server failed to authenticate the request. Please refer to the information in the www
verify_public_script_with_gzip_base64_script_run (lisa_0_86) ❌ FAILED 0.554 failed. ClientAuthenticationError: Server failed to authenticate the request. Please refer to the information in the www
verify_private_script_with_storage_credentials_run (lisa_0_88) ❌ FAILED 0.567 failed. ClientAuthenticationError: Server failed to authenticate the request. Please refer to the information in the www
verify_public_python_script_run (lisa_0_90) ❌ FAILED 0.595 failed. ClientAuthenticationError: Server failed to authenticate the request. Please refer to the information in the www
verify_private_sas_script_run (lisa_0_111) ❌ FAILED 0.544 failed. ClientAuthenticationError: Server failed to authenticate the request. Please refer to the information in the www
verify_public_script_run (lisa_0_103) ❌ FAILED 0.588 failed. ClientAuthenticationError: Server failed to authenticate the request. Please refer to the information in the www
verify_second_public_script_run (lisa_0_104) ❌ FAILED 0.671 failed. ClientAuthenticationError: Server failed to authenticate the request. Please refer to the information in the www
verify_script_in_both_settings_failed (lisa_0_105) ❌ FAILED 0.565 failed. ClientAuthenticationError: Server failed to authenticate the request. Please refer to the information in the www
verify_public_script_protected_settings_run (lisa_0_106) ❌ FAILED 0.582 failed. ClientAuthenticationError: Server failed to authenticate the request. Please refer to the information in the www
verify_public_script_with_base64_script_run (lisa_0_107) ❌ FAILED 0.564 failed. ClientAuthenticationError: Server failed to authenticate the request. Please refer to the information in the www
verify_public_script_with_gzip_base64_script_run (lisa_0_108) ❌ FAILED 0.543 failed. ClientAuthenticationError: Server failed to authenticate the request. Please refer to the information in the www
verify_private_script_with_storage_credentials_run (lisa_0_110) ❌ FAILED 0.627 failed. ClientAuthenticationError: Server failed to authenticate the request. Please refer to the information in the www
verify_public_python_script_run (lisa_0_112) ❌ FAILED 0.624 failed. ClientAuthenticationError: Server failed to authenticate the request. Please refer to the information in the www
verify_private_script_without_sas_run_failed (lisa_0_109) ❌ FAILED 9.590 failed. ClientAuthenticationError: Server failed to authenticate the request. Please refer to the information in the www
verify_serial_console (lisa_0_55) ✅ PASSED 33.836
verify_asr_by_cvt (lisa_0_12) ⏭️ SKIPPED 0.299 before_case skipped: cvtbinaries_sasuri is not provided.
verify_lsvmbus (lisa_0_23) ⏭️ SKIPPED 0.000 deployment skipped: gen1 image shouldn't run on gen2 vm size. BadRequest: The selected VM size 'Standard_DC2eds_v6' cann
verify_hibernation_sriov_network (lisa_0_25) ✅ PASSED 306.119
verify_hibernation_synthetic_network (lisa_0_24) ✅ PASSED 306.800
verify_hibernation_with_vm_extension (lisa_0_33) ✅ PASSED 212.873
verify_hibernation_with_storage_workload (lisa_0_28) ✅ PASSED 672.764
verify_hibernation_synthetic_network_max_nics (lisa_0_30) ✅ PASSED 276.802
verify_hibernation_sriov_network_max_nics (lisa_0_31) ✅ PASSED 261.261
verify_hibernation_time_sync (lisa_0_26) ✅ PASSED 916.926
verify_hibernation_max_data_disks (lisa_0_32) ❌ FAILED 0.000 deployment failed. LisaException: InvalidTemplate: Deployment template validation failed: 'The resource 'Microsoft.Compu
verify_hibernation_with_memory_workload (lisa_0_29) ✅ PASSED 892.236
verify_hibernation_with_network_workload (lisa_0_27) ✅ PASSED 570.643
verify_network_interface_reload_via_ip_link (lisa_0_42) ✅ PASSED 48.369
verify_deployment_provision_synthetic_nic (lisa_0_59) ✅ PASSED 42.681
smoke_test (lisa_0_58) ✅ PASSED 68.811
verify_deployment_provision_premium_disk (lisa_0_61) ✅ PASSED 34.196
verify_deployment_provision_standard_ssd_disk (lisa_0_60) ✅ PASSED 44.360
verify_deployment_provision_ultra_datadisk (lisa_0_63) ✅ PASSED 35.652
verify_reboot_in_platform (lisa_0_62) ✅ PASSED 166.114
verify_stop_start_in_platform (lisa_0_64) ✅ PASSED 82.533
verify_nvme_basic (lisa_0_14) ✅ PASSED 14.364
verify_nvme_rescind (lisa_0_21) ✅ PASSED 9.846
verify_nvme_function (lisa_0_16) ✅ PASSED 23.716
verify_nvme_function_unpartitioned (lisa_0_17) ✅ PASSED 22.429
verify_nvme_sriov_rescind (lisa_0_22) ✅ PASSED 16.102
verify_nvme_blkdiscard (lisa_0_19) ✅ PASSED 9.002
verify_nvme_manage_ns (lisa_0_20) ✅ PASSED 15.593
verify_nvme_fstrim (lisa_0_18) ✅ PASSED 185.176
verify_nvme_max_disk (lisa_0_15) ✅ PASSED 15.196

Copy link
Copy Markdown
Collaborator

@johnsongeorge-w johnsongeorge-w left a comment

Choose a reason for hiding this comment

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

Review the copilot review recommendation.

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.

3 participants