我正在尝试实现危险-快速,但我不知道我在哪里可以访问测试结果和标记失败的从Bit上来。
我正在为危险使用一个插件,名为DangerXCodeSummary,但我不知道Bitrise在哪里存储xcode- test @2的测试结果。
DangerFile:
import Danger
import DangerXCodeSummary
import Foundation
let danger = Danger()
let testReportPath = "??" // What's the path for the test results?
XCodeSummary(filePath: testReportPath).report()Bitrise脚本:
...
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 "#################################################"发布于 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测试结果格式)。
https://stackoverflow.com/questions/74161263
复制相似问题