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

Running in parallel #358

Merged
merged 33 commits into from
Oct 11, 2024
Merged

Running in parallel #358

merged 33 commits into from
Oct 11, 2024

Conversation

Chemaclass
Copy link
Member

@Chemaclass Chemaclass commented Oct 9, 2024

πŸ“š Description

Closes: #354

πŸ”– Changes

  • Add parallel running: -p|--parallel
  • Add possibility of disabling parallel execution with --no-parallel

βœ… To-do list

  • I updated the CHANGELOG.md to reflect the new feature or fix
  • I updated the documentation to reflect the changes

πŸ–ΌοΈ Screenshots

Running the entire test suite sync (~43s)

Screenshot 2024-10-10 at 01 12 16

Running the entire test suite in parallel (~15s) - 65.12% improment! πŸš€

Screenshot 2024-10-10 at 01 39 12

Running parallel tests (detailed)

Screenshot 2024-10-10 at 01 55 41

Documentation

Screenshot 2024-10-10 at 00 34 07

@Chemaclass Chemaclass added the enhancement New feature or request label Oct 9, 2024
@Chemaclass Chemaclass self-assigned this Oct 9, 2024
@Chemaclass Chemaclass marked this pull request as draft October 9, 2024 21:34
@Chemaclass Chemaclass marked this pull request as ready for review October 9, 2024 23:57
Copy link
Contributor

@CosmeValera CosmeValera left a comment

Choose a reason for hiding this comment

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

Good job as always !!!

Copy link
Member

@khru khru left a comment

Choose a reason for hiding this comment

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

I would just say that for me parallel testing should always be the default way to run, as it is not just for performance, but also to know that your tests do not depend on each other,

I would rather suggest that it be always active by default in subsequent versions and that it can be disabled.

That's my opinion, I think that the value that active brings is always greater, and that only in case you need to disable it because your code needs it, you do it.

This opens up other issues such as being able to prevent a test file from being launched in parallel, this is common in other testing frameworks.

@khru
Copy link
Member

khru commented Oct 11, 2024

The tests are not good in alpine

@khru khru requested review from antonio-gg-dev, khru and cmayo October 11, 2024 16:55
@Chemaclass
Copy link
Member Author

Chemaclass commented Oct 11, 2024

I would rather not keep the parallel testing as default behavior but as it was until now.
This is the default behavior on PHPUnit, Pest, JUnit, among others. However I found that Jest run them in parallel "when it make sense" based on some heuristic -size of tests, number of tests, etc... but I find this too complicated to get into this right now.

Aiming for simplicity, I am in favor of:
If you want parallel tests you can enable with -p|--parallel or in your .env BASHUNIT_PARALLEL_RUN=true


PS: Yes, I saw something is not good in alpine. I will check it... πŸ—οΈ

@Chemaclass Chemaclass force-pushed the feat/running-in-parallel branch from 9bdf244 to 170f064 Compare October 11, 2024 20:34
@Chemaclass Chemaclass force-pushed the feat/running-in-parallel branch from 7c70e3f to 8bb1d1a Compare October 11, 2024 21:14
@Chemaclass Chemaclass force-pushed the feat/running-in-parallel branch from 8bb1d1a to 155e694 Compare October 11, 2024 21:42
@Chemaclass Chemaclass merged commit 2c202b8 into main Oct 11, 2024
13 checks passed
@Chemaclass Chemaclass deleted the feat/running-in-parallel branch October 11, 2024 22:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enable running tests in parallel
4 participants