我正在嘗試實作danger-swift,但我不知道在哪里可以訪問測驗結果并從Bitrise 標記失敗的結果。
我正在使用一個名為 DangerXCodeSummary 的危險 swift 插件,但我不知道 Bitrise 在哪里存盤來自 xcode-test@2 的測驗結果。
危險檔案:
import Danger
import DangerXCodeSummary
import Foundation
let danger = Danger()
let testReportPath = "??" // What's the path for the test results?
XCodeSummary(filePath: testReportPath).report()
位元升腳本:
...
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 "#################################################"
uj5u.com熱心網友回復:
您可以在作業流編輯器 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 Test 的輸出(一旦 Xcode 測驗完成,它會將這個環境變數設定為xcresult's 路徑)。請記住,這是.xcresult格式(官方 Xcode 測驗結果格式)。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/522581.html
上一篇:提供的物體包含具有無效值的關系
