Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Flutter and app store releases

Jenkins finds no JUnit report after an iOS test run

ErrorNo test report files were found. Configuration error?

Short answer

The junit step only reads JUnit XML files. A plain xcodebuild test run does not write one, so the step finds nothing and fails the build. Make the test step output JUnit XML into a known folder, then give the step an Ant-style pattern that matches it.

  • Applies to JUnit plugin, fastlane 2, Xcode 26
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Look in the job workspace for XML files after the test stage runs. If the list is empty, the report was never written; if it has files, the pattern is wrong.

    find . -name "*.xml" -path "*test*"
  2. 2Match what you see, then jump to its fix

    1. 1The workspace has no XML report at all after the test stageThe test run never wrote a JUnit fileFix
    2. 2The XML exists in the workspace, but the build still reports no filesThe junit pattern does not match where the file isFix
    3. 3The failing run is a build or lint job, and no test stage ran before the junit stepA stage that legitimately has no tests runs the step tooFix

What does the error look like?

  • No test report files were found. Configuration error?

Cause 1 of 3

The test run never wrote a JUnit file

1Check

The step expects JUnit XML files. Plain test output goes to the console or an Xcode result bundle, and neither is JUnit XML.

grep -rn "scan\|run_tests\|xcodebuild" Fastfile Jenkinsfile

2Fix

Run the tests through fastlane's run_tests (scan), whose output_types defaults to html and junit, and set the output_directory so the location is known.

# Fastfile
lane :test do
  run_tests(
    scheme: "MyApp",
    output_types: "junit",
    output_directory: "./fastlane/test_output"
  )
end

3Verify

Run the lane and list the output folder.

bundle exec fastlane test
ls fastlane/test_output

Confirmed by docs.fastlane.tools

Did this fix it?

Cause 2 of 3

The junit pattern does not match where the file is

1Check

The step takes the path to JUnit XML files in Ant glob syntax, for example a pattern like **/build/test-reports/*.xml, and it should not include non-report files.

find . -name "*.xml" -path "*test_output*"

2Fix

Use a glob that matches the folder you set above.

// Jenkinsfile
post {
  always {
    junit testResults: 'fastlane/test_output/*.xml'
  }
}

3Verify

Run the job again and open the Test Result page.

# In Jenkins: build page > Test Result

Confirmed by jenkins.io

Did this fix it?

Cause 3 of 3

A stage that legitimately has no tests runs the step too

1Check

By default, the step fails a build on missing test result files or empty results.

grep -n "junit" Jenkinsfile

2Fix

Move the junit step to the stage that runs the tests, or set allowEmptyResults for jobs that may have none.

junit testResults: 'fastlane/test_output/*.xml', allowEmptyResults: true

3Verify

Run a job without tests and confirm the build does not fail on the step.

# Jenkins build console: junit step finishes without the error

Confirmed by jenkins.io

Did this fix it?

How do I stop it coming back?

  • Set an explicit output folder for the test step instead of relying on a default.
  • Archive the raw test output folder too, so a missing report can be diagnosed from the build page.
  • Keep the junit step in the same stage as the tests it reads.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Related fixes

Mobile apps

App record creation fails because you lack permission

You cannot add a new app in App Store Connect as a Developer or limited user

Only the Account Holder, an Admin or an App Manager can create an app record, and Apple blocks it until the Account Holder has signed the latest agreement.

3 causes, each with a fix

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.