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(config): skipLegacyWorkersInjection #2872

Merged
merged 5 commits into from
Jul 10, 2021
Merged

Conversation

noomorph
Copy link
Collaborator

@noomorph noomorph commented Jul 2, 2021

Description

In this pull request, I have added skipLegacyWorkersInjection: boolean to Detox.DetoxConfig, so that detox test command avoids the permanent passthrough of --workers 1 to Jest by default. For the opposite case, when a user specifies a custom workers number via -w, --workers <count> CLI option, the previous behavior remains the same.

 {
   testRunner: 'nyc jest',
   runnerConfig: 'e2e/config.js',
+  skipLegacyWorkersInjection: true,

From now on, the default Jest config file generated by detox init -r jest contains maxWorkers: 1 to prevent an unintended overallocation of devices if there are multiple test files — an average personal computer is likely to have a problem with more than 3-4 simulators/emulators running at once, therefore we add a safeguard mechanism this way.

 {
+    "maxWorkers": 1,
     "testEnvironment": "./environment",
     "testRunner": "jest-circus/runner",
     "testTimeout": 120000,
     "testRegex": "\\\\.e2e\\\\.js$",
     "reporters": ["detox/runners/jest/streamlineReporter"],
     "verbose": true
 }

The temporary flag, skipLegacyWorkersInjection is intended to be removed in the next Detox major release in favor of the new behavior added with this pull request.

For features/enhancements:

  • I have added/updated the relevant references in the documentation files.

For API changes:

  • I have made the necessary changes in the types index file.

@noomorph noomorph marked this pull request as ready for review July 10, 2021 07:06
@noomorph noomorph requested a review from d4vidi as a code owner July 10, 2021 07:06
@noomorph noomorph merged commit c6f4f03 into master Jul 10, 2021
@noomorph noomorph deleted the feat/skip-legacy-workers branch July 10, 2021 07:17
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