Reputation: 16311
I am working with:
I am able to execute a Main java class through a Gradle task through Jenkins.
Therefore I can execute a Job N times to work around JMX and for each Job execution I have the Build History
where I am able to see the logging outputs from my business classes for each interaction.
Note the history saves each logging outputs for each Job's execution
The problem is with testing.
Through Jenkins I am able to execute a Job related with a Gradle Test command, such as: gradle test --tests
. Here two behaviors:
build\reports\tests\test
(it is the expected, I am fine with this)Gradle
test command but all the logging outputs are only posted through the Gradle Test reports but not in Jenkins, it in Build History
. Thus the Jenkins
does not contain the logging outputs from my business classes. Therefore if I execute N times through my developing cycle the Test Job. I only am able to see the latest logging outputs only through the Gradle Test Reports
, sadly Jenkins
does not keep these logging outputs through Build History
.
How resolve this? Some basic configuration or a plugin is need it?
Upvotes: 1
Views: 1630
Reputation: 6549
In order to save junit reports in Jenkins, you can use JUnit Plugin
Individual reports are located at build/test-results/test/.xml*
If you are using Declarative Pipelines you can use the following script
junit 'build/test-results/test/*.xml'
Since you are pointing to build\reports\tests\test\index.html which is the gradle test report, you can also save that report using HTML Publisher Plugin
My suggestiong is to use JUnit Plugin for better integration.
Upvotes: 2
Reputation: 982
To save artifacts from your build you can use the archiveArtifacts
pipeline command
It would look something like:
archiveArtifacts artifacts: 'build/reports/tests/test/*'
Upvotes: 2