Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jenkins & JUnit : Path to XML impossible to set

Tags:

junit

xml

jenkins

The question may sound silly, but I haven't found how to configure the XML report path in the Post-build Junit task after an hour of manipulations. I generate the JUnit test report (the XML file) here :

C:\Program Files\Jenkins\jobs\UPWSP\workspace\up\UPWSP\current\06-Java Unit Testing\junit\TESTS-TestSuites.xml

And the job using the XML has its worskpace at this path :

C:\Program Files\Jenkins\jobs\UPWSP - Tests JUnit\workspace\

The JUnit report post-build task seems to take only relatives path and I 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

It always tells me '..' is not a valid path, and an absolute path won't work either. Any idea of how I should use it?

like image 397
nivolas Avatar asked Sep 11 '14 08:09

nivolas


People also ask

What Jenkins is used for?

Jenkins is an open source continuous integration/continuous delivery and deployment (CI/CD) automation software DevOps tool written in the Java programming language. It is used to implement CI/CD workflows, called pipelines.

Is Jenkins a CI or CD?

Jenkins is a platform for creating a Continuous Integration/Continuous Delivery (CI/CD) environment. The system offers many different tools, languages, and automation tasks to aid in pipeline creation when developing and deploying programs.

What is the difference between GitHub and Jenkins?

Jenkins creates workflows using Declarative Pipelines, which are similar to GitHub Actions workflow files. Jenkins uses stages to run a collection of steps, while GitHub Actions uses jobs to group one or more steps or individual commands. Jenkins and GitHub Actions support container-based builds.

What is difference between Maven and Jenkins?

A maven is a build tool designed to manage dependencies and the software lifecycle. It is also designed to work with plugins that allow users to add other tasks to the standard compile, test, package, install, deploy tasks. Jenkins is designed for the purpose of implementing Continuous Integration (CI).


2 Answers

AFAIK, the path for the JUnit XML file has to be a sub-directory of your project. It should not be outside the job's workspace. Once you have created a directory inside workspace, say for example, junit-test, then the following should work as expected when specified in Test report XMLs section: junit-test\TESTS-TestSuites.xml

like image 133
Technext Avatar answered Sep 20 '22 22:09

Technext


You can use wildcards like **/target/surefire-reports/*.xml or, in your case, **/junit/*.xml

like image 29
volkovs Avatar answered Sep 20 '22 22:09

volkovs