Description of the issue
Iβm trying to run Detox tests using Jest, but Iβm not able to build it with Bitrise. It works on my machineβ’. I have been following the documentation from the Detox team, and from this site.
- https://github.com/wix/Detox/blob/master/docs/Guide.Jest.md
- https://github.com/wix/Detox/blob/master/docs/Guide.RunningOnCI.md
- Redirecting⦠- Bitrise Docs
There seems to be issues with finding/generating certain files which causes the build to crash. Perhaps the issues is simulating the device? Iβm unfamiliar with how to troubleshoot this and Iβm unfamiliar with Bitrise in general, so Iβm asking for help to find the cause/fix.
What Iβve tried so far:
npm rebuild detox
before running buildxcodebuild -project ios/Kick.xcodeproj
instead of
xcodebuild -workspace ios/Kick.xcworkspace
- Running
pod install
in ios folder - Running without
-UseNewBuildSystem=NO
parameter - Other minor tweaks with parameters.
Config in package.json:
"ios.release": { "binaryPath": "ios/build/Build/Products/Release-iphonesimulator/Kick.app", "build": "xcodebuild -workspace ios/Kick.xcworkspace -scheme Kick -configuration Release -sdk iphonesimulator -derivedDataPath ios/build -UseNewBuildSystem=NO", "type": "ios.simulator", "device": { "type": "iPhone 11 Pro" } },
Test config in e2e/config.json:
{ "setupFilesAfterEnv": ["./init.js"], "testEnvironment": "detox/runners/jest/JestCircusEnvironment", "testRunner": "jest-circus/runner", "reporters": ["detox/runners/jest/streamlineReporter"], "verbose": true }
Iβll provide more details if needed.
Environment:
Bitrise.io: Xcode 11.1.x, on macOS 10.14.6 (Mojave) (default).
Which build Step causes the issue and which version of the step?
Script v1.1.6.
detox build --configuration ios.release
Reproducibility
- _Does a βRebuildβ help?
No - _Does a rebuild without caches help?
No - _Does the issue happen sporadically, or every time?
Every time - Does upgrading the build Step to the latest version help? :
No - When did the issue start? :
First time building the tests
Local reproduction
Reproduced with Bitrise CLI on clean repo - macOS 10.15.3 (Catalina).
Build log
Dumping logs as my repo is private at the moment. Since the logs donβt output the script contents, here they are (step 5-7):
brew tap wix/brew
brew install applesimutils
detox build --configuration ios.release --cleanup
detox test --configuration ios.release --cleanup
Log:
Agent version: 1.9.7
Start time: 2020-03-27T11:55:07Z
$ bitrise "run" "--config" "/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise-agent162943722/bitrise.yml" "--inventory" "/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise-agent162943722/bitrise.secrets.yml" "--json-params-base64" "eyJ3b3JrZmxvdyI6InRlc3QifQ=="
βββββββ βββββββββββββββββββ βββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββ βββ βββββββββββββββββββββββββ
βββββββββββ βββ βββββββββββββββββββββββββ
βββββββββββ βββ βββ ββββββββββββββββββββββ
βββββββ βββ βββ βββ ββββββββββββββββββββββ
version: 1.40.0
INFO[11:55:07] bitrise runs in Secret Filtering mode
INFO[11:55:07] bitrise runs in CI mode
INFO[11:55:07] Running workflow: test
Switching to workflow: test
INFO[11:55:07] Step uses latest version -- Updating StepLib ...
+------------------------------------------------------------------------------+
| (0) activate-ssh-key |
+---+---------------------------------------------------------------+----------+
+---+---------------------------------------------------------------+----------+
| β | activate-ssh-key | 10.09 sec|
+---+---------------------------------------------------------------+----------+
βΌ
+------------------------------------------------------------------------------+
| (1) git-clone |
+---+---------------------------------------------------------------+----------+
+---+---------------------------------------------------------------+----------+
| β | git-clone | 8.01 sec |
+---+---------------------------------------------------------------+----------+
βΌ
+------------------------------------------------------------------------------+
| (2) Install |
+------------------------------------------------------------------------------+
| id: yarn |
| version: 0.1.1 |
| collection: https://github.com/bitrise-io/bitrise-steplib.git |
| toolkit: go |
| time: 2020-03-27T11:55:27Z |
+------------------------------------------------------------------------------+
| |
INFO[11:55:27] * [OK] Step dependency (node) installed, available.
INFO[11:55:27] * [OK] Step dependency (yarn) installed, available.
Config:
- WorkingDir: /Users/vagrant/git
- YarnCommand:
- YarnArgs:
- UseCache: false
- IsDebugLog: false
Yarn is already installed at: /usr/local/bin/yarn
Yarn version:
$ yarn "--version"
1.17.3
$ yarn
yarn install v1.17.3
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
warning " > react-native-maps@0.27.1" has unmet peer dependency "prop-types@^15.0 || ^16.0".
warning "@react-native-community/eslint-config > @typescript-eslint/eslint-plugin@1.13.0" has incorrect peer dependency "eslint@^5.0.0".
warning "@react-native-community/eslint-config > @typescript-eslint/parser@1.13.0" has incorrect peer dependency "eslint@^5.0.0".
warning "@react-native-community/eslint-config > eslint-plugin-react@7.12.4" has incorrect peer dependency "eslint@^3.0.0 || ^4.0.0 || ^5.0.0".
warning "@react-native-community/eslint-config > eslint-plugin-react-native@3.6.0" has incorrect peer dependency "eslint@^3.17.0 || ^4 || ^5".
warning "@react-native-community/eslint-config > @typescript-eslint/eslint-plugin > tsutils@3.17.1" has unmet peer dependency "typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta".
[4/4] Building fresh packages...
Done in 91.19s.
| |
+---+---------------------------------------------------------------+----------+
| β | Install | 1.6 min |
+---+---------------------------------------------------------------+----------+
βΌ
+------------------------------------------------------------------------------+
| (3) Install detox-cli |
+------------------------------------------------------------------------------+
| id: npm |
| version: 1.1.3 |
| collection: https://github.com/bitrise-io/bitrise-steplib.git |
| toolkit: go |
| time: 2020-03-27T11:57:04Z |
+------------------------------------------------------------------------------+
| |
Config:
- Workdir: /Users/vagrant/git
- Command: install -g detox-cli
- NpmVersion:
- UseCache: false
Autodetecting npm version
Checking package.json for npm version
Could not read version information from package.json
Locating system installed npm
npm found at /usr/local/bin/npm
$ npm "--version"
system npm version: 6.13.4
Running user provided command
$ npm "install" "-g" "detox-cli"
/usr/local/bin/detox -> /usr/local/lib/node_modules/detox-cli/cli.js
+ detox-cli@10.0.7
added 3 packages from 3 contributors in 0.53s
Step success
| |
+---+---------------------------------------------------------------+----------+
| β | Install detox-cli | 9.45 sec |
+---+---------------------------------------------------------------+----------+
βΌ
+------------------------------------------------------------------------------+
| (4) Install react-native-cli |
+------------------------------------------------------------------------------+
| id: npm |
| version: 1.1.3 |
| collection: https://github.com/bitrise-io/bitrise-steplib.git |
| toolkit: go |
| time: 2020-03-27T11:57:13Z |
+------------------------------------------------------------------------------+
| |
Config:
- Workdir: /Users/vagrant/git
- Command: install -g react-native-cli
- NpmVersion:
- UseCache: false
Autodetecting npm version
Checking package.json for npm version
Could not read version information from package.json
Locating system installed npm
npm found at /usr/local/bin/npm
$ npm "--version"
system npm version: 6.13.4
Running user provided command
$ npm "install" "-g" "react-native-cli"
npm WARN deprecated mkdirp@0.5.4: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
/usr/local/bin/react-native -> /usr/local/lib/node_modules/react-native-cli/index.js
+ react-native-cli@2.0.1
added 71 packages from 25 contributors in 3.565s
Step success
| |
+---+---------------------------------------------------------------+----------+
| β | Install react-native-cli | 9.16 sec |
+---+---------------------------------------------------------------+----------+
βΌ
+------------------------------------------------------------------------------+
| (5) Install Detox Utils |
+------------------------------------------------------------------------------+
| id: script |
| version: 1.1.6 |
| collection: https://github.com/bitrise-io/bitrise-steplib.git |
| toolkit: bash |
| time: 2020-03-27T11:57:22Z |
+------------------------------------------------------------------------------+
| |
==> Tapping wix/brew
Cloning into '/usr/local/Homebrew/Library/Taps/wix/homebrew-brew'...
Tapped 1 cask and 1 formula (29 files, 1.6MB).
==> Installing applesimutils from wix/brew
==> Downloading https://github.com/wix/AppleSimulatorUtils/releases/download/0.7.7/applesimutils-0.7.7.mojave.bottle.tar.gz
==> Downloading from https://github-production-release-asset-2e65be.s3.amazonaws.com/86659796/5e763c00-42a7-11ea-8e4d-930a91da5e20?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20200327%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20200327T115640Z&X-Amz-Expires=300&X-Amz-Signature=ee6826a6e4b34dda8fb0dcf3eb60d732aeb808cd890a25de78330202091e792b&X-Amz-SignedHeaders=host&actor_id=0&response-content-disposition=attachment%3B%20filename%3Dapplesimutils-0.7.7.mojave.bottle.tar.gz&response-content-type=application%2Foctet-stream
==> Pouring applesimutils-0.7.7.mojave.bottle.tar.gz
πΊ /usr/local/Cellar/applesimutils/0.7.7: 2 files, 289.5KB
==> `brew cleanup` has not been run in 30 days, running now...
Removing: /Users/vagrant/Library/Caches/Homebrew/ansible--2.9.2.mojave.bottle.tar.gz... (37.7MB)
Removing: /Users/vagrant/Library/Caches/Homebrew/ansible--2.9.2_1.mojave.bottle.tar.gz... (37.8MB)
Removing: /Users/vagrant/Library/Caches/Homebrew/glib--2.62.4.mojave.bottle.tar.gz... (4.5MB)
Removing: /Users/vagrant/Library/Caches/Homebrew/ilmbase--2.4.0.mojave.bottle.tar.gz... (1.3MB)
Removing: /Users/vagrant/Library/Caches/Homebrew/imagemagick--7.0.9-14.mojave.bottle.tar.gz... (9.5MB)
Removing: /Users/vagrant/Library/Caches/Homebrew/libde265--1.0.4.mojave.bottle.tar.gz... (701.6KB)
Removing: /Users/vagrant/Library/Caches/Homebrew/libheif--1.6.1.mojave.bottle.tar.gz... (1.2MB)
Removing: /Users/vagrant/Library/Caches/Homebrew/libomp--9.0.0.mojave.bottle.tar.gz... (456.0KB)
Removing: /usr/local/Cellar/libtiff/4.0.10_1... (246 files, 3.5MB)
Removing: /Users/vagrant/Library/Caches/Homebrew/mercurial--5.2.2.mojave.bottle.tar.gz... (2.5MB)
Removing: /Users/vagrant/Library/Caches/Homebrew/openexr--2.4.0.mojave.bottle.tar.gz... (3.4MB)
Removing: /Users/vagrant/Library/Caches/Homebrew/python--3.7.6_1.mojave.bottle.tar.gz... (14.8MB)
Removing: /Users/vagrant/Library/Caches/Homebrew/python@3.8--3.8.1.mojave.bottle.tar.gz... (15.2MB)
Removing: /Users/vagrant/Library/Caches/Homebrew/readline--8.0.1.mojave.bottle.tar.gz... (517.9KB)
Removing: /Users/vagrant/Library/Caches/Homebrew/sqlite--3.30.1.mojave.bottle.tar.gz... (1.9MB)
Removing: /Users/vagrant/Library/Caches/Homebrew/x265--3.2.1.mojave.bottle.tar.gz... (4.8MB)
Removing: /Users/vagrant/Library/Logs/Homebrew/libheif... (203B)
Removing: /Users/vagrant/Library/Logs/Homebrew/libtiff... (64B)
Removing: /Users/vagrant/Library/Logs/Homebrew/ilmbase... (64B)
Removing: /Users/vagrant/Library/Logs/Homebrew/python... (3 files, 141.4KB)
Removing: /Users/vagrant/Library/Logs/Homebrew/shared-mime-info... (211B)
Removing: /Users/vagrant/Library/Logs/Homebrew/glib... (64B)
Removing: /Users/vagrant/Library/Logs/Homebrew/readline... (64B)
Removing: /Users/vagrant/Library/Logs/Homebrew/libde265... (64B)
Removing: /Users/vagrant/Library/Logs/Homebrew/sqlite... (64B)
Removing: /Users/vagrant/Library/Logs/Homebrew/openexr... (64B)
Removing: /Users/vagrant/Library/Logs/Homebrew/ansible... (64B)
Removing: /Users/vagrant/Library/Logs/Homebrew/mercurial... (64B)
Removing: /Users/vagrant/Library/Logs/Homebrew/watchman... (1.7KB)
Removing: /Users/vagrant/Library/Logs/Homebrew/x265... (64B)
Removing: /Users/vagrant/Library/Logs/Homebrew/libomp... (64B)
Removing: /Users/vagrant/Library/Logs/Homebrew/python@3.8... (3 files, 141.9KB)
Removing: /Users/vagrant/Library/Logs/Homebrew/imagemagick... (64B)
Pruned 0 symbolic links and 2 directories from /usr/local
| |
+---+---------------------------------------------------------------+----------+
| β | Install Detox Utils | 30.96 sec|
+---+---------------------------------------------------------------+----------+
βΌ
+------------------------------------------------------------------------------+
| (6) Detox - Build Release App |
+------------------------------------------------------------------------------+
| id: script |
| version: 1.1.6 |
| collection: https://github.com/bitrise-io/bitrise-steplib.git |
| toolkit: bash |
| time: 2020-03-27T11:57:53Z |
+------------------------------------------------------------------------------+
| |
==> Start
==> Switching to working directory: /Users/vagrant/git
detox[3141] INFO: [build.js] xcodebuild -workspace ios/Kick.xcworkspace -scheme Kick -configuration Release -sdk iphonesimulator -derivedDataPath ios/build -UseNewBuildSystem=NO
User defaults from command line:
IDEDerivedDataPathOverride = /Users/vagrant/git/ios/build
UseNewBuildSystem = NO
Build settings from command line:
SDKROOT = iphonesimulator13.1
Prepare build
note: Using legacy build system
=== BUILD TARGET Kick OF PROJECT Kick WITH CONFIGURATION Release ===
Check dependencies
The file βPods-Kick.release.xcconfigβ couldnβt be opened because there is no such file. (/Users/vagrant/git/ios/Pods/Target Support Files/Pods-Kick/Pods-Kick.release.xcconfig)
Write auxiliary files
write-file /Users/vagrant/git/ios/build/Build/Intermediates.noindex/Kick.build/Release-iphonesimulator/Kick.build/Kick-all-non-framework-target-headers.hmap
write-file /Users/vagrant/git/ios/build/Build/Intermediates.noindex/Kick.build/Release-iphonesimulator/Kick.build/Script-E68977BC0DD78EC740BC3A10.sh
chmod 0755 /Users/vagrant/git/ios/build/Build/Intermediates.noindex/Kick.build/Release-iphonesimulator/Kick.build/Script-E68977BC0DD78EC740BC3A10.sh
write-file /Users/vagrant/git/ios/build/Build/Intermediates.noindex/Kick.build/Release-iphonesimulator/Kick.build/Kick-own-target-headers.hmap
write-file /Users/vagrant/git/ios/build/Build/Intermediates.noindex/Kick.build/Release-iphonesimulator/Kick.build/Kick-all-target-headers.hmap
write-file /Users/vagrant/git/ios/build/Build/Intermediates.noindex/Kick.build/Release-iphonesimulator/Kick.build/Script-00DD1BFF1BD5951E006B06BC.sh
chmod 0755 /Users/vagrant/git/ios/build/Build/Intermediates.noindex/Kick.build/Release-iphonesimulator/Kick.build/Script-00DD1BFF1BD5951E006B06BC.sh
write-file /Users/vagrant/git/ios/build/Build/Intermediates.noindex/Kick.build/Release-iphonesimulator/Kick.build/Kick.hmap
/bin/mkdir -p /Users/vagrant/git/ios/build/Build/Intermediates.noindex/Kick.build/Release-iphonesimulator/Kick.build/Objects-normal/i386
write-file /Users/vagrant/git/ios/build/Build/Intermediates.noindex/Kick.build/Release-iphonesimulator/Kick.build/Objects-normal/i386/Kick.LinkFileList
write-file /Users/vagrant/git/ios/build/Build/Intermediates.noindex/Kick.build/Release-iphonesimulator/Kick.build/Script-FD10A7F022414F080027D42C.sh
chmod 0755 /Users/vagrant/git/ios/build/Build/Intermediates.noindex/Kick.build/Release-iphonesimulator/Kick.build/Script-FD10A7F022414F080027D42C.sh
write-file /Users/vagrant/git/ios/build/Build/Intermediates.noindex/Kick.build/Release-iphonesimulator/Kick.build/Kick-project-headers.hmap
write-file /Users/vagrant/git/ios/build/Build/Intermediates.noindex/Kick.build/Release-iphonesimulator/Kick.build/Kick-generated-files.hmap
/bin/mkdir -p /Users/vagrant/git/ios/build/Build/Intermediates.noindex/Kick.build/Release-iphonesimulator/Kick.build/DerivedSources
write-file /Users/vagrant/git/ios/build/Build/Intermediates.noindex/Kick.build/Release-iphonesimulator/Kick.build/DerivedSources/Kick_vers.c
/bin/mkdir -p /Users/vagrant/git/ios/build/Build/Intermediates.noindex/Kick.build/Release-iphonesimulator/Kick.build/Objects-normal/x86_64
write-file /Users/vagrant/git/ios/build/Build/Intermediates.noindex/Kick.build/Release-iphonesimulator/Kick.build/Objects-normal/x86_64/Kick.LinkFileList
write-file /Users/vagrant/git/ios/build/Build/Intermediates.noindex/Kick.build/Release-iphonesimulator/Kick.build/Script-8A605E004217132B104CE9F3.sh
chmod 0755 /Users/vagrant/git/ios/build/Build/Intermediates.noindex/Kick.build/Release-iphonesimulator/Kick.build/Script-8A605E004217132B104CE9F3.sh
Create product structure
/bin/mkdir -p /Users/vagrant/git/ios/build/Build/Products/Release-iphonesimulator/Kick.app
ProcessProductPackaging "" build/Build/Intermediates.noindex/Kick.build/Release-iphonesimulator/Kick.build/Kick.app-Simulated.xcent
cd /Users/vagrant/git/ios
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Users/vagrant/.bitrise/tools:/Users/vagrant/.jenv/shims:/Users/vagrant/.rbenv/shims:/usr/local/bin:/usr/local/sbin:~/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/vagrant/.jenv/shims:/Users/vagrant/.rbenv/shims:/usr/local/sbin:/Users/vagrant/bin:/usr/local/opt/go/libexec/bin:/Users/vagrant/go/bin:/Users/vagrant/bitrise/tools/cmd-bridge/bin/osx:/opt/android-ndk:/usr/local/share/android-sdk/tools:/usr/local/share/android-sdk/tools/bin:/usr/local/share/android-sdk/platform-tools:/usr/local/flutter/bin:/Users/vagrant/.jenv/bin:/usr/local/opt/go/libexec/bin:/Users/vagrant/go/bin:/Users/vagrant/bitrise/tools/cmd-bridge/bin/osx:/opt/android-ndk:/usr/local/share/android-sdk/tools:/usr/local/share/android-sdk/tools/bin:/usr/local/share/android-sdk/platform-tools:/usr/local/flutter/bin:/Users/vagrant/.jenv/bin"
Entitlements:
{
"application-identifier" = "FAKETEAMID.org.reactjs.native.example.Kick";
"keychain-access-groups" = (
"FAKETEAMID.org.reactjs.native.example.Kick"
);
}
builtin-productPackagingUtility -entitlements -format xml -o /Users/vagrant/git/ios/build/Build/Intermediates.noindex/Kick.build/Release-iphonesimulator/Kick.build/Kick.app-Simulated.xcent
PhaseScriptExecution [CP]\ Check\ Pods\ Manifest.lock build/Build/Intermediates.noindex/Kick.build/Release-iphonesimulator/Kick.build/Script-8A605E004217132B104CE9F3.sh
cd /Users/vagrant/git/ios
/bin/sh -c /Users/vagrant/git/ios/build/Build/Intermediates.noindex/Kick.build/Release-iphonesimulator/Kick.build/Script-8A605E004217132B104CE9F3.sh
diff: /Podfile.lock: No such file or directory
diff: /Manifest.lock: No such file or directory
error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.
** BUILD FAILED **
The following build commands failed:
PhaseScriptExecution [CP]\ Check\ Pods\ Manifest.lock build/Build/Intermediates.noindex/Kick.build/Release-iphonesimulator/Kick.build/Script-8A605E004217132B104CE9F3.sh
(1 failure)
detox[3141] ERROR: [cli.js] Error: Command failed: xcodebuild -workspace ios/Kick.xcworkspace -scheme Kick -configuration Release -sdk iphonesimulator -derivedDataPath ios/build -UseNewBuildSystem=NO
==> Script finished with exit code: 1
| |
+---+---------------------------------------------------------------+----------+
| x | Detox - Build Release App (exit code: 1) | 9.73 sec |
+---+---------------------------------------------------------------+----------+
| Issue tracker: https://github.com/bitrise-io/steps-script/issues |
| Source: https://github.com/bitrise-io/steps-script |
+---+---------------------------------------------------------------+----------+
βΌ
+------------------------------------------------------------------------------+
| (7) Detox - Run E2E Tests |
+---+---------------------------------------------------------------+----------+
+---+---------------------------------------------------------------+----------+
| - | Detox - Run E2E Tests | 1.15 sec |
+---+---------------------------------------------------------------+----------+
+------------------------------------------------------------------------------+
| bitrise summary |
+---+---------------------------------------------------------------+----------+
| | title | time (s) |
+---+---------------------------------------------------------------+----------+
| β | activate-ssh-key | 10.09 sec|
+---+---------------------------------------------------------------+----------+
| β | git-clone | 8.01 sec |
+---+---------------------------------------------------------------+----------+
| β | Install | 1.6 min |
+---+---------------------------------------------------------------+----------+
| β | Install detox-cli | 9.45 sec |
+---+---------------------------------------------------------------+----------+
| β | Install react-native-cli | 9.16 sec |
+---+---------------------------------------------------------------+----------+
| β | Install Detox Utils | 30.96 sec|
+---+---------------------------------------------------------------+----------+
| x | Detox - Build Release App (exit code: 1) | 9.73 sec |
+---+---------------------------------------------------------------+----------+
| Issue tracker: https://github.com/bitrise-io/steps-script/issues |
| Source: https://github.com/bitrise-io/steps-script |
+---+---------------------------------------------------------------+----------+
| - | Detox - Run E2E Tests | 1.15 sec |
+---+---------------------------------------------------------------+----------+
| Total runtime: 2.9 min |
+------------------------------------------------------------------------------+
Submitting anonymized usage informations...
For more information visit:
https://github.com/bitrise-io/bitrise-plugins-analytics/blob/master/README.md