Thông điệp chính xác nhận được từ Jenkins là:Plugin Jenkins JUnit Test Result Report cho biết rằng tệp JUnit xml không được tìm thấy?
No test report files were found. Configuration error?
Build step 'Publish JUnit test result report' changed build result to FAILURE
Khi cấu hình JUnit thử nghiệm Kết quả Báo cáo plugin, khi bước vào con đường 'Test Report XMLs' là '/reports/TEST-*.xml', các lỗi sau được hiển thị bên dưới đường dẫn:
'/reports/TEST-*.xml' doesn't match anything: '' exists but not '/reports/TEST-*.xml'
Tôi đã thử sử dụng đường dẫn đầy đủ nhưng cũng tạo ra kết quả tương tự. Trong cả hai trường hợp, các đường dẫn đã chọn tệp 'TESTS-TestSuites.xml' đã có trong thư mục/reports.
Tôi không chắc liệu đây có phải là vấn đề với plugin hoặc tệp XML đang được tạo hay không. Tôi cũng biết rằng nó có thể là một vấn đề với kịch bản kiến xây dựng mà tôi đã viết để chạy các kiểm tra JUnit và tạo ra tệp kết quả XML do đó tôi đã bao gồm các nội dung bên dưới trong trường hợp cần thay đổi:
<?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>
Tôi đã nghiên cứu vấn đề này một thời gian và không tìm thấy giải pháp nào vì vậy tôi sẽ đánh giá cao bất kỳ trợ giúp nào. Cảm ơn.
Bạn chạy các bài kiểm tra ít nhất một lần? Lỗi này xuất hiện khi định cấu hình plugin lần đầu tiên. – Jayan
Vâng, các thử nghiệm chạy tốt và nói rằng việc xây dựng thành công. Nó chỉ cố gắng để tạo ra các báo cáo với các plugin gây ra việc xây dựng thất bại. – Ben
@ Ben: Bạn có thể duyệt qua các tệp TEST * xml qua jenkins-> job-> workspace -> ... không? Nó sẽ cho một ý tưởng về mô hình thực sự cần thiết. Câu trả lời của Shiva Kumar đã có tác dụng. – Jayan