fix: enhance pytest command processing to skip cases in exclusion list#34708
fix: enhance pytest command processing to skip cases in exclusion list#34708
Conversation
…ng Jenkins agents
Summary of ChangesHello, 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 Highlights
🧠 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 AssistThe 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
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 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
|
There was a problem hiding this comment.
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 raiseIndexErrorand 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.
There was a problem hiding this comment.
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.
…ance cleanup diagnostics for Windows
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
No description provided.