【发布时间】:2017-03-28 14:14:38
【问题描述】:
我有一个 Jenkins 作业,它使用以下 dotnet CLI 命令在 .net 核心项目 (.net core 1.1) 上运行单元测试步骤:dotnet test -l trx。
使用的单元测试框架是 xUnit。
问题是输出 trx 文件格式与 Jenkins 测试结果查看器不完全兼容,因为所有测试表在包级别有一行仅称为“(根)”,但在其下方,在“类”级别有也是一行,但它没有名称,因此无法导航到其下方的实际测试方法。
我正在使用 XUnitPublisher 和 MSTestJunitHudsonTestType 来发布测试结果:
step([$class: 'XUnitPublisher', testTimeMargin: '3000', thresholdMode: 1, thresholds: [[$class: 'FailedThreshold', failureNewThreshold: '', failureThreshold: '', unstableNewThreshold: '', unstableThreshold: ''], [$class: 'SkippedThreshold', failureNewThreshold: '', failureThreshold: '', unstableNewThreshold: '', unstableThreshold: '']], tools: [[$class: 'MSTestJunitHudsonTestType', deleteOutputFiles: true, failIfNotNew: true, pattern: /TestResults/*.trx', skipNoTestFiles: false, stopProcessingIfError: true]]])
是否有解决方案可以将 trx 输出结果与 Jenkins 测试结果视图正确集成?
【问题讨论】: