Skip to content
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

Merged
merged 2 commits into from
Mar 25, 2025

Conversation

emasab
Copy link
Contributor

@emasab emasab commented Mar 24, 2025

No description provided.

@Copilot Copilot bot review requested due to automatic review settings March 24, 2025 20:05
@emasab emasab requested a review from a team as a code owner March 24, 2025 20:05
@confluent-cla-assistant
Copy link

🎉 All Contributor License Agreements have been signed. Ready to merge.
Please push an empty commit if you would like to re-run the checks to verify CLA status for all contributors.

Copy link

@Copilot 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 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)
Copy link
Preview

Copilot AI Mar 24, 2025

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.

Suggested change
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.

Comment on lines +51 to +52
test_iterations = test_iterations.isnumeric() and int(test_iterations) or 1

Copy link
Preview

Copilot AI Mar 24, 2025

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.

Suggested change
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.

Copy link
Contributor

@milindl milindl left a 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

@emasab emasab merged commit b911183 into master Mar 25, 2025
2 checks passed
@emasab emasab deleted the dev_script_run_tests_batches branch March 25, 2025 07:55
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.

2 participants