New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build fails on cobertura:check goal #4450

Closed
Nimfadora opened this Issue Jun 13, 2017 · 24 comments

Comments

Projects
None yet
4 participants
@Nimfadora
Contributor

Nimfadora commented Jun 13, 2017

master branch build fails on cobertura:check goal
issue is reproduced here

Apache Maven 3.3.9
Java version: 1.8.0_121, vendor: Oracle Corporation

cobertura coverage report is here

cobertura line rate specified in pom: <totalLineRate>99</totalLineRate>
cobertura line rate in report: 98

Seems that api package or grammars package is not covered as needed.

mvn clean verify produces such error:

[Thread-2] ERROR net.sourceforge.cobertura.coveragedata.TouchCollector - Cannot apply touches
java.lang.NoSuchMethodException: com.puppycrawl.tools.checkstyle.api.AbstractCheck.__cobertura_classmap(net.sourceforge.cobertura.coveragedata.LightClassmapListener)
        at java.lang.Class.getDeclaredMethod(Class.java:2130)
        at net.sourceforge.cobertura.coveragedata.TouchCollector.applyTouchesToSingleClassOnProjectData(TouchCollector.java:127)
        at net.sourceforge.cobertura.coveragedata.TouchCollector.applyTouchesOnProjectData(TouchCollector.java:110)
        at net.sourceforge.cobertura.coveragedata.ProjectData.saveGlobalProjectData(ProjectData.java:272)
        at net.sourceforge.cobertura.coveragedata.SaveTimer.run(SaveTimer.java:33)
        at java.lang.Thread.run(Thread.java:745)
[Thread-2] ERROR net.sourceforge.cobertura.coveragedata.TouchCollector - Cannot apply touches
java.lang.NoSuchMethodException: com.puppycrawl.tools.checkstyle.api.AutomaticBean.__cobertura_classmap(net.sourceforge.cobertura.coveragedata.LightClassmapListener)
        at java.lang.Class.getDeclaredMethod(Class.java:2130)
        at net.sourceforge.cobertura.coveragedata.TouchCollector.applyTouchesToSingleClassOnProjectData(TouchCollector.java:127)
        at net.sourceforge.cobertura.coveragedata.TouchCollector.applyTouchesOnProjectData(TouchCollector.java:110)
        at net.sourceforge.cobertura.coveragedata.ProjectData.saveGlobalProjectData(ProjectData.java:272)
        at net.sourceforge.cobertura.coveragedata.SaveTimer.run(SaveTimer.java:33)
        at java.lang.Thread.run(Thread.java:745)
[Thread-2] ERROR net.sourceforge.cobertura.coveragedata.TouchCollector - Cannot apply touches
java.lang.NoSuchMethodException: com.puppycrawl.tools.checkstyle.api.AbstractViolationReporter.__cobertura_classmap(net.sourceforge.cobertura.coveragedata.LightClassmapListener)
        at java.lang.Class.getDeclaredMethod(Class.java:2130)
        at net.sourceforge.cobertura.coveragedata.TouchCollector.applyTouchesToSingleClassOnProjectData(TouchCollector.java:127)
        at net.sourceforge.cobertura.coveragedata.TouchCollector.applyTouchesOnProjectData(TouchCollector.java:110)
        at net.sourceforge.cobertura.coveragedata.ProjectData.saveGlobalProjectData(ProjectData.java:272)
        at net.sourceforge.cobertura.coveragedata.SaveTimer.run(SaveTimer.java:33)
        at java.lang.Thread.run(Thread.java:745)

CI is failing with this error:

org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:cobertura-maven-plugin:2.7:check (default) on project checkstyle: Coverage check failed. See messages above.
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
	at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:355)
	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:216)
	at org.apache.maven.cli.MavenCli.main(MavenCli.java:160)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoFailureException: Coverage check failed. See messages above.
	at org.codehaus.mojo.cobertura.tasks.CheckTask.execute(CheckTask.java:110)
	at org.codehaus.mojo.cobertura.CoberturaCheckMojo.execute(CoberturaCheckMojo.java:81)
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
	... 19 more
@rnveach

This comment has been minimized.

Show comment
Hide comment
@rnveach

rnveach Jun 13, 2017

Member

@Nimfadora Put all information here in first post, including errors you were getting during build.

I am unable to reproduce locally.
What is your Java and Maven version?
Can you determine what specific test(s) cause this issue?

Seems that api package or grammars package is not covered as needed.

grammar isn't 100% covered as it is dynamically generated code not built by us.
API should be covered by code coverage.

Member

rnveach commented Jun 13, 2017

@Nimfadora Put all information here in first post, including errors you were getting during build.

I am unable to reproduce locally.
What is your Java and Maven version?
Can you determine what specific test(s) cause this issue?

Seems that api package or grammars package is not covered as needed.

grammar isn't 100% covered as it is dynamically generated code not built by us.
API should be covered by code coverage.

@Nimfadora

This comment has been minimized.

Show comment
Hide comment
@Nimfadora

Nimfadora Jun 13, 2017

Contributor

@rnveach I added information you asked to add.
I see in my cobertura report that 3 classes in api are not covered by 100%
com.puppycrawl.tools.checkstyle.api.AutomaticBean
com.puppycrawl.tools.checkstyle.api.AbstractCheck
com.puppycrawl.tools.checkstyle.api.AbstractViolationReporter

I have updated java to 1.8.0_131 but it doesn't resolve the issue.

Here is an example of cobertura: https://nimfadora.github.io/cobertura.html

Contributor

Nimfadora commented Jun 13, 2017

@rnveach I added information you asked to add.
I see in my cobertura report that 3 classes in api are not covered by 100%
com.puppycrawl.tools.checkstyle.api.AutomaticBean
com.puppycrawl.tools.checkstyle.api.AbstractCheck
com.puppycrawl.tools.checkstyle.api.AbstractViolationReporter

I have updated java to 1.8.0_131 but it doesn't resolve the issue.

Here is an example of cobertura: https://nimfadora.github.io/cobertura.html

@MEZk

This comment has been minimized.

Show comment
Hide comment
@MEZk

MEZk Jun 13, 2017

Contributor

@rnveach @romani
I have the same issue running cobertura on the latest master branch.
Reported branches coverage rate is 92%
Reported lines coverage rate is 98%

mvn --version
Apache Maven 3.5.0 (ff8f5e7444045639af65f6095c62210b5713f426; 2017-04-03T22:39:06+03:00)
Maven home: /usr/lib/maven/apache-maven-3.5.0
Java version: 1.8.0_131, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-8-openjdk-amd64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.4.0-78-generic", arch: "amd64", family: "unix"
Contributor

MEZk commented Jun 13, 2017

@rnveach @romani
I have the same issue running cobertura on the latest master branch.
Reported branches coverage rate is 92%
Reported lines coverage rate is 98%

mvn --version
Apache Maven 3.5.0 (ff8f5e7444045639af65f6095c62210b5713f426; 2017-04-03T22:39:06+03:00)
Maven home: /usr/lib/maven/apache-maven-3.5.0
Java version: 1.8.0_131, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-8-openjdk-amd64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.4.0-78-generic", arch: "amd64", family: "unix"
@Nimfadora

This comment has been minimized.

Show comment
Hide comment
@Nimfadora

Nimfadora Jun 13, 2017

Contributor

@rnveach, @romani btw, when I downgraded cobertura lines coverage to 98% in pom it haven't solved the issue. Build was still failing.

Contributor

Nimfadora commented Jun 13, 2017

@rnveach, @romani btw, when I downgraded cobertura lines coverage to 98% in pom it haven't solved the issue. Build was still failing.

@MEZk

This comment has been minimized.

Show comment
Hide comment
@MEZk

MEZk Jun 13, 2017

Contributor

Investigation:

Iteration 1
11428e2 - OK
11428e2 - OK
6e84fdf - OK
bbf682c - FAIL

Iteration 2
Problem was introduced between two revisions:
Start - 6e84fdf
Finish - bbf682c

59b7c69 - OK
Commit which introduced the problem - 27e1e94

@Nimfadora
Please, generate coverage reports before and after problematic commit to prove my investigation.
Hint: the problem is somewhere with

@RunWith(PowerMockRunner.class)
@PrepareForTest(TreeWalker.class)

Mocking of final classes is a very bad hack!

Contributor

MEZk commented Jun 13, 2017

Investigation:

Iteration 1
11428e2 - OK
11428e2 - OK
6e84fdf - OK
bbf682c - FAIL

Iteration 2
Problem was introduced between two revisions:
Start - 6e84fdf
Finish - bbf682c

59b7c69 - OK
Commit which introduced the problem - 27e1e94

@Nimfadora
Please, generate coverage reports before and after problematic commit to prove my investigation.
Hint: the problem is somewhere with

@RunWith(PowerMockRunner.class)
@PrepareForTest(TreeWalker.class)

Mocking of final classes is a very bad hack!

@Nimfadora

This comment has been minimized.

Show comment
Hide comment
@Nimfadora

Nimfadora Jun 13, 2017

Contributor

commit 59b7c69
mvn clean verify - build success
cobertura report : 99% lines 92% branches

commit 27e1e94
mvn clean verify - build fails ( known issue #4445 )
cobertura report : 99% lines 92% branches

So it is not the case. I continue investigating.

Contributor

Nimfadora commented Jun 13, 2017

commit 59b7c69
mvn clean verify - build success
cobertura report : 99% lines 92% branches

commit 27e1e94
mvn clean verify - build fails ( known issue #4445 )
cobertura report : 99% lines 92% branches

So it is not the case. I continue investigating.

@MEZk

This comment has been minimized.

Show comment
Hide comment
@MEZk

MEZk Jun 13, 2017

Contributor

commit 59b7c69
mvn clean verify - build success

and

mvn clean verify - build fails ( known issue #4445 )

mean that applying of 27e1e94 breaks cobertura-mavne-plugin execution.

Check stdout. You will see no error messages before 27e1e94.

Contributor

MEZk commented Jun 13, 2017

commit 59b7c69
mvn clean verify - build success

and

mvn clean verify - build fails ( known issue #4445 )

mean that applying of 27e1e94 breaks cobertura-mavne-plugin execution.

Check stdout. You will see no error messages before 27e1e94.

@Nimfadora

This comment has been minimized.

Show comment
Hide comment
@Nimfadora

Nimfadora Jun 14, 2017

Contributor

Interesting fact, I tried on another computer
Apache Maven 3.2.1
Java version: 1.8.0_121, vendor: Oracle Corporation
And clean verify now passes correctly.

Contributor

Nimfadora commented Jun 14, 2017

Interesting fact, I tried on another computer
Apache Maven 3.2.1
Java version: 1.8.0_121, vendor: Oracle Corporation
And clean verify now passes correctly.

@rnveach

This comment has been minimized.

Show comment
Hide comment
@rnveach

rnveach Jun 14, 2017

Member

mean that applying of 27e1e94 breaks cobertura-mavne-plugin execution.

We did a fix to this commit just recently, c6981b8.
I assume adding this on top of 27e1e94 does not fix it?

I'm unable to reproduce the problem on the 3 machines I have, windows and linux.

Can one of you confirm what initially causes it for 27e1e94 ?
Is it a specific line in the test (this is what we found for the fix in c6981b8), the fact the class is final, or even just adding the class annotations for powermock?

Member

rnveach commented Jun 14, 2017

mean that applying of 27e1e94 breaks cobertura-mavne-plugin execution.

We did a fix to this commit just recently, c6981b8.
I assume adding this on top of 27e1e94 does not fix it?

I'm unable to reproduce the problem on the 3 machines I have, windows and linux.

Can one of you confirm what initially causes it for 27e1e94 ?
Is it a specific line in the test (this is what we found for the fix in c6981b8), the fact the class is final, or even just adding the class annotations for powermock?

@MEZk

This comment has been minimized.

Show comment
Hide comment
@MEZk

MEZk Jun 14, 2017

Contributor

I assume adding this on top of 27e1e94 does not fix it?

Not, it did not fix the problem.

Contributor

MEZk commented Jun 14, 2017

I assume adding this on top of 27e1e94 does not fix it?

Not, it did not fix the problem.

@romani

This comment has been minimized.

Show comment
Hide comment
@romani

romani Jun 15, 2017

Member

Mocking of final classes is a very bad hack!

That is why we use powermock. It is better to do have hacks in test code vs bad design in main code


I do have the same problem on my local:
... NoSuchMethodException: com.puppycrawl.tools.checkstyle.api.AbstractCheck.__cobertura_classmap ...

Member

romani commented Jun 15, 2017

Mocking of final classes is a very bad hack!

That is why we use powermock. It is better to do have hacks in test code vs bad design in main code


I do have the same problem on my local:
... NoSuchMethodException: com.puppycrawl.tools.checkstyle.api.AbstractCheck.__cobertura_classmap ...

@MEZk

This comment has been minimized.

Show comment
Hide comment
@MEZk

MEZk Jun 15, 2017

Contributor

@romani
Can you check whether you have the issue before and after 27e1e94 ?

Contributor

MEZk commented Jun 15, 2017

@romani
Can you check whether you have the issue before and after 27e1e94 ?

@rnveach

This comment has been minimized.

Show comment
Hide comment
@rnveach

rnveach Jun 17, 2017

Member

There is a similar issue reported at cobertura/cobertura#308 for cobertura. Cobertura hasn't released anything in 2 years.
I couldn't find anything in powermock at https://github.com/powermock/powermock/issues , so we can ask them if they know anything but they will probably blame cobertura.

Otherwise, unless we find specific code we can rewrite, I think we may be stuck with this issue.

Member

rnveach commented Jun 17, 2017

There is a similar issue reported at cobertura/cobertura#308 for cobertura. Cobertura hasn't released anything in 2 years.
I couldn't find anything in powermock at https://github.com/powermock/powermock/issues , so we can ask them if they know anything but they will probably blame cobertura.

Otherwise, unless we find specific code we can rewrite, I think we may be stuck with this issue.

@Nimfadora

This comment has been minimized.

Show comment
Hide comment
@Nimfadora

Nimfadora Jun 17, 2017

Contributor

@rnveach, in scope of my GSoC program we were planning to replace cobertura by Jacoco. We can discuss with @romani the possibility to give this task heigher priority and finish it earlier.

Contributor

Nimfadora commented Jun 17, 2017

@rnveach, in scope of my GSoC program we were planning to replace cobertura by Jacoco. We can discuss with @romani the possibility to give this task heigher priority and finish it earlier.

@MEZk

This comment has been minimized.

Show comment
Hide comment
@MEZk

MEZk Jun 17, 2017

Contributor

@romani @Nimfadora
FYI: jacoco/jacoco#449 is not fixed by JaCoCo's team, however at my work we found a workaround. We can use MISSEDCOUNT and MISSEDCOUNT to avoid issues with precision.

Contributor

MEZk commented Jun 17, 2017

@romani @Nimfadora
FYI: jacoco/jacoco#449 is not fixed by JaCoCo's team, however at my work we found a workaround. We can use MISSEDCOUNT and MISSEDCOUNT to avoid issues with precision.

@rnveach

This comment has been minimized.

Show comment
Hide comment
@rnveach

rnveach Jun 17, 2017

Member

we were planning to replace cobertura by Jacoco

I didn't realize this as it wasn't on our wiki page, but I thought the reason we stayed away from jacoco is because it can't work with powermock yet. See https://github.com/powermock/powermock/wiki/Code-coverage-with-JaCoCo .

This is the results of jacoco run in my branch on master:

[WARNING] Rule violated for class com.puppycrawl.tools.checkstyle.filters.SuppressionFilter: branches covered ratio is 0.77, but expected minimum is 1.00
[WARNING] Rule violated for class com.puppycrawl.tools.checkstyle.checks.ClassResolver: lines covered ratio is 0.98, but expected minimum is 1.00
[WARNING] Rule violated for class com.puppycrawl.tools.checkstyle.checks.LineSeparatorOption: branches covered ratio is 0.87, but expected minimum is 1.00
[WARNING] Rule violated for class com.puppycrawl.tools.checkstyle.utils.JavadocUtils: lines covered ratio is 0.99, but expected minimum is 1.00
[WARNING] Rule violated for class com.puppycrawl.tools.checkstyle.utils.JavadocUtils: branches covered ratio is 0.98, but expected minimum is 1.00
[WARNING] Rule violated for class com.puppycrawl.tools.checkstyle.Main: lines covered ratio is 0.99, but expected minimum is 1.00
[WARNING] Rule violated for class com.puppycrawl.tools.checkstyle.Main: branches covered ratio is 0.89, but expected minimum is 1.00
Member

rnveach commented Jun 17, 2017

we were planning to replace cobertura by Jacoco

I didn't realize this as it wasn't on our wiki page, but I thought the reason we stayed away from jacoco is because it can't work with powermock yet. See https://github.com/powermock/powermock/wiki/Code-coverage-with-JaCoCo .

This is the results of jacoco run in my branch on master:

[WARNING] Rule violated for class com.puppycrawl.tools.checkstyle.filters.SuppressionFilter: branches covered ratio is 0.77, but expected minimum is 1.00
[WARNING] Rule violated for class com.puppycrawl.tools.checkstyle.checks.ClassResolver: lines covered ratio is 0.98, but expected minimum is 1.00
[WARNING] Rule violated for class com.puppycrawl.tools.checkstyle.checks.LineSeparatorOption: branches covered ratio is 0.87, but expected minimum is 1.00
[WARNING] Rule violated for class com.puppycrawl.tools.checkstyle.utils.JavadocUtils: lines covered ratio is 0.99, but expected minimum is 1.00
[WARNING] Rule violated for class com.puppycrawl.tools.checkstyle.utils.JavadocUtils: branches covered ratio is 0.98, but expected minimum is 1.00
[WARNING] Rule violated for class com.puppycrawl.tools.checkstyle.Main: lines covered ratio is 0.99, but expected minimum is 1.00
[WARNING] Rule violated for class com.puppycrawl.tools.checkstyle.Main: branches covered ratio is 0.89, but expected minimum is 1.00
@MEZk

This comment has been minimized.

Show comment
Hide comment
@MEZk

MEZk Jun 19, 2017

Contributor

Running mvn clean verify on my home PC results in the same error:

[Thread-2] ERROR net.sourceforge.cobertura.coveragedata.TouchCollector - Cannot apply touches
java.lang.NoSuchMethodException: com.puppycrawl.tools.checkstyle.api.AbstractViolationReporter.__cobertura_classmap(net.sourceforge.cobertura.coveragedata.LightClassmapListener)
        at java.lang.Class.getDeclaredMethod(Class.java:2130)
        at net.sourceforge.cobertura.coveragedata.TouchCollector.applyTouchesToSingleClassOnProjectData(TouchCollector.java:127)
        at net.sourceforge.cobertura.coveragedata.TouchCollector.applyTouchesOnProjectData(TouchCollector.java:110)
        at net.sourceforge.cobertura.coveragedata.ProjectData.saveGlobalProjectData(ProjectData.java:272)
        at net.sourceforge.cobertura.coveragedata.SaveTimer.run(SaveTimer.java:33)
        at java.lang.Thread.run(Thread.java:745)
[Thread-2] ERROR net.sourceforge.cobertura.coveragedata.TouchCollector - Cannot apply touches
java.lang.NoSuchMethodException: com.puppycrawl.tools.checkstyle.api.AutomaticBean.__cobertura_classmap(net.sourceforge.cobertura.coveragedata.LightClassmapListener)
        at java.lang.Class.getDeclaredMethod(Class.java:2130)
        at net.sourceforge.cobertura.coveragedata.TouchCollector.applyTouchesToSingleClassOnProjectData(TouchCollector.java:127)
        at net.sourceforge.cobertura.coveragedata.TouchCollector.applyTouchesOnProjectData(TouchCollector.java:110)
        at net.sourceforge.cobertura.coveragedata.ProjectData.saveGlobalProjectData(ProjectData.java:272)
        at net.sourceforge.cobertura.coveragedata.SaveTimer.run(SaveTimer.java:33)
        at java.lang.Thread.run(Thread.java:745)
[Thread-2] ERROR net.sourceforge.cobertura.coveragedata.TouchCollector - Cannot apply touches
java.lang.NoSuchMethodException: com.puppycrawl.tools.checkstyle.api.AbstractCheck.__cobertura_classmap(net.sourceforge.cobertura.coveragedata.LightClassmapListener)
        at java.lang.Class.getDeclaredMethod(Class.java:2130)
        at net.sourceforge.cobertura.coveragedata.TouchCollector.applyTouchesToSingleClassOnProjectData(TouchCollector.java:127)
        at net.sourceforge.cobertura.coveragedata.TouchCollector.applyTouchesOnProjectData(TouchCollector.java:110)
        at net.sourceforge.cobertura.coveragedata.ProjectData.saveGlobalProjectData(ProjectData.java:272)
        at net.sourceforge.cobertura.coveragedata.SaveTimer.run(SaveTimer.java:33)
        at java.lang.Thread.run(Thread.java:745)
[Thread-3] INFO net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler - Cobertura: Loaded information on 400 classes.
[Thread-3] INFO net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler - Cobertura: Saved information on 400 classes.
[Thread-19] INFO net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler - Cobertura: Loaded information on 400 classes.
[Thread-19] INFO net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler - Cobertura: Saved information on 400 classes.
[Thread-4] INFO net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler - Cobertura: Loaded information on 400 classes.
[Thread-4] INFO net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler - Cobertura: Saved information on 400 classes.
[Thread-17] INFO net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler - Cobertura: Loaded information on 400 classes.
[Thread-17] INFO net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler - Cobertura: Saved information on 400 classes.
[Thread-2] INFO net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler - Cobertura: Loaded information on 400 classes.
[Thread-2] INFO net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler - Cobertura: Saved information on 400 classes.
[Thread-12] INFO net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler - Cobertura: Loaded information on 400 classes.
[Thread-12] INFO net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler - Cobertura: Saved information on 400 classes.
[Thread-15] INFO net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler - Cobertura: Loaded information on 400 classes.
[Thread-15] INFO net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler - Cobertura: Saved information on 400 classes.
[Thread-0] INFO net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler - Cobertura: Loaded information on 400 classes.
[Thread-0] INFO net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler - Cobertura: Saved information on 400 classes.
[Thread-8] INFO net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler - Cobertura: Loaded information on 400 classes.
[Thread-8] INFO net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler - Cobertura: Saved information on 400 classes.
[Thread-7] INFO net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler - Cobertura: Loaded information on 400 classes.
[Thread-7] INFO net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler - Cobertura: Saved information on 400 classes.
[Thread-11] INFO net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler - Cobertura: Loaded information on 400 classes.
[Thread-11] INFO net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler - Cobertura: Saved information on 400 classes.
[Thread-16] INFO net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler - Cobertura: Loaded information on 400 classes.
[Thread-16] INFO net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler - Cobertura: Saved information on 400 classes.
[Thread-13] INFO net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler - Cobertura: Loaded information on 400 classes.
[Thread-13] INFO net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler - Cobertura: Saved information on 400 classes.
[Thread-14] INFO net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler - Cobertura: Loaded information on 400 classes.
[Thread-14] INFO net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler - Cobertura: Saved information on 400 classes.
[Thread-5] INFO net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler - Cobertura: Loaded information on 400 classes.
[Thread-5] INFO net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler - Cobertura: Saved information on 400 classes.
[Thread-18] INFO net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler - Cobertura: Loaded information on 400 classes.
[Thread-18] INFO net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler - Cobertura: Saved information on 400 classes.
[Thread-6] INFO net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler - Cobertura: Loaded information on 400 classes.
[Thread-6] INFO net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler - Cobertura: Saved information on 400 classes.
[INFO] 
[INFO] Results:
[INFO] 
[INFO] Tests run: 2102, Failures: 0, Errors: 0, Skipped: 0
[INFO] 
[INFO] 
[INFO] --- xml-maven-plugin:1.0.1:validate (default) @ checkstyle ---
[INFO] 
[INFO] <<< cobertura-maven-plugin:2.7:check (default) < [cobertura]test @ checkstyle <<<
[INFO] 
[INFO] --- cobertura-maven-plugin:2.7:check (default) @ checkstyle ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 03:34 min
[INFO] Finished at: 2017-06-19T13:27:32+03:00
[INFO] Final Memory: 95M/885M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:cobertura-maven-plugin:2.7:check (default) on project checkstyle: Coverage check failed. See messages above. -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
mvn --version
Apache Maven 3.3.9
Maven home: /usr/share/maven
Java version: 1.8.0_101, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-8-oracle/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.4.0-21-generic", arch: "amd64", family: "unix"
Contributor

MEZk commented Jun 19, 2017

Running mvn clean verify on my home PC results in the same error:

[Thread-2] ERROR net.sourceforge.cobertura.coveragedata.TouchCollector - Cannot apply touches
java.lang.NoSuchMethodException: com.puppycrawl.tools.checkstyle.api.AbstractViolationReporter.__cobertura_classmap(net.sourceforge.cobertura.coveragedata.LightClassmapListener)
        at java.lang.Class.getDeclaredMethod(Class.java:2130)
        at net.sourceforge.cobertura.coveragedata.TouchCollector.applyTouchesToSingleClassOnProjectData(TouchCollector.java:127)
        at net.sourceforge.cobertura.coveragedata.TouchCollector.applyTouchesOnProjectData(TouchCollector.java:110)
        at net.sourceforge.cobertura.coveragedata.ProjectData.saveGlobalProjectData(ProjectData.java:272)
        at net.sourceforge.cobertura.coveragedata.SaveTimer.run(SaveTimer.java:33)
        at java.lang.Thread.run(Thread.java:745)
[Thread-2] ERROR net.sourceforge.cobertura.coveragedata.TouchCollector - Cannot apply touches
java.lang.NoSuchMethodException: com.puppycrawl.tools.checkstyle.api.AutomaticBean.__cobertura_classmap(net.sourceforge.cobertura.coveragedata.LightClassmapListener)
        at java.lang.Class.getDeclaredMethod(Class.java:2130)
        at net.sourceforge.cobertura.coveragedata.TouchCollector.applyTouchesToSingleClassOnProjectData(TouchCollector.java:127)
        at net.sourceforge.cobertura.coveragedata.TouchCollector.applyTouchesOnProjectData(TouchCollector.java:110)
        at net.sourceforge.cobertura.coveragedata.ProjectData.saveGlobalProjectData(ProjectData.java:272)
        at net.sourceforge.cobertura.coveragedata.SaveTimer.run(SaveTimer.java:33)
        at java.lang.Thread.run(Thread.java:745)
[Thread-2] ERROR net.sourceforge.cobertura.coveragedata.TouchCollector - Cannot apply touches
java.lang.NoSuchMethodException: com.puppycrawl.tools.checkstyle.api.AbstractCheck.__cobertura_classmap(net.sourceforge.cobertura.coveragedata.LightClassmapListener)
        at java.lang.Class.getDeclaredMethod(Class.java:2130)
        at net.sourceforge.cobertura.coveragedata.TouchCollector.applyTouchesToSingleClassOnProjectData(TouchCollector.java:127)
        at net.sourceforge.cobertura.coveragedata.TouchCollector.applyTouchesOnProjectData(TouchCollector.java:110)
        at net.sourceforge.cobertura.coveragedata.ProjectData.saveGlobalProjectData(ProjectData.java:272)
        at net.sourceforge.cobertura.coveragedata.SaveTimer.run(SaveTimer.java:33)
        at java.lang.Thread.run(Thread.java:745)
[Thread-3] INFO net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler - Cobertura: Loaded information on 400 classes.
[Thread-3] INFO net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler - Cobertura: Saved information on 400 classes.
[Thread-19] INFO net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler - Cobertura: Loaded information on 400 classes.
[Thread-19] INFO net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler - Cobertura: Saved information on 400 classes.
[Thread-4] INFO net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler - Cobertura: Loaded information on 400 classes.
[Thread-4] INFO net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler - Cobertura: Saved information on 400 classes.
[Thread-17] INFO net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler - Cobertura: Loaded information on 400 classes.
[Thread-17] INFO net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler - Cobertura: Saved information on 400 classes.
[Thread-2] INFO net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler - Cobertura: Loaded information on 400 classes.
[Thread-2] INFO net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler - Cobertura: Saved information on 400 classes.
[Thread-12] INFO net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler - Cobertura: Loaded information on 400 classes.
[Thread-12] INFO net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler - Cobertura: Saved information on 400 classes.
[Thread-15] INFO net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler - Cobertura: Loaded information on 400 classes.
[Thread-15] INFO net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler - Cobertura: Saved information on 400 classes.
[Thread-0] INFO net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler - Cobertura: Loaded information on 400 classes.
[Thread-0] INFO net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler - Cobertura: Saved information on 400 classes.
[Thread-8] INFO net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler - Cobertura: Loaded information on 400 classes.
[Thread-8] INFO net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler - Cobertura: Saved information on 400 classes.
[Thread-7] INFO net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler - Cobertura: Loaded information on 400 classes.
[Thread-7] INFO net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler - Cobertura: Saved information on 400 classes.
[Thread-11] INFO net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler - Cobertura: Loaded information on 400 classes.
[Thread-11] INFO net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler - Cobertura: Saved information on 400 classes.
[Thread-16] INFO net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler - Cobertura: Loaded information on 400 classes.
[Thread-16] INFO net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler - Cobertura: Saved information on 400 classes.
[Thread-13] INFO net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler - Cobertura: Loaded information on 400 classes.
[Thread-13] INFO net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler - Cobertura: Saved information on 400 classes.
[Thread-14] INFO net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler - Cobertura: Loaded information on 400 classes.
[Thread-14] INFO net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler - Cobertura: Saved information on 400 classes.
[Thread-5] INFO net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler - Cobertura: Loaded information on 400 classes.
[Thread-5] INFO net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler - Cobertura: Saved information on 400 classes.
[Thread-18] INFO net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler - Cobertura: Loaded information on 400 classes.
[Thread-18] INFO net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler - Cobertura: Saved information on 400 classes.
[Thread-6] INFO net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler - Cobertura: Loaded information on 400 classes.
[Thread-6] INFO net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler - Cobertura: Saved information on 400 classes.
[INFO] 
[INFO] Results:
[INFO] 
[INFO] Tests run: 2102, Failures: 0, Errors: 0, Skipped: 0
[INFO] 
[INFO] 
[INFO] --- xml-maven-plugin:1.0.1:validate (default) @ checkstyle ---
[INFO] 
[INFO] <<< cobertura-maven-plugin:2.7:check (default) < [cobertura]test @ checkstyle <<<
[INFO] 
[INFO] --- cobertura-maven-plugin:2.7:check (default) @ checkstyle ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 03:34 min
[INFO] Finished at: 2017-06-19T13:27:32+03:00
[INFO] Final Memory: 95M/885M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:cobertura-maven-plugin:2.7:check (default) on project checkstyle: Coverage check failed. See messages above. -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
mvn --version
Apache Maven 3.3.9
Maven home: /usr/share/maven
Java version: 1.8.0_101, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-8-oracle/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.4.0-21-generic", arch: "amd64", family: "unix"
@MEZk

This comment has been minimized.

Show comment
Hide comment
@MEZk

MEZk Jun 19, 2017

Contributor

Problematic tests:

[INFO] 
[INFO] Results:
[INFO] 
[ERROR] Failures: 
[ERROR]   TreeWalkerTest.testBehaviourWithOnlyCommentChecks:328 
com.puppycrawl.tools.checkstyle.TreeWalker.appendHiddenCommentNodes(
    null
);
Wanted 1 time but was 2 times.
[ERROR]   TreeWalkerTest.testBehaviourWithOrdinaryAndCommentChecks:351 
com.puppycrawl.tools.checkstyle.TreeWalker.appendHiddenCommentNodes(
    null
);
Wanted 1 time but was 2 times.
[INFO] 
[ERROR] Tests run: 2091, Failures: 2, Errors: 0, Skipped: 0
[INFO] 
[ERROR] There are test failures.
Contributor

MEZk commented Jun 19, 2017

Problematic tests:

[INFO] 
[INFO] Results:
[INFO] 
[ERROR] Failures: 
[ERROR]   TreeWalkerTest.testBehaviourWithOnlyCommentChecks:328 
com.puppycrawl.tools.checkstyle.TreeWalker.appendHiddenCommentNodes(
    null
);
Wanted 1 time but was 2 times.
[ERROR]   TreeWalkerTest.testBehaviourWithOrdinaryAndCommentChecks:351 
com.puppycrawl.tools.checkstyle.TreeWalker.appendHiddenCommentNodes(
    null
);
Wanted 1 time but was 2 times.
[INFO] 
[ERROR] Tests run: 2091, Failures: 2, Errors: 0, Skipped: 0
[INFO] 
[ERROR] There are test failures.
@rnveach

This comment has been minimized.

Show comment
Hide comment
@rnveach

rnveach Jun 19, 2017

Member

Problematic tests:

@MEZk This was the error we fixed in #4445 with c6981b8 .
Are you saying that fix doesn't fix it for you?

Member

rnveach commented Jun 19, 2017

Problematic tests:

@MEZk This was the error we fixed in #4445 with c6981b8 .
Are you saying that fix doesn't fix it for you?

@MEZk

This comment has been minimized.

Show comment
Hide comment
@MEZk

MEZk Jun 19, 2017

Contributor

Are you saying that fix doesn't fix it for you?

Yes, sometimes it appears again during mvn clean verify execution.

I removed

@RunWith(PowerMockRunner.class)
@PrepareForTest(TreeWalker.class)

and 4 UTs (TreeWalkerTest)

testBehaviourWithZeroChecks
testBehaviourWithOnlyOrdinaryChecks
testBehaviourWithOnlyCommentChecks
testBehaviourWithOrdinaryAndCommentChecks

and ran mvn clean verify. The command finished without errors, however, code coverage did not satisfy threshold (it was OK).

Contributor

MEZk commented Jun 19, 2017

Are you saying that fix doesn't fix it for you?

Yes, sometimes it appears again during mvn clean verify execution.

I removed

@RunWith(PowerMockRunner.class)
@PrepareForTest(TreeWalker.class)

and 4 UTs (TreeWalkerTest)

testBehaviourWithZeroChecks
testBehaviourWithOnlyOrdinaryChecks
testBehaviourWithOnlyCommentChecks
testBehaviourWithOrdinaryAndCommentChecks

and ran mvn clean verify. The command finished without errors, however, code coverage did not satisfy threshold (it was OK).

@MEZk

This comment has been minimized.

Show comment
Hide comment
@MEZk

MEZk Jul 1, 2017

Contributor

Updated Linux kernel to: 4.4.0-83-generic
Java: 1.8.0_131
Cobertura is still failing on the master branch. Cannot pass cobertura:check goal.

Contributor

MEZk commented Jul 1, 2017

Updated Linux kernel to: 4.4.0-83-generic
Java: 1.8.0_131
Cobertura is still failing on the master branch. Cannot pass cobertura:check goal.

@romani

This comment has been minimized.

Show comment
Hide comment
@romani

romani Jul 3, 2017

Member

for me it is failing only on one of my box, but fails stable.
Unfortunately CI is green, so it will not keep an eye on this issue.

FAILING ON:

$ mvn --version
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T08:41:47-08:00)
Maven home: /opt/maven/default
Java version: 1.8.0_131, vendor: Oracle Corporation
Java home: /opt/jdk1.8.0_131/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.13.0-119-generic", arch: "amd64", family: "unix"

DOES NOT FAIL:

$ mvn --version
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T08:41:47-08:00)
Maven home: /opt/maven/apache-maven-3.3.9
Java version: 1.8.0_121, vendor: Oracle Corporation
Java home: /opt/jvm/jdk1.8.0_121/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.4.0-81-generic", arch: "amd64", family: "unix"

$ mvn --version
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T08:41:47-08:00)
Maven home: /opt/maven/apache-maven-3.3.9
Java version: 1.8.0_131, vendor: Oracle Corporation
Java home: /opt/jvm/jdk1.8.0_131/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.4.0-83-generic", arch: "amd64", family: "unix"
Member

romani commented Jul 3, 2017

for me it is failing only on one of my box, but fails stable.
Unfortunately CI is green, so it will not keep an eye on this issue.

FAILING ON:

$ mvn --version
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T08:41:47-08:00)
Maven home: /opt/maven/default
Java version: 1.8.0_131, vendor: Oracle Corporation
Java home: /opt/jdk1.8.0_131/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.13.0-119-generic", arch: "amd64", family: "unix"

DOES NOT FAIL:

$ mvn --version
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T08:41:47-08:00)
Maven home: /opt/maven/apache-maven-3.3.9
Java version: 1.8.0_121, vendor: Oracle Corporation
Java home: /opt/jvm/jdk1.8.0_121/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.4.0-81-generic", arch: "amd64", family: "unix"

$ mvn --version
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T08:41:47-08:00)
Maven home: /opt/maven/apache-maven-3.3.9
Java version: 1.8.0_131, vendor: Oracle Corporation
Java home: /opt/jvm/jdk1.8.0_131/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.4.0-83-generic", arch: "amd64", family: "unix"
@romani

This comment has been minimized.

Show comment
Hide comment
@romani

romani Jul 3, 2017

Member

I tried to reproduce it on Travis with command that failed on my side
mvn verify -Dcheckstyle.ant.skip=true -Dcheckstyle.skip=true -Dpmd.skip=true -Dfindbugs.skip=true -DskipITs, see #4597 , but Travis works fine.
, https://travis-ci.org/checkstyle/checkstyle/jobs/249788594

Member

romani commented Jul 3, 2017

I tried to reproduce it on Travis with command that failed on my side
mvn verify -Dcheckstyle.ant.skip=true -Dcheckstyle.skip=true -Dpmd.skip=true -Dfindbugs.skip=true -DskipITs, see #4597 , but Travis works fine.
, https://travis-ci.org/checkstyle/checkstyle/jobs/249788594

romani added a commit that referenced this issue Jul 3, 2017

romani added a commit that referenced this issue Jul 4, 2017

@romani romani added the miscellaneous label Jul 4, 2017

@romani romani added this to the 8.1 milestone Jul 4, 2017

@romani

This comment has been minimized.

Show comment
Hide comment
@romani

romani Jul 4, 2017

Member

@Nimfadora and @MEZk , I merged refactoring to test to avoid over mocking.
Please pull latest master and check on your side, how it works? It works on my side.
If smth is still a problem on your side, you need to do some changes yourself.

Member

romani commented Jul 4, 2017

@Nimfadora and @MEZk , I merged refactoring to test to avoid over mocking.
Please pull latest master and check on your side, how it works? It works on my side.
If smth is still a problem on your side, you need to do some changes yourself.

@romani romani closed this Jul 4, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment