mirror of
https://github.com/GeWuYou/GFramework.git
synced 2026-03-22 19:03:29 +08:00
fix(ci): 修复测试报告生成逻辑
- 修改TRX文件名生成方式,避免并发测试时文件冲突 - 更新CTRF报告生成逻辑,支持处理多个测试结果文件 - 添加目录创建确保CTRF输出路径存在 - 改进循环处理所有TRX文件而不是仅处理最新一个
This commit is contained in:
parent
0bc4e0d8ff
commit
b9e7caeada
17
.github/workflows/ci.yml
vendored
17
.github/workflows/ci.yml
vendored
@ -74,15 +74,18 @@ jobs:
|
||||
REPORT_FILE="testResults-$(date +%s).trx"
|
||||
|
||||
dotnet test \
|
||||
-c Release \
|
||||
--no-build \
|
||||
--logger "trx;LogFileName=$REPORT_FILE" \
|
||||
--results-directory TestResults
|
||||
-c Release \
|
||||
--no-build \
|
||||
--logger "trx;LogFileName=testResults-$(date +%s)-$RANDOM.trx" \
|
||||
--results-directory TestResults
|
||||
|
||||
- name: Generate CTRF report
|
||||
run: |
|
||||
trx=$(ls -t TestResults/*.trx | head -n 1)
|
||||
echo "Using TRX: $trx"
|
||||
dotnet tool run DotnetCtrfJsonReporter -p "$trx" -t nunit
|
||||
mkdir -p ctrf
|
||||
for trx in TestResults/*.trx; do
|
||||
echo "Processing $trx"
|
||||
dotnet tool run DotnetCtrfJsonReporter -p "$trx" -t nunit
|
||||
done
|
||||
# 生成并发布测试报告,无论测试成功或失败都会执行
|
||||
- name: Test Report
|
||||
uses: dorny/test-reporter@v2
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user