我正在使用Bitrise进行排毒测试。 build命令运行正常并且成功。但是测试命令总是失败。
本地运行:
detox test -c ios.sim.debug
:“不存在捆绑包URL”错误打包程序的命令detox test -c ios.sim.debug
:打开打包程序,一切正常。
没有打包程序的命令detox test -c ios.sim.release
:工作正常。
detox test -c ios.sim.release
:工作正常。在Bitrise中运行:
detox test -c ios.sim.debug --cleanup
:“不存在捆绑包URL”错误命令detox test -c ios.sim.debug --cleanup
:
Verify tests are up
"before all" hook:
Error: Timeout of 120000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/Users/vagrant/git/e2e/tests.spec.js)
没有打包程序的命令detox test -c ios.sim.release --cleanup
:工作正常。
detox test -c ios.sim.release --cleanup
:工作正常。 免责声明
有/无打包程序意味着变量RCT_NO_LAUNCH_PACKAGER
分别等于false/true
。
"ios.sim.debug": {
"binaryPath": "ios/build/Build/Products/Debug-iphonesimulator/PROJECT_NAME.app",
"build": "export RCT_NO_LAUNCH_PACKAGER=true && xcodebuild -workspace ios/PROJECT_NAME.xcworkspace -scheme INTEGRATION_SCHEME -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build",
"type": "ios.simulator",
"name": "iPhone 7"
},
"ios.sim.release": {
"binaryPath": "ios/build/Build/Products/Release-iphonesimulator/PROJECT_NAME.app",
"build": "export RCT_NO_LAUNCH_PACKAGER=true && xcodebuild -workspace ios/PROJECT_NAME.xcworkspace -scheme PRODUCTION_SCHEME -configuration Release -sdk iphonesimulator -derivedDataPath ios/build",
"type": "ios.simulator",
"name": "iPhone 7 Plus"
},
_init_install:
steps:
- activate-ssh-key@3.1.1:
run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
- git-clone@4.0.11: {}
- script@1.1.5:
inputs:
- content: |-
#!/usr/bin/env bash
# fail if any commands fails
set -e
# debug log
set -x
# write your script here
brew uninstall --ignore-dependencies node
brew install node@8
brew link --overwrite --force node@8
- yarn@0.0.7: {}
_detox_tests:
steps:
- npm@0.9.0:
title: Install Detox CLI
inputs:
- command: install -g detox-cli
- npm@0.9.0:
title: Install React-Native CLI
inputs:
- command: install -g react-native-cli
- script@1.1.5:
title: Install Detox Utils
inputs:
- content: |-
#!/bin/bash
brew tap facebook/fb
export CODE_SIGNING_REQUIRED=NO
brew install fbsimctl
brew tap wix/brew
brew install applesimutils --HEAD
- script@1.1.5:
title: Detox - Build Debug App
inputs:
- content: |-
#!/usr/bin/env bash
detox build -c ios.sim.debug
- script@1.1.5:
title: Detox - Run E2E Tests
inputs:
- content: |-
#!/usr/bin/env bash
detox test -c ios.sim.debug --cleanup
- deploy-to-bitrise-io@1.3.10: {}
test_ios:
before_run:
- _init_install
after_run:
- _detox_tests
steps:
- cocoapods-install@1.7.2:
inputs:
- podfile_path: ios/Podfile
- resource-archive@2.0.1:
inputs:
- extract_to_path: "$HOME/Documents/FacebookSDK/"
- archive_url:https://origincache.facebook.com/developers/resources/?id=facebook-ios-sdk-current.zip
- certificate-and-profile-installer@1.9.3: {}
```
detox test -c ios.sim.debug --cleanup
detox.last_launch_app_log.err
打印:使用Bitrise运行Detox时出现错误。命令detox test -c ios.sim.debug --cleanup
应该打开一个打包程序,但看起来好像没有这样做。
要测试的版本是“调试”版本,没有其他选项。也许我错过了一些有关安装的信息,但是所有文件都经过了官方文档和其他示例的检查,并且完全相同。