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

Log plugins in ArtifactsManager are not compatible with detox.init(... launchApp: false ...) option. #856

Closed
noomorph opened this issue Jul 24, 2018 · 0 comments

Comments

@noomorph
Copy link
Collaborator

When the app does not get launched inside detox.init(...) call, then beforeAll hook in log plugins (ADBLogcatPlugin is affected and SimulatorLogPlugin might be too) has no actual opportunity to read app logs. This is completely reasonable since there is no app running to start with.

Users are getting exceptions like this:

Caught exception inside plugin (ADBLogcatPlugin) at phase onBeforeEach
 DetoxRuntimeError: DetoxRuntimeError: Detox Artifacts API had no app pid at the time of calling
     at Object.getPid (/Users/kevinlalka/Projects/dev/project-react-native-porting/node_modules/detox/src/artifacts/Art
ifactsManager.js:58:17)
     at ADBLogcatPlugin.createTestRecording (/Users/kevinlalka/Projects/dev/project-react-native-porting/node_modules/d
etox/src/artifacts/log/android/ADBLogcatPlugin.js:25:26)
     at ADBLogcatPlugin.createTestArtifact (/Users/kevinlalka/Projects/dev/project-react-native-porting/node_modules/de
tox/src/artifacts/templates/plugin/WholeTestRecorderPlugin.js:42:17)
     at ADBLogcatPlugin.onBeforeEach (/Users/kevinlalka/Projects/dev/project-react-native-porting/node_modules/detox/sr
c/artifacts/templates/plugin/WholeTestRecorderPlugin.js:17:30)
     at <anonymous>
     at process._tickCallback (internal/process/next_tick.js:188:7)

This needs to be addressed by rewriting logic of abstract base class StartupAndTestRecordingPlugin and the implementations of SimulatorLogPlugin and ADBLogcatPlugin accordingly. They should mostly rely on onLaunchApp hook rather than onBeforeAll.

@noomorph noomorph self-assigned this Jul 24, 2018
noomorph added a commit that referenced this issue Jul 31, 2018
noomorph added a commit that referenced this issue Jul 31, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Aug 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants