Vardd
Vardd

Reputation: 1087

How can jenkins find junit.xml in a zip file?

I am running Jenkins on a script, that generates a junit.xml report file and other files. However, all those files are zipped by the script, hence Jenkins cannot find it.

Is there a way to make Jenkins unzip the .zip file , find my particular junit file and generate the run results ?

All this is in Linux.

Thanks

Upvotes: 1

Views: 669

Answers (1)

Brandon McKenzie
Brandon McKenzie

Reputation: 1685

Jenkins has the ability to execute arbitrary shell commands as a build step, just add the 'Execute Shell' step to your build and put in the commands you want (presumably 'unzip' would be among them).

Once you've extracted the xml, provided your internal tool generates it using this schema the JUnit plugin just needs the path you extracted to and it will show the results on the build page.

If you have the option, I would really suggest executing your tests via gradle or maven, as outputs from those tasks will produce a report that Jenkins (and other tools) can already read, and can streamline the job setup process for your users. But, if you can't get away with that, the above should work for you.

Upvotes: 2

Related Questions