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(cli): detached runner #4260

Merged
merged 1 commit into from
Nov 1, 2023
Merged

feat(cli): detached runner #4260

merged 1 commit into from
Nov 1, 2023

Conversation

noomorph
Copy link
Collaborator

Description

In this pull request, I have added a new feature, detached mode for test runners.

testRunner.detached [boolean]

Default: false.

When true, tells detox test to spawn the test runner in a detached mode.

This is useful in CI environments, where you want to intercept SIGINT and SIGTERM signals to gracefully shut down the test runner and the device.

Instead of passing the kill signal to the child process (the test runner), Detox will send an emergency shutdown request to all the workers, and then it will wait for them to finish.

Example

     args: {
       $0: 'jest',
       config: 'e2e/jest.config.js',
+      forceExit: process.env.CI ? true : undefined,
       _: ['e2e/'],
     },
+    detached: !!process.env.CI,
     retries: process.env.CI ? 1 : undefined,

Detox will exit indirectly through Jest using the same mechanism as in our --bail workaround (#4115). If some tests don't clean up well, --forceExit will help to shut down in time.


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.

Copy link
Contributor

@asafkorem asafkorem left a comment

Choose a reason for hiding this comment

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

LGTM 👍🏼

detox/local-cli/test.test.js Show resolved Hide resolved
@noomorph noomorph merged commit 6e87dc1 into master Nov 1, 2023
7 checks passed
@noomorph noomorph deleted the feat/detached-runner branch November 1, 2023 11:46
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