jest-html-reporters icon indicating copy to clipboard operation
jest-html-reporters copied to clipboard

jenkins build error : No test report files were found. Configuration error?

Open meta-dipanshu-sharma opened this issue 2 years ago • 2 comments

Describe the bug Error jenkins build error : No test report files were found. Configuration error? is thrown by jenkins when we skip unit test step in jenkins and it fails the build. I couldn't find a variable which allows empty or no test report files so that no error is thrown. Is there any plan to add a variable which will allow the empty or no test report files?

To Reproduce Steps to reproduce the behavior:

  1. run a jenkins build while skipping unit test step so that no test report file is generated. Above error will be thrown in this scenario.

Expected behavior There should be a variable which will allow empty test report files and build should not fail when there's no test report file generated if that variable value is true.

meta-dipanshu-sharma avatar Jun 30 '22 15:06 meta-dipanshu-sharma

Hi @meta-dipanshu-sharma , I am not familiar with Jenkins, but seems this was not related to this project, we did never throw such an error.

Hazyzh avatar Jul 03 '22 03:07 Hazyzh

I think this is related to the junit.xml output location. After adding this report generator, the junit.xml is getting generated in the root folder. This config in jest.conf.js fixed it for me:

...
  reporters: [
    'default',
    ['./node_modules/jest-junit', {
      outputDirectory: 'build/report/tests'
    }],
    ['./node_modules/jest-html-reporters', {
      publicPath: 'build/report/jest-report',
      pageTitle: 'Jest Test Report'
    }]
  ],
...

matthewhaywardmsm avatar Jul 04 '22 10:07 matthewhaywardmsm

Closed due to long time no response. feel free to reopen.

Hazyzh avatar Sep 11 '22 15:09 Hazyzh