Giter Club home page Giter Club logo

code-coverage-api-plugin's Introduction

This plugin reached end-of-life.

All functionality has been integrated into the Coverage Plugin. Please use that plugin instead. It is available in the Jenkins update center.

If you are still using the old and deprecated step publishCoverage then you still can use this plugin. But please migrate to the new step recordCoverage as soon as possible.

code-coverage-api-plugin's People

Contributors

aelfric-m avatar afkbrb avatar amanjain4269 avatar bgreen1005 avatar bleibdirtroy avatar bncbhm avatar cizezsy avatar daniel-beck avatar dependabot[bot] avatar fedepell avatar fo-code avatar gounthar avatar jacob-steele avatar jenkinsci-cert-ci avatar jwalteri avatar medianick avatar notmyfault avatar oleg-nenashev avatar phil9909 avatar recampbell avatar reshadatavid avatar simonsymhoven avatar stefanspieker avatar tanderer avatar tempora-mutantur avatar thatsich avatar timja avatar tinyzzh avatar uhafner avatar xiongkezhi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

code-coverage-api-plugin's Issues

[Question] Access merged report within job execution

Hello folks,

Does the merged report using publishCoverage adapters: [jacocoAdapter(mergeToOneReport: true, path: '**/*.xml')] get stored somewhere where it can be accessed within the execution of the job? If so, what is the default location? In addition, is the file stored as an XML or some other type?

Jenkins version requirements too high

It's very good to know such plugin providing an API. But the "Minimum Jenkins requirement" is v2.60.3.

Could you make this plugin to be a little widely supported? We have v2.46 in use, upgrading is nearly impossible. Is there really some methods or class needed in jenkins core v2.60.3?

Code coverage 0% in jenkins with Jacoco

I tried the new code coverage API with the following project: https://github.com/kevcodez/pubg-api-kotlin

My job configuration:

bildschirmfoto 2018-08-19 um 20 57 16

bildschirmfoto 2018-08-19 um 20 57 06

bildschirmfoto 2018-08-19 um 20 57 25

This is the jacocoTestReport.xml
https://gist.github.com/kevcodez/eec43fe9f26868b296d6b391859aa6c2

It also outputs

Build step 'Invoke Gradle script' changed build result to SUCCESS
Publishing Coverage report....
A total of 1 reports were found
Finished: SUCCESS

However, the coverage is 0% for anything. Am I missing something here?

bildschirmfoto 2018-08-19 um 21 34 42

Cannot found source file for... - cobertura

Hello

I don't have a coverage per file.

Log from build:

Source File Navigation is enabled - Current level: STORE_LAST_BUILD
34 source files need to be copied
Cannot found source file for jenkinsprojects\secret1\secret2\secret3\secret4\secret5\153\src\file.cpp

I'm using a pipeline with parallel builds on slaves with a custom workspace

Jenkinsfile:

steps {
ws("${env.JENKINS_PROJECTS}/${env.JOB_NAME}/${env.BRANCH_NAME}/${env.STAGE_NAME}/${env.BUILD_NUMBER}".replace('%2F', '_').replace(' ', '_')){
run unit tests + coverage
publishCoverage adapters: [coberturaAdapter('testcoverage32.xml')], sourceFileResolver: sourceFiles('STORE_LAST_BUILD')

Piece of xml coverage:

<coverage line-rate="0.91334598355471219" branch-rate="0" complexity="0" branches-covered="0" branches-valid="0" timestamp="0" lines-covered="1444" lines-valid="1581" version="0">
  <sources>
    <source>c:</source>
  </sources>
  <packages>
    <package name="C:\JenkinsProjects\Secret1\Secret2\Secret3\Secret4\Secret5\153\tests\x86\Debug\SecretTests.exe" line-rate="0.91334598355471219" branch-rate="0" complexity="0">
      <classes>
        <class name="file.cpp" filename="jenkinsprojects\secret1\secret2\secret3\secret4\secret5\153\src\file.cpp.h" line-rate="1" branch-rate="0" complexity="0">
          <methods/>

I tried:

  • add "c:" to filename
  • convert all "" to "/" and vice versa
  • remove "jenkinsprojects\secret1\secret2\secret3\secret4\secret5\153" from filename
    ...

The 'old' cobertura-plugin works without any problems on the same configuration.

NullPointerException while publish with mergeToOneReport

I've trying the new mergeToOneReport merge feature but getting 'java.lang.NullPointerException'.

config:

publishCoverage adapters: [istanbulCoberturaAdapter(mergeToOneReport: true, path: 'coverage/**/cobertura-coverage.xml')], sourceFileResolver: sourceFiles('STORE_LAST_BUILD'), tag : 'frontend'

log:

[2019-07-16T14:29:11.321Z] [Pipeline] publishCoverage
[2019-07-16T14:29:11.392Z] Publishing Coverage report....
[2019-07-16T14:29:12.138Z] A total of 1 reports were found
[2019-07-16T14:29:12.142Z] Source File Navigation is enabled - Current level: STORE_LAST_BUILD
[2019-07-16T14:29:12.143Z] 88 source files need to be copied
[2019-07-16T14:29:15.548Z] Error when executing always post condition:
[2019-07-16T14:29:15.549Z] java.lang.NullPointerException
[2019-07-16T14:29:15.549Z] 	at io.jenkins.plugins.coverage.CoverageProcessor.lambda$convertResultToAction$1(CoverageProcessor.java:139)
[2019-07-16T14:29:15.549Z] 	at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:174)
[2019-07-16T14:29:15.549Z] 	at java.util.TreeMap$ValueSpliterator.tryAdvance(TreeMap.java:2921)
[2019-07-16T14:29:15.549Z] 	at java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:126)
[2019-07-16T14:29:15.549Z] 	at java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:499)
[2019-07-16T14:29:15.549Z] 	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:486)
[2019-07-16T14:29:15.549Z] 	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472)
[2019-07-16T14:29:15.549Z] 	at java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:152)
[2019-07-16T14:29:15.549Z] 	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
[2019-07-16T14:29:15.549Z] 	at java.util.stream.ReferencePipeline.findAny(ReferencePipeline.java:469)
[2019-07-16T14:29:15.549Z] 	at io.jenkins.plugins.coverage.CoverageProcessor.convertResultToAction(CoverageProcessor.java:140)
[2019-07-16T14:29:15.549Z] 	at io.jenkins.plugins.coverage.CoverageProcessor.performCoverageReport(CoverageProcessor.java:112)
[2019-07-16T14:29:15.549Z] 	at io.jenkins.plugins.coverage.CoveragePublisher.perform(CoveragePublisher.java:91)
[2019-07-16T14:29:15.549Z] 	at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:80)
[2019-07-16T14:29:15.549Z] 	at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:67)
[2019-07-16T14:29:15.549Z] 	at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
[2019-07-16T14:29:15.549Z] 	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[2019-07-16T14:29:15.549Z] 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[2019-07-16T14:29:15.549Z] 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[2019-07-16T14:29:15.549Z] 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[2019-07-16T14:29:15.549Z] 	at java.lang.Thread.run(Thread.java:748)

Use report name of jacoco.xml report

When using the coverage plugin for a multi-module maven project with jacoco I get reports named: jacoco:jacoco and jacoco:jacoco1

These reports have well formed named in the jacoco.xml report that could be used for visualization:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>...<report name="Foo Bar">

Kind regards and I really enjoy this great plugin
Michael

Difference between adapters

What is the difference between the provided and additional plugin adapters? Is there any recommendation which to use?

  • coberturaAdaptervs. istanbulCoberturaAdapter
  • jacoco vs jacocoAdapter

Missing group tag for jacoco reports generated by gradle

Jacoco reports generated by gradle's JacocoReport task doesn't contain a group tag, they just go directly from report tag to package tags. Currently this plugin expects that there will be a group tag, which means it won't process the gradle jacoco report correctly. Is it possible to update the plugin to allow the group tag to be omitted to support gradle?

Currently the result just looks like this:
image

Support of coverage reports based on multiple files

The coverage report for the D Programming Language is based on multiple files. In your project root folder you will have a flat list of *.lst files. For each D module in your project you will have a LST file.

File source-lib.lst

       |int add(int a, int b)
       |{
      1|    return a + b;
       |}
       |
       |int substract(int a, int b)
       |{
0000000|    return a - b;
       |}
source/lib.d is 50% covered

File source-app.lst

       |import std.stdio;
       |import lib;
       |
       |version (unittest)
       |{
       |    int main(string[] args)
       |    {
       |        import dunit;
       |
      1|        return dunit_main(args);
       |    }
       |}
       |else
       |{
       |    void main()
       |    {
       |    }
       |}
       |
       |unittest
       |{
      1|    assert(5 == add(2, 3));
       |}
source/app.d is 100% covered

Does the code-coverage-api-plugin supports multiple files? I wonder because this method expects exactly 1 file:
https://github.com/jenkinsci/code-coverage-api-plugin/blob/dev/src/main/java/io/jenkins/plugins/coverage/adapter/CoverageReportAdapter.java#L58

nullPointerException in setOwner

Reproduction:
use relative path that points nowhere, e.g.

'abc/coverage.json'

Publishing step crashes with:
java.lang.NullPointerException
at java.util.TreeMap.getEntry(TreeMap.java:347)
at java.util.TreeMap.get(TreeMap.java:278)

System:
Ubuntu 16.04. using llvmAdapter (but path handling is in this repo I think).

Expected behavior:

  • Check if path exists
  • If not, give a notification of which (absolute) path was tried (right now it's not clear from the UI that the path has to be relative to the ${WORKSPACE} variable even if Jenkins is in another workspace).

Additional UX concerns:

  • Maybe could rename from path to pathRelativeToWorkspace (as absolute paths aren't handled properly either, see #92 ) or handle absolute paths as well as relative paths to the current directory in which Jenkins is operating (using the dir command).

Build fails when coverage thresholds are breached but failed module name is not printed

Thanks for resolving #110 . I tested the changes and it works great. Following line appears appears on the build overview page.

Report: 100%   Group: 100%   Package: 100%   File: 100%   Class: 100%   Method: 99%   Line: 94%   Conditional: 90%  
Build failed because following metrics did not meet stability target: [Conditional {unstableThreshold=95.0, unhealthyThreshold=95.0}].

However status page doesn't report the name of the module which failed the coverage target. But, I see that the name is printed in the exception as below:

Calculating coverage change for change request build is enabled, target branch develop
Code coverage enforcement failed: Conditional coverage in Report level 'istanbul: restService-cobertura-coverage.xml' is lower than 95.00 stable threshold
io.jenkins.plugins.coverage.exception.CoverageException: Build failed because following metrics did not meet stability target: [Conditional {unstableThreshold=95.0, unhealthyThreshold=95.0}].
	at io.jenkins.plugins.coverage.CoverageProcessor.processThresholds(CoverageProcessor.java:466)
	at io.jenkins.plugins.coverage.CoverageProcessor.performCoverageReport(CoverageProcessor.java:123)
	at io.jenkins.plugins.coverage.CoveragePublisher.perform(CoveragePublisher.java:94)
	at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:80)
	at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:67)
	at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)

Would it be possible to add the name of the module 'istanbul: restService-cobertura-coverage.xml' to the failure message on status page?

My configuration for this job was as follows:

  applyThresholdRecursively: false, 
  calculateDiffForChangeRequests: true, 
  failNoReports: true, 
  failUnhealthy: true, 
  failUnstable: true, 
  globalThresholds: [
    [thresholdTarget: 'Class', unhealthyThreshold: 100.0, unstableThreshold: 100.0],
    [thresholdTarget: 'File', unhealthyThreshold: 100.0, unstableThreshold: 100.0]
  ],
  sourceFileResolver: sourceFiles('STORE_LAST_BUILD')

Thanks a lot for fixing the previous issue.

Cannot see sources for jacoco in gradle multi project

Hi,
I'm trying to convert to this plugin from the old jacoco plugin.
I'm using a multibranch declarative pipeline job to build a gradle multi project build.
The definition is like this.

publishCoverage adapters: [jacocoAdapter('*/build/reports/jacoco/test/jacocoTestReport.xml')], sourceFileResolver: sourceFiles('STORE_LAST_BUILD')

This finds the test reports and names them jacocoTestReport, jacocoTestReport1 etc. in the gui.
It also says this in the log:

15:52:16  Publishing Coverage report....
15:52:17  A total of 7 reports were found
15:52:17  Source File Navigation is enabled - Current level: STORE_LAST_BUILD
15:52:17  377 source files need to be copied

But I can't find any way to dig into source file reports anywhere.
If I click into "https://jenkins/job/jobName/7/coverage/jacoco__jacocoTestReport/", I can find the detailed report but I cant find the file breakdown anywhere.

Is there anyway I can debug what's wrong?

JellyTagException when accessing coverage report

Seems quite similar to issue #52, but in using version 1.0.7 of the code-coverage-api plugin.

I've configured a Jenkins job to publish coverage created by JaCoCo. When attempting to access the coverage report, Jenkins shows the following exception...

Stack trace
org.apache.commons.jelly.JellyTagException: jar:file:/C:/Users/user/Documents/Jenkins1/plugins/code-coverage-api/WEB-INF/lib/code-coverage-api.jar!/io/jenkins/plugins/coverage/CoverageProjectAction/nodata.jelly:4:67: st:include No page found 'sidepanel.jelly' for class io.jenkins.plugins.coverage.CoverageProjectAction
at org.kohsuke.stapler.jelly.IncludeTag.doTag(IncludeTag.java:124)
at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:269)
at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
at org.kohsuke.stapler.jelly.CallTagLibScript$1.run(CallTagLibScript.java:99)
at org.apache.commons.jelly.tags.define.InvokeBodyTag.doTag(InvokeBodyTag.java:91)
at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:269)
at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99)
at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99)
at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
at org.apache.commons.jelly.tags.core.CoreTagLibrary$2.run(CoreTagLibrary.java:105)
at org.kohsuke.stapler.jelly.CallTagLibScript.run(CallTagLibScript.java:120)
at org.apache.commons.jelly.tags.core.CoreTagLibrary$2.run(CoreTagLibrary.java:105)
at org.kohsuke.stapler.jelly.JellyViewScript.run(JellyViewScript.java:95)
at org.kohsuke.stapler.jelly.DefaultScriptInvoker.invokeScript(DefaultScriptInvoker.java:63)
at org.kohsuke.stapler.jelly.DefaultScriptInvoker.invokeScript(DefaultScriptInvoker.java:53)
at org.kohsuke.stapler.jelly.JellyFacet$1.dispatch(JellyFacet.java:103)
at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:739)
at org.kohsuke.stapler.Stapler.invoke(Stapler.java:870)
at org.kohsuke.stapler.MetaClass$9.dispatch(MetaClass.java:458)
at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:739)
at org.kohsuke.stapler.Stapler.invoke(Stapler.java:870)
at org.kohsuke.stapler.MetaClass$4.doDispatch(MetaClass.java:282)
at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)
at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:739)
at org.kohsuke.stapler.Stapler.invoke(Stapler.java:870)
at org.kohsuke.stapler.Stapler.invoke(Stapler.java:668)
at org.kohsuke.stapler.Stapler.service(Stapler.java:238)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:865)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1655)
at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:154)
at jenkins.telemetry.impl.UserLanguages$AcceptLanguageFilter.doFilter(UserLanguages.java:128)
at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:151)
at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:157)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:105)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84)
at hudson.security.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:51)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
at jenkins.security.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:117)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
at jenkins.security.BasicHeaderProcessor.doFilter(BasicHeaderProcessor.java:93)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
at hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:67)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:90)
at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:171)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:49)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:82)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
at org.kohsuke.stapler.DiagnosticThreadNameFilter.doFilter(DiagnosticThreadNameFilter.java:30)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:533)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:146)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:524)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:257)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1595)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1340)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:203)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:473)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1564)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:201)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1242)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:144)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
at org.eclipse.jetty.server.Server.handle(Server.java:503)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:364)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:260)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:305)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:118)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:333)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:310)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:168)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:126)
at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:366)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:765)
at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:683)
at java.lang.Thread.run(Unknown Source)
Caused: javax.servlet.ServletException
at org.kohsuke.stapler.jelly.JellyFacet$1.dispatch(JellyFacet.java:111)
at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:739)
at org.kohsuke.stapler.Stapler.invoke(Stapler.java:870)
at org.kohsuke.stapler.MetaClass$9.dispatch(MetaClass.java:458)
at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:739)
at org.kohsuke.stapler.Stapler.invoke(Stapler.java:870)
at org.kohsuke.stapler.MetaClass$4.doDispatch(MetaClass.java:282)
at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)
at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:739)
at org.kohsuke.stapler.Stapler.invoke(Stapler.java:870)
at org.kohsuke.stapler.Stapler.invoke(Stapler.java:668)
at org.kohsuke.stapler.Stapler.service(Stapler.java:238)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:865)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1655)
at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:154)
at jenkins.telemetry.impl.UserLanguages$AcceptLanguageFilter.doFilter(UserLanguages.java:128)
at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:151)
at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:157)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:105)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84)
at hudson.security.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:51)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
at jenkins.security.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:117)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
at jenkins.security.BasicHeaderProcessor.doFilter(BasicHeaderProcessor.java:93)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
at hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:67)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:90)
at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:171)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:49)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:82)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
at org.kohsuke.stapler.DiagnosticThreadNameFilter.doFilter(DiagnosticThreadNameFilter.java:30)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:533)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:146)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:524)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:257)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1595)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1340)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:203)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:473)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1564)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:201)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1242)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:144)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
at org.eclipse.jetty.server.Server.handle(Server.java:503)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:364)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:260)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:305)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:118)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:333)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:310)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:168)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:126)
at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:366)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:765)
at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:683)
at java.lang.Thread.run(Unknown Source)
Page generated: 20-Feb-2019 10:55:18 GMTREST APIJenkins ver. 2.150.3

cannot retrieve data via REST API

Although I've been able to publish coverage stats via a jenkins pipeline, and the charts correctly provide details in the jenkins GUI, I'm unable to obtain data via the REST API.

$ curl --insecure https://MY.JENKINS/view/GITHUB%20Repos/job/data-classification-poc/view/change-requests/job/PR-4/162/coverage/jacoco__jacoco/trend/api/json
{"_class":"io.jenkins.plugins.coverage.targets.CoverageTrendTree","children":[{}],"name":"jacoco: jacoco","trends":[{},{},{},{},{}]}

$ curl --insecure https://MY.JENKINS/view/GITHUB%20Repos/job/data-classification-poc/view/change-requests/job/PR-4/162/coverage/jacoco__jacoco/result/api/json
{"_class":"io.jenkins.plugins.coverage.targets.CoverageResult","results":{}}

I've also tried this with deeper URLs obtained by drilling down with the UI, but again with no success.

This was using 1.0.6 version of the plugin with Jenkins 2.150.2

Problem with long file name

Hi

See screenshot
long_file_name

There is no option to scroll the file names or any pop up with full file name.
It is hard to read a file name.

Feature request: View column for coverage

With the old Cobertura plugin, I could add a column to a view to show the coverage next to each project (and select which coverage measure to list). It would be nice to be able to do the same with this plugin.

Cobertura not working in Pipeline

I'm unable to get the cobertura adapter to work in my multibranch pipeline using the publishCoverage command. It doesn't even show up as an option in code snippets.

Cobertura report problem with filename clash

If 2 packages have files with the same filename, the report is broken. All classes with same filename of package test2 are in package test1 after the transformation!

Example Input

<?xml version="1.0"?>
<!DOCTYPE coverage SYSTEM "http://cobertura.sourceforge.net/xml/coverage-04.dtd">

<coverage line-rate="0.308048871212338" branch-rate="0.27936393205637877" lines-covered="10766" lines-valid="34949" branches-covered="4638" branches-valid="16602" complexity="0.0" version="2.1.1" timestamp="1556499335156">
	<sources>
	</sources>
	<packages>
		<package name="test1" line-rate="0.0" branch-rate="0.0" complexity="0.0">
			<classes>
				<class name="test1.test1" filename="test.java" line-rate="0.0" branch-rate="0.0" complexity="0.0">
					<methods>
						<method name="main" signature="([Ljava/lang/String;)V" line-rate="0.0" branch-rate="0.0" complexity="0">
							<lines>
								<line number="57" hits="0" branch="false"/>
								<line number="70" hits="0" branch="false"/>
								<line number="74" hits="0" branch="false"/>
								<line number="76" hits="0" branch="false"/>
							</lines>
						</method>
					</methods>
				</class>
			</classes>
		</package>
		<package name="test2" line-rate="0.0" branch-rate="0.0" complexity="0.0">
			<classes>
				<class name="test2.test2" filename="test.java" line-rate="0.0" branch-rate="0.0" complexity="0.0">
					<methods>
						<method name="log" signature="(Ljava/lang/String;)V" line-rate="0.0" branch-rate="1.0" complexity="0">
							<lines>
								<line number="97" hits="0" branch="false"/>
								<line number="98" hits="0" branch="false"/>
								<line number="100" hits="0" branch="false"/>
							</lines>
						</method>
					</methods>
				</class>
			</classes>
		</package>
	</packages>
</coverage>

Output after cobertura-to-standard.xsl transformation:

<?xml version="1.0"?>
<report name="cobertura">
  <group>
    <package name="test1">
      <file name="test.java">
        <class name="test1.test1">
          <method name="main" signature="([Ljava/lang/String;)V">
            <line number="57" hits="0" branch="false"/>
            <line number="70" hits="0" branch="false"/>
            <line number="74" hits="0" branch="false"/>
            <line number="76" hits="0" branch="false"/>
          </method>
        </class>
        <class name="test2.test2">
          <method name="log" signature="(Ljava/lang/String;)V">
            <line number="97" hits="0" branch="false"/>
            <line number="98" hits="0" branch="false"/>
            <line number="100" hits="0" branch="false"/>
          </method>
        </class>
      </file>
    </package>
    <package name="test2"/>
  </group>
</report>

coverage files are not read from the workspace directory on agents

For my stage I use a defined node

agent {
node {
label 'XXX'
}
}

The files from code coverage are created below the workspace directory for the jenkins node (WORKSPACE environment variable), which is remote and has different access rights.

The plugin seems to read only the build directory under the jobs directory on the jenkins master.

Questions

First off, I'm very thankful that the issue of coverage diff metrics gets finally tackled for Jenkins, thanks a bunch for stepping up!
When I read the announcement over on jenkins.io a few questions popped up in my mind:

  1. The plugin only seems to cover lines as smallest "thing", but not instructions, like tools e.g. JaCoCo support. Especially in complex business logic it is very much needed to see if not only one branch of an if statement is executed, but both. Is there a reason why this is left out?
  2. In multi-module Java / Kotlin projects there is usually more than a single JaCoCo coverage file falling out at the end. Is this supported by this plugin or is the user of the plugin forced to merge (with JaCoCo's Gradle / Maven / Ant tooling) single .ec coverage files before, create an XML report out of that and then feed it into the plugin?
  3. We came up with our own violations check machinery for PRs where we basically define a threshold (minimum coverage) for each module +/- 2% coverage, so a developer needs to adapt this configured threshold when he raises it (so a new "better" baseline is applied). On the other side, if the value is lowered by the developer, it can be seen in the PR and then argued about. I understand that the configuration you can do with the plugin currently basically is used for a lower-boundary check, would an upper-boundary check be possible as well in this regard?
  4. Finally, what I miss the most about my current machinery is the inability to drill into specific coverage changes. I'd like to see in which modules / packages / classes I lost coverage (because of added code or removed / rewritten tests). External tools like codecov.io have the ability to present this nicely - is support for such a feature planned as well?

Thanks in advance!

Multibranch support

Hi,

We're using the Multibranch pipeline type in our Jenkins setup for our Node.js-based projects.
In these projects we use the mocha-jenkins plugin which generates the lcov report.

So, we have the lcov data, but in multibranch pipeline there is no UI option as mentioned in step 6:

6. (Optional) Specify Source code storing level to enable source code navigation.

How would I set the threshold for failing builds if not met
Is it possible to set these options in the pipeline code instead?

Also, for Node.js-based projects what would I need to place here instead of jacoco?

publishCoverage adapters: [jacocoAdapter('target/site/jacoco/jacoco.xml')]

REST API endpoints

Hello there!

I'm one of the maintainers of the Shields project. We provide badges for a wide variety of services and one of our users has requested a new coverage badge based on the Code Coverage API plugin (see badges/shields#3761 and badges/shields#3785). We currently only support Jenkins coverage badges for the Cobertura and JaCoCo plugins through their own specialised APIs.

I'm trying to figure out whether I can easily retrieve the coverage of a job given a Jenkins host and a job name. The Readme indicates the following API endpoint:
…​/{buildNumber}/coverage/…​/result/api/\{json|xml\}

What is the second ... placeholder? I haven't found any documentation about it, and after quite a bit of digging through various GitHub issues, its value seems dependent on the plugin that integrates with the coverage API:

  • jacoco__jacoco
  • istanbul__coverage_xml
  • cobertura_xml
  • ...

However, omitting it also seems possible. For instance, the following endpoint just works:
https://jenkins.library.illinois.edu/job/OpenSourceProjects/job/Speedwagon/job/master/1120/coverage/result/api/json?depth=1

Could you please shed some light on these API endpoints?

Thanks in advance!

Pyves

How to make Jenkins stage fail and turn red when coverage is too low?

I am using C#, coverlet.msbuild and the Jenkins Cobertura adapter.
I have roughly this in my Jenkinsfile:

    stage ('Run unit tests') {
        steps {
            powershell "dotnet test -c:Release /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura --no-build --no-restore --logger trx"
        }
        post {
            always {
                step([$class: 'MSTestPublisher'])
                publishCoverage failUnhealthy: true, 
                    globalThresholds: [[thresholdTarget: 'Package', unhealthyThreshold: 50.0]],
                    adapters: [coberturaAdapter(
                        mergeToOneReport: true, 
                        path: '**/*.cobertura.xml')]
            }
        }
    }

This makes my Jenkins build fail if coverage is below 50% at package level. So far so good.

But when a build fails due to this, it is user-hostile and hard to see why. The 'Run unit tests' stage is green in Blue Ocean.

Can I make this stage turn red when it fails the build, so it is easier to see what the error is?

I've tried to check the return value of publishCoverage, but apparently that just returns null, so that didn't help much.

Thanks in advance!

2018 · Google Summer of Code导师峰会

2018年10月12-14日, Jenkins 组织将参加在 Google 位于森尼维尔办公室举办的为期三天的 Google Summer of Code (以下简称 GSoC) 导师峰会。 GSoC 导师峰会每年会邀请所有参与 GSoC 计划的组织中的导师参与其中,为大家提供互相学习、交流互通的机会。此次是 Jenkins 导师们继2016年首次参与此峰会后的第二度参会。

今年,破例地有三位 Jenkins GSoC 导师获邀出席峰会。在通常情况下,大会会邀请两位导师,但当有人无法参会时, Google 会从候补名单中随机抽取补位导师。 Jenkins 组织今年很幸运地获得了额外的一个导师名额。此次参会的三位导师分别是 Oleg Nenashev,Jeff Pearce 和 Martin d'Anjou 。

值得一提的是,导师峰会并不是一个传统意义上只需要你坐着聆听演讲者内容的会议;恰恰相反的是,导师峰会是一场无条件、无限制的会议,受邀导师将邀请与会人员在会议时间内进行主题讨论,大家可以畅所欲言。

以下是简要会议内容提要

10月12日 星期五 会前会议

导师们召开了一次简短的会前会,总结并反思 Jenkins 在2018年 GSoC 计划中的参与和贡献,并提出2019年的一些计划。我们在2018年的 Jenkins 大会上遇见了 Lloyd ,并受 Lloyd Chang 的邀请参加了本次峰会。在此,我们对 Lloyd 的加入深表感谢。

2019年我们的一些想法是:

·将项目提案移至独立的 Google 文档
·为潜在导师和项目倡导者创建的可供提交的模板
·为 Jenkins GSoC 未来的项目管理创建“组织管理员指南”

其他大家达成一致的准备工作包括,核查2018年的反馈意见,创建一个可捕获行动项目的 Epic 为2019年作准备;我们也计划在 JEP -8中对在 GSoC 预算流程上取得的进展进行详细地说明。

峰会开始啦!

本次大会为与会者安排了欢迎晚宴,在晚宴后的时间内,安排了一些活动,通过实践解释了峰会将如何开展。 大会安排了一些主题:如何处理 CPT 丢失的插槽,如何激励导师以及开源硬件 ASIC / FPGA 相关话题。

令人激动的是,每一位与会者或听说过或正在使用 Jenkins ,也有很多人来和我们分享 Jenkins 的使用经验。

“我也注意到了这一点;这让我因参与 Jenkins 而感到自豪。” - - Jeff Pearce 2018 GSoC Jenkins 导师

10月13日 星期六

Google 在当天上午发布了几则新消息。第一则消息是 Google 正在考虑创建一个名为“ Google Season of Docs” 的程序(以下简称 GSoD ),这个程序可以将技术作者与开源组织配对,并帮助他们编写文档,例如:

·高影响力的教程
·方法指南
·贡献者指南
·文档重构
·纯文本文档

我们在 GSoC Mentor Summit Notes 中有关于此内容更多详细的信息。我们据此可以快速得出结论,如果该计划得以实现, Jenkins 必将参与其中。

另一则消息是由 GSoC 管理员发布的声明。该声明指出, GSoC 可能在2020年启用不同的形式。不过,目前还没有更多的信息可供参考。 GSoC 至今已运行了13年,2020年将迎来其第15个年头。

这些消息发布之后,还有一系列晨间快速讨论。在讨论中,不同的组织展示了学生们在项目中所取得的成就。这是让我们觉得有些点意外的时刻……

Oleg 报名参加了晚间快速讨论,这时他在观看这些会谈的同时随意地为他的晚间演示准备幻灯片。但是发生了一些不寻常的事情:许多讨论在预定的3分钟内提前结束,这使我们的议程突然被提前了。 Oleg 也在此时被请上了舞台。我根本不知道他的幻灯片是否准备就绪,而他刚刚靠在我旁边说他想谈谈我们今年全部的3个项目。我也不清楚他的幻灯片重新调整了多少,这看起来将是......有趣的。作为一名经验丰富的演讲者, Oleg 完成地非常出色。尽管我真不知道他是如何做到的,但他的幻灯片确实是准备好了。点击此处可以获得快速讨论环节Oleg的幻灯片: Jenkins Remoting over Apache Kafka 。

然后就到了是非正式会议环节。 我们会参与如下的一些议题:

·文档
·吸引和留住导师(发起人: Martin )
·组织和激励志愿者和导师
·使学生通过代码开发/新兵训练营参与开源项目
·在 GSoC 之后保留优秀学生
·开放事件管理系统
· GSoC 反馈

我们在主文件中有所有议题的记录,有些议题是从分离文档中捕获的,这些分离文档则是通过主文档或博客文章链接获得。会议中也涌现出很多好的想法,我们将在明年实施其中的一些。

针对如何留住学生的问题,有组织表示,关键是在项目任务结束后给予他们更连续的责任和任务。今年参与项目其中的一名学生主动要求承担更多责任,也想知道他的插件项目将如何在 Jenkins 项目中继续发展(与此同时,这也对另一个 GSoC 插件有帮助)。

晚上举行的是第二轮快速讨论。 Jeff Pearce 提出了代码覆盖 API 插件的话题用于讨论,早上的突发状况对他并没有什么影响。

快速讨论环节之后,我们被邀请去到自助餐厅和露台,一边闲逛,互相交换贴纸,一边与其他组织的导师们交流,自在地享受着傍晚的小吃和音乐,还有满满一桌子的巧克力!

10月14日 星期日

周日,大会继续。 今天有一个有趣的议题是“除了 GSoC , Google 还可以做些什么?”。当与会者提出“云积分”时, 他获得了热烈的掌声。 事实证明, GSoC 管理员已经为此耗费了大约3年时间 。 Google 可能是强大的,但有些事情仍然很难。

Oleg 提出了一个有趣的建议,那就是制定一个相对较小的、短期承诺的计划。这将不需要长达4个月的承诺,同时能够鼓励更细粒度的贡献。 GSoC 管理员们已经注意到了此项内容。

我们还参加了一些其他议题:

·开源硬件 ASIC / FPGA (发起人: Martin)
·社区指标
· Outreachy计划( Jenkins 正在参与此计划)
·失败的学生
·职业倦怠激励(导师和组织管理员)

会议也进入了尾声, Google 在的最后的时间里,诚挚地感谢了参与 GSoC 计划的全体导师和志愿者。

回程思索

现在,我还想补充一些个人观点。 峰会结束后,和其他许多人一样,我在 SFO 国际航站楼转机,随即返程。 这 使我遇到更多的导师,我们中的一些人仍然穿着大会的徽章和T恤。 更有趣的是,在那个航站楼有很多极客,我们在候机乘客中就可完成人员招募,他们很有可能明年将成为另一个组织的导师!

想要一名 GSoC 的学生在2019年参与您的项目工作吗?

我们已经开始准备 GSoC 2019。如果没有 Jenkins 社区的参与,我们就无法做到这一点。

我们一直在寻找:
· Jenkins 特殊兴趣小组的导师
·来自任何背景和任何出处的导师(不需要一定懂 Jenkins 开发)
·项目提案
·一名可以辅助导师参与项目工作的 GSoc 的学生和他们的建议

很多人担心指导学生会花很多时间,你有这种感觉并不奇怪,指导学生确实需要花费时间。我每周要花费5到8个小时来完成指导任务(一开始会更多,最到后面会少一点)。 为了使那些有全职工作和生活的导师能够更好地分配时间,我们定义了不同的导师角色:

第一个角色为项目冠军联合导师,这是提出一个想法但可能没有所需的 Jenkins 代码专业知识的导师,该导师与学生一起定义项目,并主要充当项目的“客户”。 该导师通常对编码有足够了解,可以根据代码的质量、风格和特征来评论拉取请求。

第二个角色是技术联合导师,这是了解 Jenkins 代码并且可以指导学生编写代码的导师,并提供 Jenkins 针对拉取请求的特定代码审查,但不参与学生编码之外的活动。

第三个角色是:主题专家。这些人不是严格意义上的导师,但项目期间会请他们提供3-4次建议和指导,有时还会遇到复杂的编程挑战。

如果您对该计划有疑问或感到好奇,请通过 GSoC Gitter SIG 与我们联系。

另外,需要强调的是,项目提案不仅限于“大项目”。 一个提案指的是一个旨在改善项目的相关 Jira 问题的集合,或者需要为您的项目完成的任务列表。 编写文档超出了 GSoC 的范围,但只要编写代码,自动生成文档就属于 GSoC 的范围。

我们期待与 Jenkins 社区一起亮相2019 GSoC !

Source files partially copied when transient agent is destroyed (i.e. Docker)

Thanks for the awesome plugin (efficient, snappy interface, etc.).

When using a transient docker agent, I see files in the build directory on the Jenkins master that are partially copied or empty, and have the trailing _copied at the end of the file name.

I am not positive, but I think this issue is related to not waiting for the ExecutorService in io/jenkins/plugins/coverage/source/DefaultSourceFileResolver.java:

   81         ExecutorService service = Executors.newFixedThreadPool(5);
   82
   83         paints.forEach((sourceFilePath, paint) -> {
   84             service.submit(() -> {                                              

I should also mention that I am using the publishCoverage pipeline step in a stage{ post{} }, not a pipeline{ post{} }, but I wouldn't think that should matter.

Might be related to fix for #77

Jacoco coverage report not showing when used with Jenkins Pipeline

Hi Guys
I am trying to generate coverage report with jenkins pipeline but after the build it is not showing, which is not the case with freestyle project where it is working properly.
the pipeline script is
"post {
always {
publishCoverage adapters: [jacocoAdapter('/target/site/jacoco/jacoco.xml')]
} }"
output in the log showing
"Publishing Coverage report...."
build is successful but report missing.
Build Command : mvn clean package sonar:sonar
Thanks

"Cannot found source code for..." (Cobertura, again)

This is very similar to #69 (which is now closed), but perhaps even simpler. I have a build job that has been using the cobertura plugin like so:

cobertura(	                
  coberturaReportFile: '**/cobertura.xml',
  lineCoverageTargets: '60, 0, 0')

I just switched to publishCoverage in order to try some of its features (such as the calculateDiffForChangeRequests settings, which Cobertura lacks), so am using it like this:

publishCoverage(
  adapters: [coberturaAdapter('**/cobertura.xml')],
  calculateDiffForChangeRequests: true,
  globalThresholds: [[thresholdTarget: 'Line', unhealthyThreshold: 60.0]],
  sourceFileResolver: sourceFiles('STORE_LAST_BUILD'))

However, my build log shows that it was unable to find the source code, e.g.:

00:01:03.789  A total of 1 reports were found
00:01:03.792  Source File Navigation is enabled - Current level: STORE_LAST_BUILD
00:01:03.792  8 source files need to be copied
00:01:03.889  Cannot found source file for C:\Jenkins\workspace\Redacted_PR-60\Foo.cs
...

In my case, the path it's citing is exactly the same as the location of the file in question on my Jenkins build agent, and matches the filename attribute in the Cobertura XML report.

For plugins, I have Cobertura 1.14 and Code Coverage API 1.0.12, both the latest as of today.

Why isn't the plugin finding my source code?

No reports were found

Reproduction:

  • Use llvmAdapter

  • use relative path from Jenkins workspace to report e.g.

    'path/to/coverage.json'

Publishing step outputs:
Publishing Coverage Reports...
No reports were found

System:
Ubuntu 16.04. using llvmAdapter (but the error messages comes from this repo) and clang 9.

Expected behavior:

  • Show coverage
  • If it can't find the report, be more verbose about what it didn't find. (Especially since a non-existent path leads to NPE (#93) an absolute path leads to ANT exception (#92), so not crashing to me means it found the report but can't handle it?).

In order to avoid confusion:
The coverage.json is there and looks valid. It was created using llvm-cov export as shown in the guide.

Question About Cobertura `mergeToOneReport`

Hi there,

We have a situation where multiple cobertura reports might end up overlapping slightly in the lines they cover. What I want to know is if mergeToOneReport only aggregates the coverage hits and produces a holistic view as if we ran tests in serial or if that's not the case.

Secondly, if I run into a case where I see WARNING: Unknown parameter(s) found for class type 'hudson.plugins.cobertura.adapter.CoberturaReportAdapter': mergeToOneReport does that mean my Cobertura plugin is out of date or my code-coverage plugin is out of date?

Layout issue

If the report file names are lengthy, there is a layout issue with the legend (covered / missed)

image

Also another issue: I have for a project ~70 lst files. I have assumed they would be aggregated automatically to 1 report but every lst file is shown as an individual report (see screenshot above).
Is this the intended behavior?

Access coverage results in Pipeline

Is there any way to access the coverage results from a Pipeline script? It would be cool if the plugin could provide some methods to do that.

Something like:

getCoverageResult("Line");
getCoverageResult("Conditional");

This would be useful to notify about current coverage (e.g. slack/email notifications). Also this would enable users to create a coverage status badge using the "Embeddable Build Status" Plugin.

What do you think?

Coverage thresholds getting applied at directory level and build doesn't fail gracefully.

I've specified istanbul coverage targets as follows for one of my modules and marked to fail unhealthhy and unstable builds.

      thresholds: [
        [thresholdTarget: 'Conditional', unhealthyThreshold: 85.0, unstableThreshold: 85.0],
        [thresholdTarget: 'Line', unhealthyThreshold: 92.0, unstableThreshold: 92.0],
        [thresholdTarget: 'Function', unhealthyThreshold: 97.0, unstableThreshold: 97.0]
      ]
    ),
...
...
  failNoReports: true,
  failUnhealthy: true,
  failUnstable: true,

Snapshot of current module coverage and per directory coverage is attached here.
Coverage Report screenshot

Expectation: If the coverage for this module falls below the specified threshold, the build should fail gracefully and the coverage report should be published with message indicating why the build failed. Expectation is similar to current cobertura plugin.

Observation: The publisher generates exception for failure encountered at directory level even when module level parameters are met. When a threshold is breached, it generates an exception instead of marking this build as failure and doesn't generate a report for the build.

Publishing Coverage report....
A total of 11 reports were found
Source File Navigation is enabled - Current level: STORE_LAST_BUILD
36 source files need to be copied
io.jenkins.plugins.coverage.exception.CoverageException: Publish Coverage Failed (Unhealthy): Conditional coverage in evtOps/elasticsearch is lower than 85.00
	at io.jenkins.plugins.coverage.CoverageProcessor.processThresholds(CoverageProcessor.java:425)
	at io.jenkins.plugins.coverage.CoverageProcessor.performCoverageReport(CoverageProcessor.java:107)
	at io.jenkins.plugins.coverage.CoveragePublisher.perform(CoveragePublisher.java:91)
	at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:80)
	at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:67)
	at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)

Missing example of coverage thresholds for pipeline syntax

I'm trying to add coverage thresholds through the pipeline syntax as described in https://jenkins.io/doc/pipeline/steps/code-coverage-api/.

My experience in Groovy is limited and I've tried the following:

publishCoverage(adapters: [istanbulCoberturaAdapter(path: 'coverage/part66/cobertura-coverage.xml')], globalThresholds: [threshold(thresholdTarget: '100')])

This results in java.lang.NoSuchMethodError: No such DSL method 'threshold' found among steps etc.

publishCoverage adapters: [istanbulCoberturaAdapter(path: 'coverage/part66/cobertura-coverage.xml')], globalThresholds: [thresholdTarget: '100', unstableThreshold: '100']

This results in java.lang.UnsupportedOperationException: must specify $class with an implementation of interface java.util.List.

publishCoverage(adapters: [istanbulCoberturaAdapter(path: 'coverage/part66/cobertura-coverage.xml')], globalThresholds: [$class: 'Threshold', thresholdTarget: '100'])

This results in java.lang.UnsupportedOperationException: no known implementation of interface java.util.List is named Threshold.

It would be very helpful if there was an example of the correct usage of the globalThresholds argument in the documentation concerning the pipeline syntax.

Any help will be appreciated and thank you for making this plugin :)

Copying source files is extremely slow

We have 240 source files that are copied by the setting sourceFileResolver: sourceFiles('STORE_LAST_BUILD'),

This increases build time by 3 minutes.
Is there any possibility to speed this up?

Pipeline support

You mention pipeline support, but I don't see any documentation regarding declarative pipelines or Nodejs-based projects...

Jacoco Plugin merges coverage from previous jenkins stage

I'm using Jenkins CI with two-stages- Unit Test and Integration Test.
stage('Test') {
mavenBuild([maven_goals: 'clean install javadoc:javadoc'])
jacoco changeBuildStatus: true, minimumInstructionCoverage: '70'
}
stage('IntegrationTest') {
mavenBuild([maven_goals: "clean -PIntegrationTestOnly test"])
jacoco changeBuildStatus: true, minimumInstructionCoverage: '60',inclusionPattern:
inclusionPatterns
}

Even though I'm running clean during Integration Test and as per logs I can see only 1 .exec file (jacoco report-Integrated ) is being processed, the overall coverage data is not correct, these data are same as when I combine .exec result from unit test and integration test.

Is jacoco plugin coverage generated in the second stage is incremental?

Logs -

[JaCoCo plugin] Collecting JaCoCo coverage data...
12:02:23 [JaCoCo plugin] /.exec;/classes;/src/main/java; locations are configured
12:02:23 [JaCoCo plugin] Number of found exec files for pattern /.exec: 4
12:02:23 [JaCoCo plugin] Saving matched execfiles: /home/jenkins/workspace/-test-client-build_qualitygating/testclient-common/target/jacoco.exec /home/jenkins/workspace/-test-client-build_qualitygating/testclient-libs/target/jacoco.exec /home/jenkins/workspace/-test-client-build_qualitygating/testclient-selenium/target/jacoco.exec /home/jenkins/workspace/-test-client-build_qualitygating/testclient-utils/target/jacoco.exec
12:02:23 [JaCoCo plugin] Saving matched class directories for class-pattern: **/classes:
12:02:23 [JaCoCo plugin] - /home/jenkins/workspace/-test-client-build_qualitygating/testclient-common/target/classes 60 files
12:02:24 [JaCoCo plugin] - /home/jenkins/workspace/-test-client-build_qualitygating/testclient-integrationtest/target/classes 7 files
12:02:24 [JaCoCo plugin] - /home/jenkins/workspace/-test-client-build_qualitygating/testclient-libs/target/classes 118 files
12:02:24 [JaCoCo plugin] - /home/jenkins/workspace/-test-client-build_qualitygating/testclient-selenium-utils/target/classes 49 files
12:02:24 [JaCoCo plugin] - /home/jenkins/workspace/-test-client-build_qualitygating/testclient-selenium/target/classes 21 files
12:02:24 [JaCoCo plugin] - /home/jenkins/workspace/-test-client-build_qualitygating/testclient-utils/target/classes 7 files
12:02:24 [JaCoCo plugin] Saving matched source directories for source-pattern: **/src/main/java:
12:02:24 [JaCoCo plugin] Source Inclusions: **/*.java
12:02:24 [JaCoCo plugin] Source Exclusions:
12:02:24 [JaCoCo plugin] - /home/jenkins/workspace/-test-client-build_qualitygating/testclient-common/src/main/java 39 files
12:02:24 [JaCoCo plugin] - /home/jenkins/workspace/-test-client-build_qualitygating/testclient-integrationtest/src/main/java 4 files
12:02:24 [JaCoCo plugin] - /home/jenkins/workspace/-test-client-build_qualitygating/testclient-libs/src/main/java 97 files
12:02:24 [JaCoCo plugin] - /home/jenkins/workspace/-test-client-build_qualitygating/testclient-selenium-utils/src/main/java 16 files
12:02:24 [JaCoCo plugin] - /home/jenkins/workspace/-test-client-build_qualitygating/testclient-selenium/src/main/java 15 files
12:02:24 [JaCoCo plugin] - /home/jenkins/workspace/-test-client-build_qualitygating/testclient-utils/src/main/java 6 files
12:02:24 [JaCoCo plugin] Loading inclusions files..
12:02:24 [JaCoCo plugin] inclusions: []
12:02:24 [JaCoCo plugin] exclusions: []
12:02:24 [JaCoCo plugin] Thresholds: JacocoHealthReportThresholds [minClass=0, maxClass=0, minMethod=0, maxMethod=0, minLine=0, maxLine=0, minBranch=0, maxBranch=0, minInstruction=0, maxInstruction=0, minComplexity=0, maxComplexity=0]
12:02:24 [JaCoCo plugin] Publishing the results..
12:02:24 [JaCoCo plugin] Loading packages..
12:02:24 [JaCoCo plugin] Done.
12:02:24 [JaCoCo plugin] Overall coverage: class: 66, method: 49, line: 46, branch: 29, instruction: 44
12:02:24 [JaCoCo plugin] Health thresholds: JacocoHealthReportThresholds [minClass=0, maxClass=0, minMethod=0, maxMethod=0, minLine=0, maxLine=0, minBranch=0, maxBranch=0, minInstruction=0, maxInstruction=0, minComplexity=0, maxComplexity=0]
12:02:24 [JaCoCo plugin] Apply Min/Max thresholds result: SUCCESS

[JaCoCo plugin] Collecting JaCoCo coverage data...
18:19:11 [JaCoCo plugin] /.exec;/classes;/src/main/java; locations are configured
18:19:11 [JaCoCo plugin] Number of found exec files for pattern /.exec: 1
18:19:11 [JaCoCo plugin] Saving matched execfiles: /home/jenkins/workspace/-test-client-build_qualitygating/testclient-integrationtest/target/jacoco-it.exec
18:19:11 [JaCoCo plugin] Saving matched class directories for class-pattern: **/classes:
18:19:11 [JaCoCo plugin] - /home/jenkins/workspace/-test-client-build_qualitygating/testclient-common/target/classes 60 files
18:19:11 [JaCoCo plugin] - /home/jenkins/workspace/-test-client-build_qualitygating/testclient-integrationtest/target/classes 7 files
18:19:11 [JaCoCo plugin] - /home/jenkins/workspace/-test-client-build_qualitygating/testclient-libs/target/classes 118 files
18:19:11 [JaCoCo plugin] - /home/jenkins/workspace/-test-client-build_qualitygating/testclient-selenium-utils/target/classes 49 files
18:19:11 [JaCoCo plugin] - /home/jenkins/workspace/-test-client-build_qualitygating/testclient-selenium/target/classes 21 files
18:19:11 [JaCoCo plugin] - /home/jenkins/workspace/-test-client-build_qualitygating/testclient-utils/target/classes 7 files
18:19:11 [JaCoCo plugin] Saving matched source directories for source-pattern: **/src/main/java:
18:19:11 [JaCoCo plugin] Source Inclusions: **/*.java
18:19:12 [JaCoCo plugin] Source Exclusions:
18:19:12 [JaCoCo plugin] - /home/jenkins/workspace/-test-client-build_qualitygating/testclient-common/src/main/java 39 files
18:19:12 [JaCoCo plugin] - /home/jenkins/workspace/-test-client-build_qualitygating/testclient-integrationtest/src/main/java 4 files
18:19:12 [JaCoCo plugin] - /home/jenkins/workspace/-test-client-build_qualitygating/testclient-libs/src/main/java 97 files
18:19:12 [JaCoCo plugin] - /home/jenkins/workspace/-test-client-build_qualitygating/testclient-selenium-utils/src/main/java 16 files
18:19:12 [JaCoCo plugin] - /home/jenkins/workspace/-test-client-build_qualitygating/testclient-selenium/src/main/java 15 files
18:19:12 [JaCoCo plugin] - /home/jenkins/workspace/-test-client-build_qualitygating/testclient-utils/src/main/java 6 files
18:19:12 [JaCoCo plugin] Loading inclusions files..
18:19:12 [JaCoCo plugin] inclusions: [com/salesforce/atf/testclient/extensions/org/license/OrgLicenseUtil.class, com/salesforce/atf/testclient/extensions/org/license/OrgLicenseHelper.class]
18:19:12 [JaCoCo plugin] exclusions: []
18:19:12 [JaCoCo plugin] Thresholds: JacocoHealthReportThresholds [minClass=0, maxClass=0, minMethod=0, maxMethod=0, minLine=0, maxLine=0, minBranch=0, maxBranch=0, minInstruction=0, maxInstruction=0, minComplexity=0, maxComplexity=0]
18:19:12 [JaCoCo plugin] Publishing the results..
18:19:12 [JaCoCo plugin] Loading packages..
18:19:12 [JaCoCo plugin] Done.
18:19:12 [JaCoCo plugin] Overall coverage: class: 100, method: 85, line: 87, branch: 100, instruction: 86
18:19:12 [JaCoCo plugin] Health thresholds: JacocoHealthReportThresholds [minClass=0, maxClass=0, minMethod=0, maxMethod=0, minLine=0, maxLine=0, minBranch=0, maxBranch=0, minInstruction=0, maxInstruction=0, minComplexity=0, maxComplexity=0]
18:19:12 [JaCoCo plugin] Apply Min/Max thresholds result: SUCCESS

JellyTagException when accessing coverage report

In a Jenkins Maven build job, I have configured the Code Coverage API to process the JaCoCo results. However, on the project page, no code coverade chart is displayed, and when clicking the "Coverage Report" link, I get the following stack trace

org.apache.commons.jelly.JellyTagException: jar:file:/D:/Test/Jenkins2/plugins/code-coverage-api/WEB-INF/lib/code-coverage-api.jar!/io/jenkins/plugins/coverage/CoverageProjectAction/nodata.jelly:4:64: <st:include> No page found 'sidepanel.jelly' for class io.jenkins.plugins.coverage.CoverageProjectAction at org.kohsuke.stapler.jelly.IncludeTag.doTag(IncludeTag.java:124) at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:269) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95) at org.kohsuke.stapler.jelly.CallTagLibScript$1.run(CallTagLibScript.java:99) at org.apache.commons.jelly.tags.define.InvokeBodyTag.doTag(InvokeBodyTag.java:91) at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:269) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95) at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95) at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95) at org.apache.commons.jelly.tags.core.CoreTagLibrary$2.run(CoreTagLibrary.java:105) at org.kohsuke.stapler.jelly.CallTagLibScript.run(CallTagLibScript.java:120) at org.apache.commons.jelly.tags.core.CoreTagLibrary$2.run(CoreTagLibrary.java:105) at org.kohsuke.stapler.jelly.JellyViewScript.run(JellyViewScript.java:95) at org.kohsuke.stapler.jelly.DefaultScriptInvoker.invokeScript(DefaultScriptInvoker.java:63) at org.kohsuke.stapler.jelly.DefaultScriptInvoker.invokeScript(DefaultScriptInvoker.java:53) at org.kohsuke.stapler.jelly.JellyFacet$1.dispatch(JellyFacet.java:97) at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:734) at org.kohsuke.stapler.Stapler.invoke(Stapler.java:864) at org.kohsuke.stapler.MetaClass$10.dispatch(MetaClass.java:374) at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:734) at org.kohsuke.stapler.Stapler.invoke(Stapler.java:864) at org.kohsuke.stapler.MetaClass$5.doDispatch(MetaClass.java:248) at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58) at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:734) at org.kohsuke.stapler.Stapler.invoke(Stapler.java:864) at org.kohsuke.stapler.MetaClass$5.doDispatch(MetaClass.java:248) at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58) at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:734) at org.kohsuke.stapler.Stapler.invoke(Stapler.java:864) at org.kohsuke.stapler.Stapler.invoke(Stapler.java:668) at org.kohsuke.stapler.Stapler.service(Stapler.java:238) at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:865) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1655) at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:154) at hudson.plugins.greenballs.GreenBallFilter.doFilter(GreenBallFilter.java:59) at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:151) at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:157) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642) at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:105) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84) at hudson.security.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:51) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at jenkins.security.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:117) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at jenkins.security.BasicHeaderProcessor.doFilter(BasicHeaderProcessor.java:93) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249) at hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:67) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:90) at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:171) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642) at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:49) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642) at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:82) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642) at org.kohsuke.stapler.DiagnosticThreadNameFilter.doFilter(DiagnosticThreadNameFilter.java:30) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642) at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:533) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:146) at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:524) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132) at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:257) at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1595) at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255) at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1317) at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:203) at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:473) at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1564) at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:201) at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1219) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:144) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132) at org.eclipse.jetty.server.Server.handle(Server.java:531) at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:352) at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:260) at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:281) at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:102) at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:118) at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:333) at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:310) at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:168) at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:126) at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:366) at winstone.BoundedExecutorService.lambda$scheduleNext$0(BoundedExecutorService.java:80) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused: javax.servlet.ServletException at org.kohsuke.stapler.jelly.JellyFacet$1.dispatch(JellyFacet.java:105) at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:734) at org.kohsuke.stapler.Stapler.invoke(Stapler.java:864) at org.kohsuke.stapler.MetaClass$10.dispatch(MetaClass.java:374) at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:734) at org.kohsuke.stapler.Stapler.invoke(Stapler.java:864) at org.kohsuke.stapler.MetaClass$5.doDispatch(MetaClass.java:248) at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58) at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:734) at org.kohsuke.stapler.Stapler.invoke(Stapler.java:864) at org.kohsuke.stapler.MetaClass$5.doDispatch(MetaClass.java:248) at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58) at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:734) at org.kohsuke.stapler.Stapler.invoke(Stapler.java:864) at org.kohsuke.stapler.Stapler.invoke(Stapler.java:668) at org.kohsuke.stapler.Stapler.service(Stapler.java:238) at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:865) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1655) at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:154) at hudson.plugins.greenballs.GreenBallFilter.doFilter(GreenBallFilter.java:59) at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:151) at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:157) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642) at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:105) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84) at hudson.security.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:51) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at jenkins.security.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:117) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at jenkins.security.BasicHeaderProcessor.doFilter(BasicHeaderProcessor.java:93) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249) at hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:67) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:90) at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:171) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642) at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:49) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642) at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:82) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642) at org.kohsuke.stapler.DiagnosticThreadNameFilter.doFilter(DiagnosticThreadNameFilter.java:30) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642) at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:533) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:146) at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:524) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132) at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:257) at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1595) at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255) at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1317) at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:203) at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:473) at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1564) at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:201) at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1219) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:144) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132) at org.eclipse.jetty.server.Server.handle(Server.java:531) at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:352) at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:260) at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:281) at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:102) at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:118) at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:333) at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:310) at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:168) at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:126) at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:366) at winstone.BoundedExecutorService.lambda$scheduleNext$0(BoundedExecutorService.java:80) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source)

Merging multiple reports

Hi,
I collect code coverage in different pipeline steps.
Once with unit tests and once with ui-tests.
For simplicity the resulting JaCoCo files are called coverage1.xml and coverage2.xml.

I was unable to merge the coverage results.
I tried things like:

publishCoverage adapters: [jacocoAdapter("coverage1.xml")], sourceFileResolver: sourceFiles('STORE_ALL_BUILD'), tag: 'foo' 
publishCoverage adapters: [jacocoAdapter("coverage2.xml")], sourceFileResolver: sourceFiles('STORE_ALL_BUILD'), tag: 'foo' 

and also

publishCoverage adapters: [jacocoAdapter("coverage*.xml")], sourceFileResolver: sourceFiles('STORE_ALL_BUILD')

Yet there are still two reports listed and the overall coverage is both results added divded by two.
Though what I really want is an overall coverage, i.e. all lines covered by either of the two.

Is there a way to do that?

REST API can return an image

Hi there.

Any chance to allow your REST API to also return the images you are displaying inside jenkins
.../coverage/istanbul__coverage_xml/trend/api/img
.../coverage/istanbul__coverage_xml/result/api/img

Cheers,
André

Ignore class files that do not contain code from JaCoCo reports

Hi,

Currently, Class files, mainly abstract class or interfaces (without default methods), that do not contain code are shown with a 0/1 coverage in Jenkins reports based on JaCoCo.
In fact, File and Class Category display a result of 0%, whereas Method, Instruction, Line, Conditional display a blank result which is fine:
coverage-interface

Is this something that can be fixed ?

Regards

Nicolas

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.