Skip to content
Latchkey

Jenkins "none of the test reports contained any results" (junit) in CI

The junit step found no test result XML that it could parse: either the glob matched nothing, the files were empty, or they were older than the build. By default the step fails the build to flag that tests did not actually produce results.

What this error means

The build fails (or goes UNSTABLE) with Test reports were found but none of them are new or none of the test reports contained any results, even though the test command appeared to run.

Jenkins console
[Pipeline] junit
Recording test results
ERROR: Step 'Publish JUnit test result report' failed:
None of the test reports contained any results.

Common causes

The glob does not match the report path

The testResults pattern points at the wrong directory, or the test runner wrote reports somewhere else, so no files match.

Tests did not run or produced empty reports

The test step exited before generating XML (a crash, no tests selected), leaving empty or absent reports for junit to read.

How to fix it

Point junit at the real report files

  1. List the workspace to find where the test XML was written.
  2. Set testResults to a glob that matches those files (relative to the workspace).
  3. Ensure the test step actually ran and produced non-empty reports before junit.
Jenkinsfile
junit testResults: '**/build/test-results/**/*.xml', allowEmptyResults: false

How to prevent it

  • Generate test reports in a known directory and match it precisely.
  • Run the test step before junit, not in a branch that may be skipped.
  • Use allowEmptyResults: true only when an empty run is genuinely acceptable.

Frequently asked questions

What causes ""none of the test reports contained any results""?
The testResults pattern points at the wrong directory, or the test runner wrote reports somewhere else, so no files match.
How do I fix "none of the test reports contained any results"?
Point junit at the real report files

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card