JUnit Parser: Test results are not found

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

症状

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.

または

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

原因

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

ソリューション

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.

最終更新日 2019 年 9 月 25 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.