mocha
                                
                                 mocha copied to clipboard
                                
                                    mocha copied to clipboard
                            
                            
                            
                        Fix parallel feature: disable parallel automatically/ add command line option
Requirements
- Filling out the template is required. Any pull request that does not include enough information to be reviewed in a timely manner may be closed at the maintainers' discretion.
- All new code requires tests to ensure against regressions.
Description of the Change
This PR comes from the idea #4322
AS-IS
[single run]
[parallel run]
(1) fix parallel feature : When running a single file, disable parallel mode automatically.
If we run only a single file in parallel mode, it is much slower. So I added a feature to automate swap from parallel mode to single mode when we're running a single file.
(2) Added Command Line Option: added an option to FORCE PARALLEL MODE in (1) situation
Alternate Designs
Why should this be in core?
Benefits
When running a single file, Mocha automatically run in a faster way.
Possible Drawbacks
There must be a way to force parallel mode when running a single file if needed.
Applicable issues
I'm working on failed test cases!
I am still working on test cases and PRs.
I am unsure if this would be a breaking change. Ideally, it would not have any impact on consumers, but... you never know. @mochajs/core thoughts?
Please mark this PR as "ready" when the tests are passing
Please mark this PR as "ready" when the tests are passing Thank you for your opinion!
I also don't think many customers would run a single file in parallel option. And that's the point where I thought to predict running time and automatize running mode. For example we can test on many different files and how much time it needs to run -> if we have our standard we can automize running mode. This is just my opinion!
And I will do mark PR when test passed.
@stoicchild8910
I also don't think many customers would run a single file in parallel option.
right, consumers may not, but Mocha needs to do so in order to efficiently test parallel mode.  so this is why I'd want --force-parallel
👋 coming back to this @stoicchild8910, are you still interested in working on this PR? As of https://github.com/mochajs/mocha/issues/5027 there are again maintainers who can review it now. No worries if you no longer have time - but if you do that'd be great!