Точное сообщение, полученное от jenkins:
No test report files were found. Configuration error?
Build step 'Publish JUnit test result report' changed build result to FAILURE
При настройке плагина отчета JUnit Test Result Report при вводе пути "Test Report XMLs" в качестве "/reports/TEST-*.xml" ниже пути отображается следующая ошибка:
'/reports/TEST-*.xml' doesn't match anything: '' exists but not '/reports/TEST-*.xml'
Я тоже пытался использовать полный путь, но это дает тот же результат. В обоих случаях пути должны были получить файл TESTS-TestSuites.xml, который присутствовал в каталоге /reports.
Я не уверен, что это проблема с плагином или созданным XML файлом. Я также знаю, что это может быть проблемой с ant build script, который я написал для запуска тестов JUnit и создания файла результатов XML, поэтому я включил содержимое этого ниже в случае, если что-то должно быть изменено:
<?xml version="1.0" encoding="utf-8"?>
<project name="jenkins-tests" basedir="." default="linux">
<property name="junit.output.dir" value="output"/>
<property name="src.dir" value="src"/>
<property name="lib.dir" value="libs" />
<property name="bin.dir" value="bin" />
<property name="full-compile" value="true" />
<path id="classpath.base"/>
<path id="classpath.test">
<pathelement location="${bin.dir}" />
<pathelement location="${src.dir}" />
<pathelement location="${lib.dir}" />
<pathelement location="${lib.dir}/junit.jar" />
<path refid="classpath.base" />
</path>
<target name="clean" description="Clean up build artefacts">
<delete dir="${basedir}/${junit.output.dir}" />
</target>
<target name="prepare" depends="clean" description="Prepare for build">
<mkdir dir="${basedir}/${junit.output.dir}" />
<mkdir dir="${junit.output.dir}/reports"/>
</target>
<target name="compile" depends="prepare">
<javac srcdir="${src.dir}" destdir="${bin.dir}" verbose="${full-compile}" includeAntRuntime="false" >
<classpath refid="classpath.test"/>
</javac>
</target>
<target name="test" depends="compile">
<junit printsummary="true" haltonfailure="false">
<formatter type="xml" usefile="true"/>
<classpath refid="classpath.test" />
<batchtest fork="yes" todir="${junit.output.dir}">
<fileset dir="${src.dir}">
<include name="*.java"/>
</fileset>
</batchtest>
</junit>
</target>
<target name="test-reports" depends="test">
<junitreport tofile="TESTS-TestSuites.xml" todir="${junit.output.dir}/reports">
<fileset dir="${junit.output.dir}">
<include name="TEST-*.xml" />
</fileset>
<report format="frames" todir="${junit.output.dir}/reports" />
</junitreport>
</target>
</project>
Я уже некоторое время изучаю эту проблему и не нашел решения, поэтому буду признателен за любую помощь. Спасибо.