gh-132678: Add --prioritize to regrtest#132679
Merged
ambv merged 4 commits intopython:mainfrom Apr 18, 2025
Merged
Conversation
This is an option that allows the user to specify, which selected tests should execute first, even if the order is otherwise randomized. This is particularly useful for tests that run the longest.
Contributor
Author
|
I asked Copilot for a review, because it's Friday and what can possibly go wrong. |
There was a problem hiding this comment.
Pull Request Overview
This PR introduces the --prioritize option to regrtest, allowing users to specify tests that should execute first regardless of the randomized order. Key changes include initializing a new instance variable for prioritized tests, reordering selected tests in the test discovery phase, and updating the command-line parser help text and argument processing to support the new option.
Reviewed Changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| Lib/test/libregrtest/main.py | Added a prioritized tests list and logic to reposition prioritized tests |
| Lib/test/libregrtest/cmdline.py | Updated help texts and argument parsing to support the --prioritize option |
Files not reviewed (1)
- Misc/NEWS.d/next/Tests/2025-04-18-14-00-38.gh-issue-132678.j_ZKf2.rst: Language not supported
Comments suppressed due to low confidence (1)
Lib/test/libregrtest/cmdline.py:572
- [nitpick] The loop variable 'priority_list' shadows the function name 'priority_list'. Consider renaming it (e.g. 'priority_group' or 'priority_item') for improved clarity.
for priority_list in (ns.prioritize or ())
pablogsal
reviewed
Apr 18, 2025
pablogsal
reviewed
Apr 18, 2025
pablogsal
approved these changes
Apr 18, 2025
Member
pablogsal
left a comment
There was a problem hiding this comment.
LGTM
left some comments feel free to ignore
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is an option that allows the user to specify which selected tests should execute first, even if the order is otherwise randomized. This is particularly useful for tests that run the longest or for tests most likely to fail when
--failfastis specified.