Skip to content

fix: enhance pytest command processing to skip cases in exclusion list#34708

Open
tomchon wants to merge 25 commits intomainfrom
enh/ref-skip-case
Open

fix: enhance pytest command processing to skip cases in exclusion list#34708
tomchon wants to merge 25 commits intomainfrom
enh/ref-skip-case

Conversation

@tomchon
Copy link
Contributor

@tomchon tomchon commented Mar 8, 2026

No description provided.

tomchon added 19 commits March 5, 2026 09:54
@tomchon tomchon requested a review from a team as a code owner March 8, 2026 06:15
Copilot AI review requested due to automatic review settings March 8, 2026 06:15
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request refactors the run_win_cases.py script to improve its maintainability and clarity. The changes streamline the parsing of pytest commands by removing unnecessary format validation and enhance code readability through the addition of descriptive comments for test case name extraction. This simplifies the logic for identifying and potentially skipping test cases during Windows CI runs.

Highlights

  • Code Cleanup: Removed a duplicate 'import signal' statement.
  • Pytest Command Parsing Refinement: Simplified the parsing logic for pytest commands by removing specific format validation for priority, rerun times, and sanitizer flags.
  • Code Clarity: Added clarifying comments to explain the purpose of extracting 'case_base_name' and 'case_name' from pytest commands.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
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

Updates the Windows CI pytest-case runner to better support skipping unsupported cases (via an exclusion list) while simplifying how pytest commands are extracted from the task file lines.

Changes:

  • Simplified parsing of task-file lines to extract the pytest command.
  • Annotated extracted case name / base name usage for exclusion-list matching.
Comments suppressed due to low confidence (2)

test/ci/run_win_cases.py:203

  • Typo in log message: "runnning" should be "running" (and the sentence could be adjusted for grammar, e.g., "does not support running on Windows").
            case_base_name = pytest_cmd.split(" ")[1]  # 获取用例无参数名称用于与排除用例列表比对
            if case_base_name and len(exclusion_list) > 0 and case_base_name in exclusion_list:
                skipped_cases += 1
                logger.info(f"Case {case_base_name} not support runnning on Windows. Skip test.")
                result_str = f"Skip\t{pytest_cmd}\t\t\t\n"

test/ci/run_win_cases.py:194

  • The pytest command parsing now relies on line.split(...)[1] with hard-coded tokens ("ci/pytest.sh " / ",,n,.,"), and the earlier column-count/sanitizer validation was removed. If the input format changes or a line doesn't contain the expected token, this will raise IndexError and abort the whole run. Consider restoring the safer CSV parsing/validation (split into columns and read the command field), or at least guard the split and log+continue on malformed lines.
            # 解析pytest命令
            if "ci/pytest.sh " in line:
                pytest_cmd = line.split("ci/pytest.sh ")[1]
            else:
                pytest_cmd = line.split(",,n,.,")[1]


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the case skipping logic in test/ci/run_win_cases.py. My review identifies a couple of issues: a duplicated module import and the removal of input validation logic which could lead to a crash. I've provided suggestions to address these points to improve code quality and robustness.

@tomchon tomchon changed the title Enh/ref skip case fix: enhance pytest command processing to skip cases in exclusion list Mar 8, 2026
Copilot AI review requested due to automatic review settings March 9, 2026 03:18
Copy link
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 2 out of 2 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Copilot AI review requested due to automatic review settings March 10, 2026 10:18
Copy link
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 2 out of 2 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

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