Wtyczka raportu wyników testu Jenkins JUnit stwierdza, że ​​nie znaleziono pliku xml JUnit?

Dokładna wiadomość otrzymana od Jenkinsa brzmi:

No test report files were found. Configuration error?
Build step 'Publish JUnit test result report' changed build result to FAILURE

Podczas konfigurowania wtyczki raportu wyników testu JUnit po wprowadzeniu ścieżki „Raporty testowe XML” jako „/reports/TEST-*.xml” następujący błąd jest wyświetlany pod ścieżką:

'/reports/TEST-*.xml' doesn't match anything: '' exists but not '/reports/TEST-*.xml'

Próbowałem również użyć pełnej ścieżki, ale daje to ten sam rezultat. W obu przypadkach ścieżki powinny pobrać plik „TESTS-TestSuites.xml”, który był obecny w katalogu / reports.

Nie jestem pewien, czy jest to problem z wtyczką lub generowanym plikiem XML. Zdaję sobie również sprawę z tego, że może to być problem ze skryptem kompilacji ant, który napisałem, aby uruchomić testy JUnit i wygenerować plik wynikowy XML, dlatego zawarłem treść tego poniżej w przypadku, gdy trzeba coś zmienić:

<?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>

Od jakiegoś czasu badam ten problem i nie znalazłem żadnego rozwiązania, więc będę wdzięczny za każdą pomoc. Dzięki.

questionAnswers(2)

yourAnswerToTheQuestion