I have a Jenkins server running in place and it uses a Jenkins pipeline control file that uses a parallel testing plugin to run all of my JUnit tests for multiple agents to speed up testing. We have a blade server that we made (itโs cheaper than buying!), And this accelerated our tests in about 2 hours to 22 minutes. The JUnit plugin works great with parallel tests.
The Jacoco plugin, however, does not. Therefore, I am trying to combine coverage files into one file so that the Jacoco plugin can publish coverage results. Stash / unstash works in the source store, but it does not work when I try to hide various Javaoco output files to unlock them on the main server.
Any ideas why?
Here is my Jenkins file:
#!/usr/bin/env groovy def branch def hash node('remote') { sh 'echo starting' branch = env.gitlabBranch ?: '**' echo "Branch: $branch" checkout([$class: 'GitSCM', branches: [[name: "$branch"]], extensions: [ [$class: 'PruneStaleBranch'], [$class: 'CheckoutOption', timeout: 120], [$class: 'CloneOption', depth: 0, noTags: true, shallow: true, timeout: 180] ], doGenerateSubmoduleConfigurations: false, submoduleCfg: [], userRemoteConfigs: [[credentialsId: 'gitlabLabptop', url: ' git@gitlab.com :protocase/my_project_url.git']] ] ) hash = sh (script: 'git rev-parse HEAD', returnStdout: true).trim()
output i get:
[split7] [jdesigner] Running shell script [split7] + mv build/test/jacoco/jacoco.exec build/test/jacoco/jacoco7.exec [Pipeline] [split7] echo [split7] name: coverage7, unclude jacoco7 [Pipeline] [split7] stash [split7] Stashed 1 file(s) [Pipeline] [split7] echo [split7] stashed [Pipeline] [split7] } [Pipeline] [split7] // node [Pipeline] [split7] } [Pipeline] [split7] // timeout [Pipeline] [split7] } [Pipeline] // parallel [Pipeline] node Running on eightyeight in /var/jenkins/workspace/jdesigner [Pipeline] { [Pipeline] echo collecting exec files [Pipeline] echo unstash coverage0 [Pipeline] unstash [Pipeline] } [Pipeline] End of Pipeline Finished: FAILURE
[edit] cabinet for cover0
[split0] Recording test results [Pipeline] [split0] sh [split0] [jdesigner] Running shell script [split0] + mv build/test/jacoco/jacoco.exec build/test/jacoco/jacoco0.exec [Pipeline] [split0] echo [split0] name: coverage0, include jacoco0 [Pipeline] [split0] stash [split0] Stashed 1 file(s) [Pipeline] [split0] echo [split0] stashed [Pipeline] [split0] } [Pipeline] [split0] // node [Pipeline] [split0] } [Pipeline] [split0] // timeout [Pipeline] [split0] } [split3] [junit] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 18.737 sec [split3] [junit] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 18.737 sec
note the line
[split0] name: coverage0, include jacoco0
- this is just my echo instruction, in which I repeat the name from this part of the script:
sh "mv build/test/jacoco/jacoco.exec build/test/jacoco/jacoco${index}.exec" echo "name: coverage$index, include jacoco${index}" stash name: "coverage$index", includes: "build/test/jacoco/jacoco${index}.exec" echo "stashed"
Note that the actual erasure is not performed on the node, it is indicated as a pipeline, even if it is performed on the remote node device. I saw things that indicated that the cover was being done on the main computer, but not really where this directory was located.
[[FURTHER EDITION]] - thanks to the recommendations of eis.
In the directory jobs / jdesigner / builds / 1639 / stashes / on the main server there are files with the extension # .tar.gz that contain the corresponding jacoco # .exec files. When I set an attempt to catch the instability:
try { unstash name: "coverage${it}" } catch (error) { echo "error unstashing: ${error}" }
output i get:
collecting exec files [Pipeline] echo unstash coverage0 [Pipeline] unstash [Pipeline] echo error unstashing: java.io.NotSerializableException: groovy.lang.IntRange [Pipeline] echo make file name