3

I have a question about integrating app center with Detox. Currently I have to run the following commands to build the app and then run the tests:

detox build --configuration ios.sim.release
detox test --configuration ios.sim.release --cleanup

This happens in the appcenter-pre-build.sh section. However this means that the app will be built twice, once by detox and then again by the AppCenter build process. Is there a way to stop the AppCenter process as soon as the detox tests pass? I'm thinking something along the lines of Clone -> Detox build -> run unit tests -> run detox tests -> finish.

I assume that if the detox build fails then the entire build would be invalid as it is so there is no reason to build again, right?

uioporqwerty
  • 1,068
  • 3
  • 12
  • 30
  • 1
    Doesn't AppCenter build for arm? Detox needs the x86-64 binaries to work. – Léo Natan Jun 28 '19 at 22:16
  • I see. So yeah, it looks like I can use an existing build. But how can I access that build output directory from detox cli? I don't believe it provides an input parameter for location of the binary path. You can define an existing configuration that it pulls from package.json but that configuration will have the binaryPath hardcoded and I don't believe I will be able to access the AppCenter variables from there. I was looking at the variables here and I'm not sure which one would have the binary path: https://learn.microsoft.com/en-us/appcenter/build/custom/scripts/ – uioporqwerty Jun 29 '19 at 01:52
  • 1
    Most of the examples even here seem to reference building the app twice as the scripts seem to be pre-build events to Travis CI and Bitrise. https://github.com/wix/Detox/blob/master/docs/Guide.RunningOnCI.md It might not be possible at this time I suppose? Unless Detox test cli command can specify a binary path with an argument. – uioporqwerty Jun 29 '19 at 02:26

0 Answers0