0
votes

INFO: Starting to record. INFO: Processing JUnit INFO: [JUnit] - 4 test report file(s) were found with the pattern '**/unit-tests.xml' relative to 'E:\Jenkins-ws{foldername}' for the testing framework 'JUnit'.

I'm getting above message while processing JUnit in Jenkins. My tests are succeeded and jenkins getting failed due to this issue. Here is my karma.config file.

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'],
1

1 Answers

0
votes

The issue was with the pattern I have given in CI script

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

We have four different Angular projects and each project has unit-tests.xml file. I have renamed the file and updated CI script like below.

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

Now, only one file is there in the folder with that name and test is successfull.