首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何从Swift iOS访问Bitrise DangerFile测试结果?

如何从Swift iOS访问Bitrise DangerFile测试结果?
EN

Stack Overflow用户
提问于 2022-10-22 05:20:26
回答 1查看 31关注 0票数 1

我正在尝试实现危险-快速,但我不知道我在哪里可以访问测试结果和标记失败的从Bit上来。

我正在为危险使用一个插件,名为DangerXCodeSummary,但我不知道Bitrise在哪里存储xcode- test @2的测试结果。

DangerFile:

代码语言:javascript
复制
import Danger
import DangerXCodeSummary
import Foundation

let danger = Danger()

let testReportPath = "??" // What's the path for the test results?
XCodeSummary(filePath: testReportPath).report()

Bitrise脚本:

代码语言:javascript
复制
...
UnitTests:
before_run:
- _ensure_dependencies
after_run:
- _add_build_result_to_pr
steps:
- xcode-test@2: {} # What's the file path for the test results?
- deploy-to-bitrise-io@1: {}
envs:
-   ots:
    is_expand: false
    BITRISE_PROJECT_PATH: MyApp.xcodeproj
- opts:
    is_expand: false
    BITRISE_SCHEME: AppTests
    description: Unit Tests running at every commit.
...

_add_build_result_to_pr:
steps:
- script@1:
    title: Commenting on the PR
    is_always_run: true
    inputs:
    - content: |-
        #!/usr/bin/env bash
        # fail if any commands fails
        set -e
        echo "################### DANGER ######################"
        echo "Install Danger"
        brew install danger/tap/danger-swift
        echo "Run danger"
        danger-swift ci
        echo "#################################################"
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-10-23 10:00:08

您可以看到步骤在工作流编辑器UI上生成的输出,或者在step.yml中的步骤存储库中生成的输出。对于Xcode测试步骤,具体而言:https://github.com/bitrise-steplib/steps-xcode-test/blob/deb39d7e9e055a22f33550ed3110fb3c71beeb79/step.yml#L287

我说得对吗?你在寻找xcresult测试输出吗?如果是,您可以从BITRISE_XCRESULT_PATH环境变量(https://github.com/bitrise-steplib/steps-xcode-test/blob/deb39d7e9e055a22f33550ed3110fb3c71beeb79/step.yml#L296)中读取它,该变量是Xcode测试的输出( Xcode测试完成后,它将这个环境变量设置为xcresult的路径),记住这是.xcresult格式(官方Xcode测试结果格式)。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/74161263

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档