Jenkins & JUnit: XML path cannot be set
The question may sound silly, but I haven't found how to set up the XML report path in a Post-build Junit task after an hour of manipulation. I am generating a JUnit test report (XML file) here:
C: \ Program Files \ Jenkins \ jobs \ UPWSP \ workspace \ up \ UPWSP \ current \ 06-Java Unit Testing \ junit \ TESTS-TestSuites.xml
And working using XML has its worskpace along this path:
C: \ Program Files \ Jenkins \ jobs \ UPWSP - JUnit Tests \ workspace \
The JUnit report post build task seems to only accept the sibling path and I've already tried with
../../UPWSP/up/UPWSP/current/06-Java Unit Testing / junit / TESTS-TestSuites.xml
** .. / .. / UPWSP / up / UPWSP / current / 06-Java Unit Testing / junit / TESTS-TestSuites.xml
He always tells me that ".." is not a valid path, and an absolute path won't work either. Any idea on how I should use it?
AFAIK, the path for the JUnit XML file should be a subdirectory of your project. It shouldn't be outside the work area. Once you've created a directory inside your workspace, say for example junit-test, then the following should work as expected if specified in the section Test report XMLs
:junit-test\TESTS-TestSuites.xml
You can use wildcards like **/target/surefire-reports/*.xml
or, in your case,**/junit/*.xml
Try putting this in the "Test report XMLs" field (if you are on a Windows machine):
up\UPWSP\current\06-Java Unit Testing\junit\*.xml
I don’t know how to describe the "Working with XML" section in detail. How does this relate to the junit reporting job?
This is a job, not a real answer. I had to copy the xml to the jobs directory using the xcopy command line. My job is working now, but not in the way I expected everything to work.