-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Script to run tests in batches, with several modes and for a variable number of iterations #5002
Conversation
… number of iterations
…ariable number of iterations Address comments
🎉 All Contributor License Agreements have been signed. Ready to merge. |
There was a problem hiding this 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 a Python script that runs tests in batches, providing flexible options for test selection, batching, and iterations. Key changes include:
- Adding a new script to collect and sort tests based on file names.
- Implementing batch execution with configurable iteration counts and error handling.
- Integrating environment variables to control test selection and execution behavior.
test_num = int(m.group(1)) | ||
if test_num < max_automatic_tests: | ||
tests.add(test_num) | ||
max_test = max(tests) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If no test files are found, the call to max(tests) will raise a ValueError. Consider adding a check to ensure that 'tests' is not empty before computing max(tests), or provide a default value.
max_test = max(tests) | |
max_test = max(tests) if tests else 0 |
Copilot is powered by AI, so mistakes are possible. Review output carefully before use.
test_iterations = test_iterations.isnumeric() and int(test_iterations) or 1 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Using 'and/or' for conversion may unintentionally override a valid zero value. It might be clearer and safer to use a more explicit conditional expression to set test_iterations.
test_iterations = test_iterations.isnumeric() and int(test_iterations) or 1 | |
if test_iterations.isnumeric(): | |
test_iterations = int(test_iterations) | |
else: | |
test_iterations = 1 |
Copilot is powered by AI, so mistakes are possible. Review output carefully before use.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved as reviewed earlier, comment addressed.
Review: #4970
No description provided.