[resolved] Running detox e2e testing on bitrise

Having an issue running detox on Bitrise. Currently, we have a small project which is working locally, however, when setup on bitrise I’m getting an issue where no tests are being run and the beforeAll() hook timesout.

detox wss 17:28:12: role=tester action=isReady (sessionId=8e2dc82c-5a28-3494-5fcb-55a758170818)
detox wss 17:28:12: role=testee not connected, cannot fw action (sessionId=8e2dc82c-5a28-3494-5fcb-55a758170818)
detox wss 17:28:15: role=testee login (sessionId=8e2dc82c-5a28-3494-5fcb-55a758170818)
detox wss 17:28:15: role=testee action=loginSuccess (sessionId=8e2dc82c-5a28-3494-5fcb-55a758170818)
  1) "before all" hook: _callee
  0 passing (2m)
  1 failing
  1) "before all" hook: _callee:
     Error: Timeout of 120000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves.
      
    child_process.js:641
        throw err;
        ^
    Error: Command failed: node_modules/.bin/mocha e2e --opts e2e/mocha.opts  --loglevel verbose     --artifacts-location /var/log
        at checkExecSyncError (child_process.js:598:13)
        at Object.execSync (child_process.js:638:13)
        at runMocha (/Users/vagrant/git/node_modules/detox/local-cli/detox-test.js:72:6)
        at Object.<anonymous> (/Users/vagrant/git/node_modules/detox/local-cli/detox-test.js:50:5)
        at Module._compile (module.js:612:30)
        at Object.Module._extensions..js (module.js:623:10)

`

We are using
detox: 7.2.0
mocha: 4.0.1

I’ve created a script to run prior to runing our usualy detox command, which:

  1. CD into the project directory

  2. run detox requirements https://github.com/wix/detox/blob/master/docs/Introduction.GettingStarted.md

  3. builds and runs detox

     #!/usr/bin/env bash
         set -ex
    
     SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )"
     ROOT_PATH="$( cd $SCRIPTPATH/../../ && pwd)"
    
     cd $ROOT_PATH
    
     brew tap wix/brew
     brew install wix/brew/applesimutils
     detox clean-framework-cache && detox build-framework-cache
    
     detox build 
     detox test -a /var/log -l verbose
    

Ive added verbose logging on the xcode build and the detox test and above is the end of logs i get. I have the full output if required.

Summary

This text will be hidden

Can you please Remote Desktop / VNC into the build VM and check it there? Related guide: https://gist.github.com/viktorbenei/c6d4fe1e68de739dbb5f4f15de76b9db

If you’d have any questions just let us know! :slight_smile:

1 Like

Thanks guys

resolved this by running bitrise-cli was really useful and fast.

It was issue with detox and yarn.
had to run this to get detox picking it up

npm rebuild detox
2 Likes

Ahh, good catch @ashleyrodanhp! :wink:

Happy to hear it helped, and thanks for reporting both the issue & the solution here, I’m sure it’ll help others too :slight_smile:

This solution didn’t helped me and I am still getting the same error .

1 Like

Hi @yogeshthanvi,
Could you send me the URL of your build, so I can have a look at the logs?

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.