mocha icon indicating copy to clipboard operation
mocha copied to clipboard

Fix parallel feature: disable parallel automatically/ add command line option

Open stoicchild8910 opened this issue 5 years ago • 8 comments

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] parallelrun [parallel run] singlerun

(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

stoicchild8910 avatar Aug 29 '20 12:08 stoicchild8910

CLA assistant check
All committers have signed the CLA.

jsf-clabot avatar Aug 29 '20 12:08 jsf-clabot

I'm working on failed test cases!

stoicchild8910 avatar Aug 30 '20 08:08 stoicchild8910

I am still working on test cases and PRs.

stoicchild8910 avatar Aug 30 '20 15:08 stoicchild8910

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?

boneskull avatar Sep 02 '20 19:09 boneskull

Please mark this PR as "ready" when the tests are passing

boneskull avatar Sep 02 '20 19:09 boneskull

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 avatar Sep 03 '20 10:09 stoicchild8910

@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

boneskull avatar Oct 12 '20 22:10 boneskull

👋 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!

JoshuaKGoldberg avatar Mar 01 '24 21:03 JoshuaKGoldberg