bootstraped-multi-test-results-report-plugin icon indicating copy to clipboard operation
bootstraped-multi-test-results-report-plugin copied to clipboard

Variables are ignored when passed in the 'XML Reports Path' field

Open cryptton2004 opened this issue 6 years ago • 7 comments

I'm trying to pass the folder holding the results for the current job, but it seems that the "BUILD_NUMBER" variable is ignored. I tried: XML Reports Path: apiTests\reports\$BUILD_NUMBER\**\*.xml XML Reports Path: apiTests\reports\${BUILD_NUMBER}\**\*.xml XML Reports Path: apiTests\reports\%BUILD_NUMBER%\**\*.xml

Environment is: Windows The output is: [JUnitReportPublisher] Compiling JUnit Html Reports ... [JUnit test report builder] Copying XML files from: E:\tests\Jenkins\workspace\POC_PROJECT\apiTests\reports\${BUILD_NUMBER}\**\*.xml to reports directory: E:\tests\Jenkins\jobs\POC_PROJECT\builds\157\junit-reports-with-handlebars [JUnit test report builder] xml path for the reports might be wrong, E:\tests\Jenkins\jobs\POC_PROJECT\builds\157\junit-reports-with-handlebars

It should normally work with ${BUILD_NUMBER}, but for some reason it just doesn't want to. Am I doing something wrong or is it something in the way the plugin reads/passes this parameter?

Thank you, Cristian

cryptton2004 avatar Jul 25 '18 13:07 cryptton2004

Hi @cryptton2004 have you tried just to provide: apiTests\reports\**\*.xml

BogdanLivadariu avatar Jul 25 '18 13:07 BogdanLivadariu

Yeah, that doesn't work either, it gives me the same error. I also tried: XML Reports Path: apiTests\reports\ with File Include Pattern: **\*.xml But this seems to go through all the jobs, take all the results and copy them to the current build. Is this the intended behavior? Because this will crash eventually on my system as we have thousands result files per job and this method seems to duplicate data each time a build runs.

cryptton2004 avatar Jul 25 '18 14:07 cryptton2004

the pattern there goes through the workspace of the current job, not through all of the jobs

BogdanLivadariu avatar Jul 25 '18 14:07 BogdanLivadariu

I was probably not very clear in my previous posts. Sorry for that. The pattern goes through the workspace. That is correct. The workspace however doesn't belong to a specific job. It's just a directory used for building stuff. It can be wiped (or not) by the latest job, depending on the implementation one uses. In our case, we're not wiping out the data and we're not archiving the artifacts. We're preserving them under a 'buildId' folder, where this 'buildId' is the number of the current job. Let's say, something like this: apiTests\reports\1101\folderStructure]\lotsOfFiles.xml apiTests\reports\1102\folderStructure]\lotsOfFiles.xml apiTests\reports\1103\folderStructure]\lotsOfFiles.xml .... I know it's not the best practice, but there's nothing I can do about it at the moment. Now, as post build action, we're using the "Publish JUnit test result report" action, with the following parameter that works just fine: Test Report XMLs: apiTests\reports\${BUILD_NUMBER}\**\*.xml And I wanted to test out another action, "Publish JUnit reports generated with handle bars", with the same parameter: XML Reports path: apiTests\reports\${BUILD_NUMBER}\**\*.xml

Since this doesn't work for me (it generates the output in the first post), I was wondering if this is a bug (variables are ignored) or just not supported by your plugin (variables passed in the path).

The reason I want to do this is because if I'm not sending that parameter, then the plugin goes through the entire workspace folders and files that match the criteria and it will try to compile all the results from all of our previous builds.

cryptton2004 avatar Jul 26 '18 09:07 cryptton2004

at the moment the pattern does not handle env variables, but I can make it work how urgent do you need it @cryptton2004

BogdanLivadariu avatar Aug 20 '18 09:08 BogdanLivadariu

@BogdanLivadariu see this has gotten a bit stale. If its not still on your roadmap, I can poke around and see if its something i can get working locally and submit as a fork/PR

DustinOgan avatar Feb 07 '20 16:02 DustinOgan

If we're taking votes, this would be incredibly handy for myself too as I'm running into the same problem as the OP

joseph-monahan avatar Aug 15 '23 21:08 joseph-monahan