ジェンキンスから受信した正確なメッセージがある:Jenkins JUnitテスト結果レポートのプラグインには、JUnit xmlファイルが見つからないと記載されていますか?
No test report files were found. Configuration error?
Build step 'Publish JUnit test result report' changed build result to FAILURE
、「/reports/TEST-*.xml」と「テストレポートXMLS」パスを入力することで、次のエラーがJUnitテスト結果報告プラグインを設定する場合パスの下に表示されます。
'/reports/TEST-*.xml' doesn't match anything: '' exists but not '/reports/TEST-*.xml'
私は同様に完全なパスを使用して試してみましたが、それは同じ結果を生成します。どちらの場合も、パスは/ reportsディレクトリにある 'TESTS-TestSuites.xml'ファイルを選択しているはずです。
私は、これはプラグインや、生成されたXMLファイルに問題があるかどうかはわかりません。何かを変更する必要がある場合には、私はまた、私はJUnitテストを実行するように書かれているAntビルドスクリプトで問題になると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>
私は今、しばらくの間、この問題に研究してきましたし、私は任意の助けをいただければ幸いですので、任意の解決策を見つけていません。ありがとう。
あなたは少なくとも一度テストを実行しましたか?このエラーは、プラグインを初めて設定するときに表示されます。 – Jayan
ええ、テストは正常に実行され、ビルドが成功したと言います。プラグインでレポートを生成しようとしても、ビルドが失敗するだけです。 – Ben
@ Ben:jenkins-> job-> workspace - > ...でTEST * xmlファイルを参照できますか?実際にどのパターンが本当に必要なのかを知ることができます。 Shiva Kumarの答えが働いたはずです。 – Jayan