'ERROR: Step ‘Publish JUnit test result report’ failed: No test report files were found. Configuration error?

I am setting up an Android project from git in Jenkins, I am getting below error :

Recording test results ERROR: Step ‘Publish JUnit test result report’ failed: No test report files were found. Configuration error? Finished: FAILURE

My project have 59 testcases i want to get the test report execution result to be created when Jenkins job is executed.

I have set up the publish JUnit test result report in the POST Build Actions.



Solution 1:[1]

Depending on your build tool, there is a certain path were your unit tests should be located to generate test reports.

For a Gradle Java project as an example, all tests need to be located under src/test/java/...

Otherwise Gradle wont create an testreport.xml and jenkins is not able to pick up the results.

Also look here, topic was already covered: Jenkins JUnit Test Result Report plugin states that the JUnit xml file is not found?

Solution 2:[2]

The above error is generally occurs when the Jenkins unable to find the XML files from the work-space.Need to define the exact location where the xml file is getting created. For eg. Route this way in my environtment Go to Jenkins Route to the project where you are triggering the build. Check for workspace Click on Target Click on Test-results Click on Test_run Here my XML files are available so the same location will defined in my Add Junit Configuration. For eg. **/target/test-results/run_tests/*.xml

Thanks

Solution 3:[3]

junit search files only in current workspace and not from file system root

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 LeonG
Solution 2 Ranjeet Kumar
Solution 3 karlos