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

Jacoco Reporting is not work for me #408

Open
makiam opened this issue Dec 7, 2018 · 14 comments
Open

Jacoco Reporting is not work for me #408

makiam opened this issue Dec 7, 2018 · 14 comments

Comments

@makiam
Copy link
Contributor

makiam commented Dec 7, 2018

Jacoco Code coverage report integration seems now work.
Steps to reproduce:
Run NB IDE with plugin
Open some gradle project (Ex, I use samples/testing/jacoco/quickstart/groovy from gradle samples)
From project context menu invoke Code Coverage -> Show Report
In Report window click Run All Tests
In output I see test and jacocoTestReport tasks executed and I can see report under /build/jacocoHtml folder but not in report window nor coverage over source code

I used a latest NB build (build from sources on my own) and JDK 1.8 update 152 x64

@kelemen
Copy link
Owner

kelemen commented Dec 7, 2018

It works for me. Can you share a project with which I can reproduce your issue? Also, I have found the code coverage window in NB a little fragile. So, you might want to close the report window and reopen.

@makiam
Copy link
Contributor Author

makiam commented Dec 7, 2018

Still not works for me
I used this sample application: https://github.com/gradle/gradle/tree/master/subprojects/docs/src/samples/testing/jacoco/quickstart/groovy
Also I see this exception in IDE log
exception.txt

@kelemen
Copy link
Owner

kelemen commented Dec 7, 2018

Given the error message, I assume you are using Russian locale. It is just a guess, but that might have something to do with the issue. Can you attach the report.dtd and jacocoTestReport.xml referenced in the error message?

@kelemen
Copy link
Owner

kelemen commented Dec 7, 2018

Looking it a little more, it is probably not simply because of the locale but because the public ID of the dtd is not -//JACOCO//DTD Report 1.0//EN (I assume it is not EN but RU or something). Which version of NB are you using (or rather which version of this plugin)?

@kelemen
Copy link
Owner

kelemen commented Dec 7, 2018

Also, just in case: Can you send me your jacocoTestReport.xml?

@makiam
Copy link
Contributor Author

makiam commented Dec 8, 2018

I using the latest Netbeans dev build. Means I clone repository and build NB from sources.

I founв that exception is throwns when I set xml.enabled true. But *.dtd file is really missing
jacocoTestReport.zip

@kelemen
Copy link
Owner

kelemen commented Dec 8, 2018

Thanks, the issue had nothing to do with the locale. Actually, the version of Jacoco DTD has changed. This issue should now be fixed in master. Can you verify?

@makiam
Copy link
Contributor Author

makiam commented Dec 8, 2018

See other Exception now:
INFO [org.netbeans.gradle.project.coverage.GradleCoverageProvider]: Could not parse E:\Temp\quickstart\build\customJacocoReportDir\test\jacocoTestReport.xml
java.lang.NullPointerException
at java.net.URL.(URL.java:532)
Caused: java.net.MalformedURLException
at java.net.URL.(URL.java:627)
at java.net.URL.(URL.java:490)
at java.net.URL.(URL.java:439)
at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:620)
at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startEntity(XMLEntityManager.java:1304)
at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startDTDEntity(XMLEntityManager.java:1270)
at com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.setInputSource(XMLDTDScannerImpl.java:264)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDriver.dispatch(XMLDocumentScannerImpl.java:1161)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDriver.next(XMLDocumentScannerImpl.java:1045)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:959)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:602)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:505)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:841)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:770)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:243)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:339)
at org.openide.xml.XMLUtil.parse(XMLUtil.java:340)
[catch] at org.netbeans.gradle.project.coverage.GradleCoverageProvider.parse(GradleCoverageProvider.java:182)
at org.netbeans.gradle.project.coverage.GradleCoverageProvider.getResults(GradleCoverageProvider.java:214)
at org.netbeans.modules.gsf.codecoverage.CoverageManagerImpl.showReport(CoverageManagerImpl.java:273)
at org.netbeans.modules.gsf.codecoverage.CoverageAction$CoverageItemHandler.actionPerformed(CoverageAction.java:259)

@makiam
Copy link
Contributor Author

makiam commented Dec 8, 2018

FYI: test project repository: https://github.com/makiam/quickstart

@kelemen
Copy link
Owner

kelemen commented Dec 8, 2018

I have messed up the extensions. It should work now.

@makiam
Copy link
Contributor Author

makiam commented Dec 8, 2018

It works now, Amazing. Thanks a lot!

@makiam
Copy link
Contributor Author

makiam commented Dec 21, 2018

BTW. Is it possible to customize class coverage view colors? I see the jacoco coverage plugin for NB ant based projects. It offer to customize such colors for covered/partial/not covered lines. Also it can to show tooltip at gutter with covered/partial/not covered text

@kelemen
Copy link
Owner

kelemen commented Dec 21, 2018

This plugin just provides the meta-data of the code coverage and not the UI. So, there is only what NB provides for it. I assume you are talking about the TikiOne plugin. I will have to look at its source to check what it does to make this configurable.

@kelemen
Copy link
Owner

kelemen commented Dec 21, 2018

I took a quick look at that plugin and it seems, it manages these highlights itself unlike this plugin. So, I think you should ask the NB team to make code coverage highlights customizable (you can refer to the org-netbeans-modules-gsf-codecoverage library, which is what is used by this plugin).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants