2

描述

我正在使用 Bitrise 运行排毒测试。构建命令运行正常并且成功。但是测试命令总是失败。


本地运行:

  • 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


package.json 文件

"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"
},

bitrise.yml 文件

_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、Node、Device、Xcode 和 macOS 版本

  • 排毒:v7.4.3
  • 反应原生:v0.51.0
  • 节点:v9.4.0
  • 设备:iPhone 7(模拟器)
  • Xcode:版本 9.3 (9E145)
  • macOS:10.13.3 (17D102)

设备和详细排毒日志

  1. detox test -c ios.sim.debug --cleanup打包程序出错

糊盒

  1. 文件detox.last_launch_app_log.err打印:

糊盒


TL;博士

使用 Bitrise 运行 Detox 时出现错误。该命令detox test -c ios.sim.debug --cleanup应该打开一个打包程序,但看起来它没有这样做。

需要测试的版本是 Debug 版本,没有其他选项。也许我错过了一些关于安装的东西,但是所有的文件都用官方文档和其他示例进行了检查,并且是相同的。

相关问题742、749、740 _ _

4

0 回答 0