【问题标题】:.NET Core 1.1, xUnit integration with Jenkins Test Result.NET Core 1.1,xUnit 与 Jenkins 测试结果的集成
【发布时间】: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 测试结果视图正确集成?

【问题讨论】:

    标签: jenkins .net-core xunit


    【解决方案1】:

    我们使用 Jenkins 和 dotnet testhttps://github.com/dotnet/cli 中的 trx。

    我们制作this call

    Utilities.addMSTestResults(newJob, '**/*.trx')
    

    addMSTestResultsimplemented here

    您应该能够效仿我们的做法。

    【讨论】:

      猜你喜欢
      • 2020-04-02
      • 2018-08-08
      • 2017-04-25
      • 2016-05-03
      • 1970-01-01
      • 2020-10-27
      • 1970-01-01
      • 1970-01-01
      • 2018-05-27
      相关资源
      最近更新 更多