code-coverage-api-plugin
code-coverage-api-plugin copied to clipboard
Improve documentation on how to approving source directories
Jenkins and plugins versions report
Environment
Jenkins: 2.364
OS: Windows 10 - 10.0
---
ace-editor:1.1
analysis-model-api:10.16.0
ansicolor:1.0.2
ant:475.vf34069fef73c
antisamy-markup-formatter:2.7
apache-httpcomponents-client-4-api:4.5.13-138.v4e7d9a_7b_a_e61
authentication-tokens:1.4
blueocean:1.25.6
blueocean-autofavorite:1.2.5
blueocean-bitbucket-pipeline:1.25.6
blueocean-commons:1.25.6
blueocean-config:1.25.6
blueocean-core-js:1.25.6
blueocean-dashboard:1.25.6
blueocean-display-url:2.4.1
blueocean-events:1.25.6
blueocean-git-pipeline:1.25.6
blueocean-github-pipeline:1.25.6
blueocean-i18n:1.25.6
blueocean-jira:1.25.6
blueocean-jwt:1.25.6
blueocean-personalization:1.25.6
blueocean-pipeline-api-impl:1.25.6
blueocean-pipeline-editor:1.25.6
blueocean-pipeline-scm-api:1.25.6
blueocean-rest:1.25.6
blueocean-rest-impl:1.25.6
blueocean-web:1.25.6
bootstrap4-api:4.6.0-5
bootstrap5-api:5.2.0-1
bouncycastle-api:2.26
branch-api:2.1046.v0ca_37783ecc5
build-timeout:1.21
caffeine-api:2.9.3-65.v6a_47d0f4d1fe
calendar-view:0.3.2
checks-api:1.7.5
cloudbees-bitbucket-branch-source:785.ve724eb_44e286
cloudbees-folder:6.758.vfd75d09eea_a_1
cobertura:1.17
code-coverage-api:3.0.5
command-launcher:84.v4a_97f2027398
credentials:1139.veb_9579fca_33b_
credentials-binding:523.vd859a_4b_122e6
cvs:2.19.1
dark-theme:185.v276b_5a_8966a_e
data-tables-api:1.12.1-2
datadog:4.0.0
display-url-api:2.3.6
docker-commons:1.19
docker-workflow:521.v1a_a_dd2073b_2e
durable-task:500.v8927d9fd99d8
echarts-api:5.3.3-1
email-ext:2.91
external-monitor-job:192.ve979ca_8b_3ccd
favorite:2.4.1
font-awesome-api:6.1.2-1
forensics-api:1.15.1
git:4.11.4
git-client:3.11.2
git-forensics:1.9.0
git-server:99.va_0826a_b_cdfa_d
gitea:1.4.3
github:1.35.0
github-api:1.303-400.v35c2d8258028
github-branch-source:1677.v731f745ea_0cf
gitlab-api:5.0.1-78.v47a_45b_9f78b_7
gitlab-branch-source:633.ved9984f943da_
gradle:1.39.4
handlebars:3.0.8
handy-uri-templates-2-api:2.1.8-22.v77d5b_75e6953
htmlpublisher:1.30
instance-identity:116.vf8f487400980
jackson2-api:2.13.3-285.vc03c0256d517
jakarta-activation-api:2.0.1-1
jakarta-mail-api:2.0.1-1
javadoc:226.v71211feb_e7e9
javax-activation-api:1.2.0-4
javax-mail-api:1.6.2-7
jaxb:2.3.6-1
jdk-tool:55.v1b_32b_6ca_f9ca
jenkins-design-language:1.25.6
jersey2-api:2.36-2
jira:3.7.1
jjwt-api:0.11.5-77.v646c772fddb_0
jnr-posix-api:3.1.15-1
jquery:1.12.4-1
jquery-detached:1.2.1
jquery3-api:3.6.0-4
jsch:0.1.55.61.va_e9ee26616e7
junit:1119.1121.vc43d0fc45561
ldap:2.11
locale:180.v207501dff9b_a_
lockable-resources:2.16
mailer:438.v02c7f0a_12fa_4
mapdb-api:1.0.9-28.vf251ce40855d
matlab:2.8.0
matrix-auth:3.1.5
matrix-project:785.v06b_7f47b_c631
mercurial:2.16.2
mina-sshd-api-common:2.8.0-36.v8e25ce90d4b_1
mina-sshd-api-core:2.8.0-36.v8e25ce90d4b_1
momentjs:1.1.1
monitoring:1.91.0
msbuild:1.30
okhttp-api:4.9.3-108.v0feda04578cf
pam-auth:1.10
pipeline-build-step:2.18
pipeline-github-lib:38.v445716ea_edda_
pipeline-graph-analysis:195.v5812d95a_a_2f9
pipeline-groovy-lib:612.v84da_9c54906d
pipeline-input-step:449.v77f0e8b_845c4
pipeline-milestone-step:101.vd572fef9d926
pipeline-model-api:2.2114.v2654ca_721309
pipeline-model-definition:2.2114.v2654ca_721309
pipeline-model-extensions:2.2114.v2654ca_721309
pipeline-rest-api:2.24
pipeline-stage-step:293.v200037eefcd5
pipeline-stage-tags-metadata:2.2114.v2654ca_721309
pipeline-stage-view:2.24
plain-credentials:139.ved2b_9cf7587b
plugin-util-api:2.17.0
popper-api:1.16.1-3
popper2-api:2.11.5-2
prism-api:1.28.0-2
pubsub-light:1.17
resource-disposer:0.19
saferestart:0.3
scm-api:621.vda_a_b_055e58f7
script-security:1175.v4b_d517d6db_f0
snakeyaml-api:1.30.2-76.vc104f7ce9870
sse-gateway:1.26
ssh-credentials:295.vced876c18eb_4
ssh-slaves:1.834.v622da_57f702c
sshd:3.249.v2dc2ea_416e33
structs:324.va_f5d6774f3a_d
subversion:2.16.0
tap:2.3
theme-manager:1.5
thinBackup:1.10
timestamper:1.18
token-macro:308.v4f2b_ed62b_b_16
trilead-api:1.71.v9e7860a_67a_df
variant:59.vf075fe829ccb
versioncolumn:2.2
warnings-ng:9.18.0
windows-slaves:1.8.1
workflow-aggregator:590.v6a_d052e5a_a_b_5
workflow-api:1192.v2d0deb_19d212
workflow-basic-steps:991.v43d80fea_ff66
workflow-cps:2759.v87459c4eea_ca_
workflow-cps-global-lib:588.v576c103a_ff86
workflow-durable-task-step:1199.v02b_9244f8064
workflow-job:1232.v5a_4c994312f1
workflow-multibranch:716.vc692a_e52371b_
workflow-scm-step:400.v6b_89a_1317c9a_
workflow-step-api:639.v6eca_cd8c04a_a_
workflow-support:838.va_3a_087b_4055b
ws-cleanup:0.42
What Operating System are you using (both controller, and any agents involved in the problem)?
all Win10
Reproduction steps
- run inside the Jenkins file the pipeline step:
publishCoverage adapters: [coberturaAdapter('matlabTestArtifacts/cobertura.xml')], sourceDirectories: [[path: 'Z:/Programming/Libraries/Simulink/Lib/v3.50/Tools']],sourceFileResolver: sourceFiles('STORE_LAST_BUILD')
Expected Results
able to do source navigation
Actual Results
error in the console:
13:49:25 Publishing Coverage report....
13:49:26 A total of 1 reports were found
13:49:26 Report coverage diff: 0.0%. Add to CoverageResult.
13:49:26 Group coverage diff: 0.0%. Add to CoverageResult.
13:49:26 Package coverage diff: 0.0%. Add to CoverageResult.
13:49:26 File coverage diff: 0.0%. Add to CoverageResult.
13:49:26 Class coverage diff: 0.0%. Add to CoverageResult.
13:49:26 Line coverage diff: 0.0%. Add to CoverageResult.
13:49:26 [Coverage] Computing coverage delta report
13:49:26 [Coverage] Reference build recorder is not configured
13:49:26 [Coverage] -> No reference build defined, falling back to previous build
13:49:26 [Coverage] -> Found reference result 'io.jenkins.plugins.coverage.CoverageAction@67093409'
13:49:27 The recommended git tool is: NONE
13:49:27 using credential 6d7e06ce-ab13-4c84-a3f4-bfdb7f54e0c5
13:49:27 The recommended git tool is: NONE
13:49:27 using credential 6d7e06ce-ab13-4c84-a3f4-bfdb7f54e0c5
13:49:27 [Coverage] [-ERROR-] Errors during source code painting:
13:49:27 [Coverage] [-ERROR-] Removing source directory 'Z:/Programming/Libraries/Simulink/Lib/v3.50/Tools' - it has not been approved in Jenkins' global configuration.
13:49:27 [Coverage] [-ERROR-] Source file 'Tools\FindParameterizedLinks.m' not found
13:49:27 [Coverage] [-ERROR-] Source file 'mGraph3D.m' not found
13:49:27 [Coverage] [-ERROR-] Source file 'Tools\ShowSVIvars.m' not found
13:49:27 [Coverage] [-ERROR-] Source file 'Tools\sl_customization.m' not found
13:49:27 [Coverage] [-ERROR-] Source file 'TuneParams.m' not found
13:49:27 [Coverage] [-ERROR-] Source file 'Interfaces\MakeMdlRef.m' not found
13:49:27 [Coverage] [-ERROR-] Source file 'slblocks.m' not found
13:49:27 [Coverage] [-ERROR-] Source file 'WavesProc.m' not found
13:49:27 [Coverage] [-ERROR-] Source file 'tsync.m' not found
13:49:27 [Coverage] [-ERROR-] Source file 'Interfaces\SetupMTarget.m' not found
13:49:27 [Coverage] [-ERROR-] Source file 'get_libs.m' not found
13:49:27 [Coverage] [-ERROR-] Source file 'Tools\Check4Junk.m' not found
13:49:27 [Coverage] [-ERROR-] Source file 'Interfaces\JavaTree\ListSVIdB.m' not found
13:49:27 [Coverage] [-ERROR-] Source file 'Interfaces\ActiveXTree\ListSVIdB.m' not found
13:49:27 [Coverage] [-ERROR-] Source file 'LED2Color.m' not found
13:49:27 [Coverage] [-ERROR-] Source file 'Examples\Contents.m' not found
13:49:27 [Coverage] [-ERROR-] Source file 'Tools\CsvExtract.m' not found
13:49:27 [Coverage] [-ERROR-] Source file 'mGraph2D.m' not found
13:49:27 [Coverage] [-ERROR-] Source file 'Examples\mForceRAOnv.m' not found
13:49:27 [Coverage] Verify uniqueness of file paths...
13:49:27 [Coverage] Obtaining action of reference build
13:49:27 [Coverage] Reference build recorder is not configured
13:49:27 [Coverage] -> No reference build defined, falling back to previous build: '#11'
13:49:27 [Coverage] -> Found reference result in build '#11'
13:49:27 [Coverage] Calculating the code delta...
13:49:27 [Coverage] -> Git delta calculator successfully created in working tree 'D:/jenkinslocaal/workspace/stMTarget_Update-Interface-Tests'
13:49:27 [Coverage] Invoking Git delta calculator for determining the made changes between the commits with the IDs 8be56d8467f2b2e6df1de114f6b924db7ba9bc88 and 8be56d8467f2b2e6df1de114f6b924db7ba9bc88
13:49:27 [Coverage] Start scanning for differences between commits...
13:49:27 [Coverage] 0 files contain changes
13:49:27 [Coverage] Creating the Git diff file
13:49:27 [Coverage] Verify uniqueness of reference file paths...
13:49:27 [Coverage] Preprocessing code changes...
13:49:27 [Coverage] Successfully mapped SCM paths to coverage report paths
13:49:27 [Coverage] Successfully mapped SCM paths to coverage report paths
13:49:27 [Coverage] Obtaining code changes for files...
13:49:27 [Coverage] Obtaining indirect coverage changes...
13:49:27 [Coverage] Obtaining coverage delta for files...
13:49:27 [Coverage] Calculating coverage deltas...
13:49:27 [Coverage] Executing source code painting...
13:49:27 [Coverage] Painting 51 source files on agent
13:49:27 [Coverage] Searching for source code files in 'D:/jenkinslocaal/workspace/stMTarget_Update-Interface-Tests/src/main/java'
13:49:27 [Coverage] -> finished painting (1 files have been painted, 50 files failed)
13:49:27 [Coverage] -> zipping sources from folder 'd:\jenkinslocaal\workspace\stMTarget_Update-Interface-Tests\coverage' as 'd:\jenkinslocaal\workspace\stMTarget_Update-Interface-Tests\coverage-sources.zip'
13:49:27 [Coverage] Copying painted sources from agent to build folder
13:49:27 [Coverage] -> extracting...
13:49:27 [Coverage] -> done
13:49:27 [Coverage] Deleting source code files of build #11
13:49:27 [Coverage] Finished coverage processing - adding the action to the build...
13:49:27 [Checks API] No suitable checks publisher found.
Anything else?
How do I approve a source directory?
Did you set the directory? See https://github.com/jenkinsci/prism-api-plugin#readme
hello Ullrich,
thanks for the swift response. Now I found the entry to add source directories, I was in fact looking for an entry with ' coverage'.
However now I experience an error for arguments.
My call to the publishcoverage step is (generated using the pipeline snippet generator):
publishCoverage adapters: [cobertura(path: 'matlabTestArtifacts/cobertura.xml', thresholds: [[thresholdTarget: 'Aggregated Report']])], sourceDirectories: [[path: 'Z:\\Programming\\Libraries\\Simulink\\Lib\\v3.50'], [path: 'Z:\\Programming\\Libraries\\Simulink\\Lib\\v3.50\\Tools'], [path: 'Z:\\Programming\\Libraries\\Simulink\\Lib\\v3.50\\Interfaces']], sourceFileResolver: sourceFiles('STORE_LAST_BUILD')
In the console output it is mentioned that
08:12:38 WARNING: Unknown parameter(s) found for class type 'hudson.plugins.cobertura.CoberturaPublisher': path,thresholds
08:12:38 [Cobertura] Publishing Cobertura coverage report...
08:12:38
08:12:38 FATAL: Unable to find coverage results
Do you see something wrong with the call to publishCoverage as the error on path,thresholds is suggesting?
hello again,
I found that pipeline snippet generator in fact creates the correct call:
publishCoverage adapters: [coberturaAdapter('matlabTestArtifacts/cobertura.xml')], sourceDirectories: [[path: 'Z:\\Programming\\Libraries\\Simulink\\Lib\\v3.50'], [path: 'Z:\\Programming\\Libraries\\Simulink\\Lib\\v3.50\\Tools'], [path: 'Z:\\Programming\\Libraries\\Simulink\\Lib\\v3.50\\Interfaces']], sourceFileResolver: sourceFiles('STORE_LAST_BUILD')
Something that wonders me about the snippet generator is cobertura appearing twice as adapter:
So please forget about my previous comment. Sorry for any disturbance.
Kudos for your publishCoverage plugin, I am impressed by the output! Keep up the good work.
--Han
I think the reason is that the cobertura plugin contains the same publisher as well. It makes sense that we remove it from the Cobertura plugin. (Actually the cobertura plugin should be not required anymore.)
Good to see that everything is working now. I changed the issue title, I think the documentation still can be improved.