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

generator jacoco html report #80

Closed
zyyong opened this issue Jul 20, 2018 · 4 comments
Closed

generator jacoco html report #80

zyyong opened this issue Jul 20, 2018 · 4 comments

Comments

@zyyong
Copy link

zyyong commented Jul 20, 2018

Hi,Thank you for your reply.
I use coverage generator is jacoco,want to create the coverage html report.But failed!

command line:
diff-cover app/build/reports/jacoco/jacocoTestReport/jacocoTestReport.xml --html-report report.html --compare-branch=remote/v2.0.0

error info:
Traceback (most recent call last):
File "/usr/local/bin/diff-cover", line 11, in
sys.exit(main())
File "/Library/Python/2.7/site-packages/diff_cover/tool.py", line 348, in main
exclude=arg_dict['exclude'],
File "/Library/Python/2.7/site-packages/diff_cover/tool.py", line 267, in generate_coverage_report
reporter = HtmlReportGenerator(coverage, diff, css_url=css_url)
UnboundLocalError: local variable 'coverage' referenced before assignment

@Bachmann1234
Copy link
Owner

Is it possible you could share the xml file? Diff-Cover is looking for lines with the xml attribute "line-rate" If you are hitting this error its a sign that the tool did not find any of these lines.

@zyyong
Copy link
Author

zyyong commented Aug 27, 2018

Can this tool generate the android diff coverage ? I use jacoco generate the android coverage, somebody said that this tool coud not use in android.

@Bachmann1234
Copy link
Owner

If you can create a jacoco it should in theory work with diff cover. The tool was originally written with python in mind so its possible some assumption was made that wont work for android. But I cant imagine what that would be off the top of my head

@Bachmann1234
Copy link
Owner

@peterg79 added jacoco support! https://pypi.org/project/diff_cover/1.0.5/

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