【问题标题】:No test result files matching **/test-*.xml were found - Azure DevOps找不到与 **/test-*.xml 匹配的测试结果文件 - Azure DevOps
【发布时间】:2021-09-07 01:13:07
【问题描述】:

我正在尝试在 azure 中发布测试结果,但我无法做到。这是我使用 azure 的第二天,所以我可能会遗漏一些东西。

我的管道代码是

- task: PublishTestResults@2
  inputs:
    testResultsFormat: 'JUnit'
    testResultsFiles: '**/test-*.xml'

karma.conf.js

junitReporter: {
             outputDir: '.',
             outputFile:'test-report.xml'
         },

我正在使用最新的 ubuntu。 但总是在我运行管道时出现此错误

##[warning]No test result files matching **/test-*.xml were found.

我尝试了小写大写,但没有任何效果,我不知道我做错了什么。 如有任何提示,我将不胜感激。

【问题讨论】:

标签: angular azure junit azure-devops azure-devops-pipelines


【解决方案1】:

我也遇到了同样的问题。

我修复了更改代理规范的问题。

【讨论】:

    【解决方案2】:

    您的 PublishTestResults 任务指定了 JUnit,但您需要确保 karma 正在生成 JUnit 报告。您从 karma.conf.js 显示的 sn-p 不足以验证这一点。

    你安装了 karma-junit-reporter npm 包吗?

    npm install karma-junit-reporter --save-dev
    

    你是否在 karma.conf.js 插件数组中添加了 karma-junit-reporter?

    require('karma-junit-reporter')
    

    你是否在 karma.conf.js 记者数组中添加了 junit?

    reporters: ['progress', 'kjhtml', 'junit'],
    

    然后确保 PublishTestResults 任务具有正确的模式。我的看起来像这样,因为我没有指定任何 junitReporter 设置,您在示例中显示。

    testResultsFiles: "**/TESTS*.xml"
    

    我从这个例子中学到了很多: https://www.olivercoding.com/2020-01-02-angular-azure-devops/

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-06-25
      • 1970-01-01
      • 2022-09-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多