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

feat(test): add --parallel flag, soft deprecate --jobs #15259

Merged
merged 7 commits into from
Jul 20, 2022

Conversation

dsherret
Copy link
Member

@dsherret dsherret commented Jul 20, 2022

Soft deprecation of --jobs flag. There are some problems with it as outlined in #14533 (comment)

In summary:

  1. --jobs is not easy to use on its own as a binary option because it doesn't require an equals sign after it. So if you do something like deno test --jobs test_file.ts it will fail parsing "test_file.ts" to a number.
  2. The number of CPUs that should be run is system dependent and so it should be an environment variable.
  3. This is a better name that I think will help with use. Jobs is not descriptive. Additionally it will make it easy to add a "parallel": true to the config file in the future.

Supersedes #15225
Closes #14533

Co-authored-by: @mrkldshv

Defaults to number of available CPUs when used with
--jobs flag and no value is provided.
Defaults to 1 when --jobs flag is not used.
DENO_JOBS Number of parallel workers used for the --parallel
Copy link
Member Author

Choose a reason for hiding this comment

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

I thought about renaming this, but DENO_MAX_PARALLELISM is long. Additionally, cargo uses CARGO_JOBS for this env variable, so I think it makes sense? We can also reuse this env var for deno fmt and lint in the future. Thoughts?

Copy link
Member

Choose a reason for hiding this comment

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

Sounds good to me 👍

cli/args/flags.rs Outdated Show resolved Hide resolved
Copy link
Member

@lucacasonato lucacasonato left a comment

Choose a reason for hiding this comment

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

LGTM

@dsherret dsherret merged commit 26cea0e into denoland:main Jul 20, 2022
@dsherret dsherret deleted the test_parallel_flag branch July 20, 2022 21:36
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.

deno test --jobs flag should require equals when passing a value
4 participants