JUnit Parser: Test results are not found

Still need help?

The Atlassian Community is here for you.

Ask the community

Symptoms

Even though the files exist, build fails with:

simple	21-Jun-2013 18:03:32	Failing task since test cases were expected but none were found.

Or:

Could not find test result reports in the C:\Users\ssetayeshfar\bamboo-home-445\xml-data\build-dir\PROJECT-PLAN-JOB directory

Cause

Bamboo checks for the test result too quickly. See   BAM-12979 - Getting issue details... STATUS

Solution

Bamboo uses a system property bamboo.fs.timestamp.precision to define FS timestamp resolution. By default it is set to 100 (ms), please set it to a higher value in order to make file date check less strict. Bamboo does check-in the following way:

private boolean isFileRecentEnough(final File file)
{
  return file.lastModified() >= (taskStartDate.getTime() - SystemProperty.FS_TIMESTAMP_RESOLUTION_MS.getTypedValue());
}

Other items to check

  1. Double-check the task configuration and confirm that it is configured to look for the test results file in the current working directory of the job (Ex.: C:\Users\ssetayeshfar\bamboo-home-445\xml-data\build-dir\PROJECT-PLAN-JOB) and NOT a sub-directory (Ex. C:\Users\ssetayeshfar\bamboo-home-445\xml-data\build-dir\PROJECT-PLAN-JOB/test-results).
  2. In case the test report is not produced by the build (it was produced earlier) use a 'touch' command right before the JUnit task.

    Note: In cases that test results are somewhat produced from a script task that uses operations like copy or move, they should place the XML file in the repository for it to be checkout to your working directory and then use the parser directly.

Last modified on Sep 25, 2019

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.