Skip to content
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

Support for JaCoCo on Java 9 #1052

Merged
merged 13 commits into from Jan 3, 2017
Merged

Support for JaCoCo on Java 9 #1052

merged 13 commits into from Jan 3, 2017

Conversation

bmuschko
Copy link
Contributor

For more information see #1006.

@bmuschko bmuschko added this to the 4.0 milestone Dec 21, 2016
@bmuschko bmuschko changed the title Bm jacoco java9 Support for JaCoCo with Java 9 Dec 21, 2016
@bmuschko bmuschko self-assigned this Dec 21, 2016
@bmuschko bmuschko changed the title Support for JaCoCo with Java 9 Support for JaCoCo on Java 9 Dec 21, 2016
@bmuschko
Copy link
Contributor Author

Relevant CI job.

Copy link
Member

@big-guy big-guy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please take a look at JacocoAgentJarTest and add additional coverage for the new Jacoco version/versioning scheme.

@@ -81,7 +78,6 @@ class JacocoPluginIntegrationTest extends AbstractIntegrationSpec {
then: output.contains "org.jacoco:org.jacoco.ant:0.6.0.201210061924"
}

@Requires(FIX_TO_WORK_ON_JAVA9)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For all the tests below this one in this file, can we split them into a separate MultiVersionIntegrationSpec to test multiple versions of Jacoco? It looks like we don't have very many tests that use different versions.

@@ -267,19 +257,17 @@ public class ThingTest {
":test" in nonSkippedTasks
":otherTests" in nonSkippedTasks
file("build/jacoco/jacocoMerge.exec").exists()
htmlReport("build/reports/jacoco/mergedReport/html").totalCoverage() == 65
htmlReport("build/reports/jacoco/mergedReport/html").totalCoverage() == 64
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did this change? Just a different calculation on the jacoco side?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think something changes on the JaCoCo side on how they calculate the coverage number. I didn't look into their release notes though. Maybe they had a bug before or introduced a new one.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's the reason: jacoco/jacoco#452

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, could we change our sample project to make this the same across versions?

@@ -43,7 +43,7 @@ class JacocoVersionIntegTest extends MultiVersionIntegrationSpec {
then:
def report = htmlReport()
report.totalCoverage() == 100
report.jacocoVersion() == version
report.jacocoVersion() == version || report.jacocoVersion().startsWith(version)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why wouldn't these be the equal now?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The latest JaCoCo library version has a non-timestamped version but they still use the timestamp when generating the report. Doh! I think it's simply an oversight on their end.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we move that detail into the report fixture? e.g., so we can do something like:

report.assertJacocoVersion(version)

And assertJacocoVersion does the fuzzy match.

@@ -43,7 +43,7 @@ class JacocoVersionIntegTest extends MultiVersionIntegrationSpec {
then:
def report = htmlReport()
report.totalCoverage() == 100
report.jacocoVersion() == version
report.jacocoVersion() == version || report.jacocoVersion().startsWith(version)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this test be made to not require <=JDK7?

Copy link
Contributor Author

@bmuschko bmuschko Dec 22, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately older versions of JaCoCo don't work on JDK 8.


@Requires(FIX_TO_WORK_ON_JAVA9)
class JacocoPluginCoverageVerificationIntegrationTest extends AbstractIntegrationSpec {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can this be made into a MultiVersionIntegrationSpec too?

@big-guy
Copy link
Member

big-guy commented Dec 22, 2016

The other thing I forgot to mention -- we should add something to the release notes about a default version change.

@bmuschko
Copy link
Contributor Author

@big-guy Yeah, I was planning to add something to the release notes after merging.

@bmuschko
Copy link
Contributor Author

@big-guy I addressed your comments for this PR. Can you please have another look?

@big-guy big-guy merged commit ab349c2 into master Jan 3, 2017
@big-guy big-guy deleted the bm-jacoco-java9 branch January 3, 2017 17:19
@bmuschko bmuschko modified the milestones: 3.4 RC1, 4.0 Jan 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants