question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Need help running detox tests for android on Github Actions

See original GitHub issue

Description

I am able to run this detox test for android on my local computer, but not on Github Actions. The iOS works both local and on Github Actions.

Can I get more ideas to try, guidance or ways to debug this?

I’ve tried many different ways, but it all leads to this error:

Error log
$ detox test -c android.emu.release --cleanup --headless
15:52:30.158 detox[98451] INFO:  [test.js] DETOX_CLEANUP=true DETOX_CONFIGURATION="android.emu.release" DETOX_HEADLESS=true DETOX_REPORT_SPECS=true DETOX_START_TIMESTAMP=1658937150145 DETOX_USE_CUSTOM_LOGGER=true jest --config e2e/config.json --testNamePattern '^((?!:ios:).)*$' --maxWorkers 1 e2e
15:56:03.440 detox[98464] ERROR: [DETOX_INIT_ERROR] 
ChildProcessError: `/Users/runner/Library/Android/sdk/platform-tools/adb -s emulator-5554 shell pm install -r -g -t /data/local/tmp/detox/Application.apk` failed with code null
   at ChildProcess.<anonymous> (/Users/runner/work/siren/siren/node_modules/child-process-promise/lib/index.js:132:23)
   at ChildProcess.emit (node:events:527:28)
   at maybeClose (node:internal/child_process:1092:16)
   at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5) {
 code: null,
 childProcess: ChildProcess {
   _events: [Object: null prototype] {
     error: [Function (anonymous)],
     close: [Function (anonymous)]
   },
   _eventsCount: 2,
   _maxListeners: undefined,
   _closesNeeded: 3,
   _closesGot: 3,
   connected: false,
   signalCode: 'SIGTERM',
   exitCode: null,
   killed: true,
   spawnfile: '/Users/runner/Library/Android/sdk/platform-tools/adb',
   _handle: null,
   spawnargs: [
     '/Users/runner/Library/Android/sdk/platform-tools/adb',
     '-s',
     'emulator-5554',
     'shell',
     'pm',
     'install',
     '-r',
     '-g',
     '-t',
     '/data/local/tmp/detox/Application.apk'
   ],
   pid: 5803,
   stdin: null,
   stdout: Socket {
     connecting: false,
     _hadError: false,
     _parent: null,
     _host: null,
     _readableState: [ReadableState],
     _events: [Object: null prototype],
     _eventsCount: 3,
     _maxListeners: undefined,
     _writableState: [WritableState],
     allowHalfOpen: false,
     _sockname: null,
     _pendingData: null,
     _pendingEncoding: '',
     server: null,
     _server: null,
     write: [Function: writeAfterFIN],
     [Symbol(async_id_symbol)]: 1083,
     [Symbol(kHandle)]: null,
     [Symbol(lastWriteQueueSize)]: 0,
     [Symbol(timeout)]: null,
     [Symbol(kBuffer)]: null,
     [Symbol(kBufferCb)]: null,
     [Symbol(kBufferGen)]: null,
     [Symbol(kCapture)]: false,
     [Symbol(kSetNoDelay)]: false,
     [Symbol(kSetKeepAlive)]: false,
     [Symbol(kSetKeepAliveInitialDelay)]: 0,
     [Symbol(kBytesRead)]: 0,
     [Symbol(kBytesWritten)]: 0
   },
   stderr: Socket {
     connecting: false,
     _hadError: false,
     _parent: null,
     _host: null,
     _readableState: [ReadableState],
     _events: [Object: null prototype],
     _eventsCount: 3,
     _maxListeners: undefined,
     _writableState: [WritableState],
     allowHalfOpen: false,
     _sockname: null,
     _pendingData: null,
     _pendingEncoding: '',
     server: null,
     _server: null,
     write: [Function: writeAfterFIN],
     [Symbol(async_id_symbol)]: 1084,
     [Symbol(kHandle)]: null,
     [Symbol(lastWriteQueueSize)]: 0,
     [Symbol(timeout)]: null,
     [Symbol(kBuffer)]: null,
     [Symbol(kBufferCb)]: null,
     [Symbol(kBufferGen)]: null,
     [Symbol(kCapture)]: false,
     [Symbol(kSetNoDelay)]: false,
     [Symbol(kSetKeepAlive)]: false,
     [Symbol(kSetKeepAliveInitialDelay)]: 0,
     [Symbol(kBytesRead)]: 0,
     [Symbol(kBytesWritten)]: 0
   },
   stdio: [ null, [Socket], [Socket] ],
   [Symbol(kCapture)]: false
 },
 stdout: '',
 stderr: ''
}
INFO    | Discarding the changed state: command-line flag
WARNING | Discarding the changed state (command-line flag).
INFO    | Shutting down gRPC endpoint
INFO    | Shutting down gRPC endpoint
INFO    | Closing down rootcanal.
FAIL e2e/smoke-tests/bottom-tab-navigation.spec.ts (435.497 s)
 bottom tab landing
   ✕ Home tab should land on home screen (1 ms)
   ✕ MyChart tab should land on MyChart screen
   ✕ Profile tab should land on profile screen

 ● bottom tab landing › Home tab should land on home screen

   ChildProcessError: `/Users/runner/Library/Android/sdk/platform-tools/adb -s emulator-5554 shell pm install -r -g -t /data/local/tmp/detox/Application.apk` failed with code null

     at ChildProcess.<anonymous> (../node_modules/child-process-promise/lib/index.js:132:23)

 ● bottom tab landing › Home tab should land on home screen

   ChildProcessError: `/Users/runner/Library/Android/sdk/platform-tools/adb -s emulator-5554 shell pm install -r -g -t /data/local/tmp/detox/Application.apk` failed with code null

     at ChildProcess.<anonymous> (../node_modules/child-process-promise/lib/index.js:132:23)

 ● bottom tab landing › MyChart tab should land on MyChart screen

   ChildProcessError: `/Users/runner/Library/Android/sdk/platform-tools/adb -s emulator-5[554](https://github.com/inception-health/siren/runs/7543222237?check_suite_focus=true#step:13:558) shell pm install -r -g -t /data/local/tmp/detox/Application.apk` failed with code null

     at ChildProcess.<anonymous> (../node_modules/child-process-promise/lib/index.js:132:23)

 ● bottom tab landing › MyChart tab should land on MyChart screen

   ChildProcessError: `/Users/runner/Library/Android/sdk/platform-tools/adb -s emulator-[555](https://github.com/inception-health/siren/runs/7543222237?check_suite_focus=true#step:13:559)4 shell pm install -r -g -t /data/local/tmp/detox/Application.apk` failed with code null

     at ChildProcess.<anonymous> (../node_modules/child-process-promise/lib/index.js:132:23)

 ● bottom tab landing › Profile tab should land on profile screen

   ChildProcessError: `/Users/runner/Library/Android/sdk/platform-tools/adb -s emulator-5554 shell pm install -r -g -t /data/local/tmp/detox/Application.apk` failed with code null

     at ChildProcess.<anonymous> (../node_modules/child-process-promise/lib/index.js:132:23)

 ● bottom tab landing › Profile tab should land on profile screen

   ChildProcessError: `/Users/runner/Library/Android/sdk/platform-tools/adb -s emulator-5554 shell pm install -r -g -t /data/local/tmp/detox/Application.apk` failed with code null

     at ChildProcess.<anonymous> (../node_modules/child-process-promise/lib/index.js:132:23)

15:59:48.104 detox[98451] ERROR: [cli.js] Command failed: jest --config e2e/config.json --testNamePattern '^((?!:ios:).)*$' --maxWorkers 1 e2e

error Command failed with exit code 1.

Your environment

Detox version: 19.7.1 React Native version: 0.63 Node version: 14 Device model: pixel_4 OS: macOS 11.6.8 Test-runner (select one): jest-circus

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:17

github_iconTop GitHub Comments

2reactions
longilitycommented, Aug 4, 2022

I had time to at least create a repo for someone else to fork/clone and debug the issue more easily. Repo: https://github.com/longility/DetoxExpApp Failing workflow run: https://github.com/longility/DetoxExpApp/actions/runs/2797196014

2reactions
longilitycommented, Aug 3, 2022

Thank you for sharing your experiences and experiments to allow me to try something new. I’ll let you know of progress when I get around to this soon and what I find out. I’m out next couple of weeks so we shall see.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Running React Native Detox tests for iOS and Android on ...
The project includes two workflows: iOS and Android. Both workflows are using macOS-latest environments to run the tests. Important to know, ...
Read more >
Dealing With Synchronization Issues in Tests | Detox
When this works it's like magic. You simply execute actions one after the other without worrying about timing, and Detox waits for the...
Read more >
Running E2E tests on EAS Build - Expo Documentation
Detox requires you to specify both the build command and path to the binary produced by it. Technically, the build command is not...
Read more >
Running Detox end-to-end tests on CI - Rule of Tech
There is a workflow for Hailakka on Android but I managed it to get running only on API level 29 (or lower) on...
Read more >
React Native end-to-end testing with Detox - LogRocket Blog
Demo running end-to-end tests in React Native with Detox, an end-to-end framework for mobile apps developed by Wix.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found