Skip to content

Conversation

zloit
Copy link

@zloit zloit commented May 6, 2025

This PR introduces a new configuration option parallelRepeats that gives users control over how repeated tests are executed:

New features
- Add parallelRepeats option (default: true)
Parallel mode (true): All test repeats are queued upfront for maximum throughput
Sequential mode (false): Each repeat is queued only after the previous one completes

Usage example

// In testplane config
plugins: {
  '@testplane/test-repeater': {
    repeat: 5,
    parallelRepeats: false // run repeats sequentially
  }
}

Add 'parallelRepeats' option to control how test repeats are queued:
- When true (default): all repeats are queued immediately for parallel execution
- When false: repeats are queued one by one after each test completion
Copy link
Member

@DudaGod DudaGod left a comment

Choose a reason for hiding this comment

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

Looks like that everything works fine, but to my mind RepeatCounter class shouldn't be responsible for tests repeat. We should just implement new method in Counter class for this purpose. Can we fix it? Thank you for your contribution.

@@ -21,6 +23,9 @@ module.exports = class RepeatCounter {

if (repeatsLeft > 0) {
logger.info(`Will be repeated. Repeats left: ${repeatsLeft}`);
if (!this._parallelRepeats) {
this._testplane.addTestToRun(test, test.browserId);
Copy link
Member

Choose a reason for hiding this comment

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

repeatCounter should not be responsible for repeating tests. It is just a counter.

We should implement additional method in Repeater which will be called if there are additional repeats for ended test.

- RepeatCounter is now only responsible for counting repeats
- Repeater handles test repetition logic via new handleTestEnd() method
- Updated documentation for parallelRepeats parameter in both languages
- Added comprehensive tests for new functionality
- All tests passing

Fixes review feedback about RepeatCounter responsibilities
Copy link
Member

@DudaGod DudaGod left a comment

Choose a reason for hiding this comment

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

🔥

@DudaGod DudaGod merged commit 767d19b into gemini-testing:master May 31, 2025
0 of 6 checks passed
@DudaGod
Copy link
Member

DudaGod commented May 31, 2025

Thank you for your contribution. The changes have been released in @testplane/[email protected]

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