【问题标题】:Jenkins JUnit Test Result Report plugin states 4 test report file(s) were found with the pattern '**/unit-tests.xml'?Jenkins JUnit 测试结果报告插件指出 4 个测试报告文件被发现与模式 '**/unit-tests.xml'?
【发布时间】:2020-06-02 05:29:13
【问题描述】:

INFO:开始录制。 信息:处理 JUnit 信息:[JUnit] - 发现 4 个测试报告文件,模式为 '**/unit-tests.xml',相对于测试框架 'JUnit' 的 'E:\Jenkins-ws{foldername}'。

我在 Jenkins 中处理 JUnit 时收到上述消息。我的测试成功了,詹金斯由于这个问题而失败了。这是我的 karma.config 文件。

basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
  require('karma-jasmine'),
  require('karma-chrome-launcher'),
  require('karma-jasmine-html-reporter'),
  require('karma-coverage-istanbul-reporter'),
  require('@angular-devkit/build-angular/plugins/karma'),
  require('karma-junit-reporter')
],
client: {
  clearContext: false // leave Jasmine Spec Runner output visible in browser
},
junitReporter: {
        outputDir: "test-results",
        outputFile: "unit-tests.xml"
},
coverageIstanbulReporter: {
  dir: require('path').join(__dirname, '../coverage'),
  reports: ['html', 'lcovonly'],
  fixWebpackSourcePaths: true
},
reporters: ['progress', 'junit', 'kjhtml'],

【问题讨论】:

    标签: angular jenkins junit jenkins-plugins karma-runner


    【解决方案1】:

    问题在于我在 CI 脚本中给出的模式

    xunit([JUnit(deleteOutputFiles: true, failIfNotNew: true, pattern: '**/unit-tests.xml', skipNoTestFiles: false, stopProcessingIfError: true)])
    

    我们有四个不同的 Angular 项目,每个项目都有 unit-tests.xml 文件。我已经重命名了文件并更新了 CI 脚本,如下所示。

     xunit([JUnit(deleteOutputFiles: true, failIfNotNew: true, pattern: '**/unit-tests-project1.xml', skipNoTestFiles: false, stopProcessingIfError: true)])
    

    现在,该文件夹中只有一个具有该名称的文件,并且测试成功。

    【讨论】:

      猜你喜欢
      • 2013-02-02
      • 2016-05-03
      • 1970-01-01
      • 2016-11-29
      • 1970-01-01
      • 2023-03-05
      • 2019-07-05
      • 2022-07-14
      • 1970-01-01
      相关资源
      最近更新 更多