Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Display results of multiple TestNG runs in Jenkins pipeline

I am using the Jenkins pipeline to run 2 runlists e.g. test-1.xml and test-2.xml.

Now I want the below code to publish the results of both the runlists test-1.xml and test-2.xml

step([$class: 'Publisher', reportFilenamePattern:' **/test-1/testng-results.xml'])

Separating the runlists by comma doesn't seem to work.

like image 818
Spooferman Avatar asked Nov 28 '25 16:11

Spooferman


1 Answers

in Jenkins testNG plugin source code

/**
* look for testng reports based in the configured parameter includes.
* 'filenamePattern' is
*   - an Ant-style pattern
*   - a list of files and folders separated by the characters ;:,
*
* NOTE: based on how things work for emma plugin for jenkins
*/

so you just need

step([$class: 'Publisher', reportFilenamePattern:' **/test-1/testng-results.xml, **/test-2/testng-results.xml'])

it works on my Jenkins pipeline

like image 51
梁宇坤 Avatar answered Dec 01 '25 08:12

梁宇坤