-
-
Notifications
You must be signed in to change notification settings - Fork 436
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
TokenError when generating html report #82
Comments
This is curious. It would help if I could see the .coverage file, thanks. |
Original comment by Chris AtLee (Bitbucket: chrisatlee, GitHub: Unknown) buildbot uses Jinja as its web template engine. I wonder if Jinja is faking out the file/line numbers in the generated python files during execution? |
Original comment by Chris AtLee (Bitbucket: chrisatlee, GitHub: Unknown) Ooops, didn't mean to change the component |
Yes, "coverage debug data" shows this entry: /home/catlee/src/buildbot/master/buildbot/status/web/templates/revmacros.html: 51 lines Any chance you could make me a small .tar with a reproducible case? |
Original comment by Chris AtLee (Bitbucket: chrisatlee, GitHub: Unknown) I tarred up my virtual env...and it's 31MB. I can put that up somewhere, otherwise, here are the steps to reproduce.
|
Thanks, Chris, I'm able to reproduce it with the steps you gave. |
Original comment by Nathan Yergler (Bitbucket: nyergler, GitHub: nyergler) We're experiencing this, as well, when attempting to generate the XML report. I've attached a small test case that you can use by:
Ka-boom! I initially thought this was due to our use of PackageLoader, which loads templates from within packages, but rewrote my simple example to use the FileSystemLoader. |
In changeset <<changeset d27dbdb02d5a (bb)>>, I changed the code to not trace *.html files, fixing this problem. |
Original comment by Alexandre Conrad (Bitbucket: aconrad, GitHub: aconrad) I have the same problem. The following change worked for me:
as my templates have a .jinja2 extention name. Would there be a way to exclude patterns from the command line? Or maybe just skip files that don't compile and report it at the end of the XML conversion? (don't know if that's acceptable though). |
Original comment by Anonymous I'm experiencing this problem with a Jinja2 template that ends in ".js.inc" I believe this is a valid use case. The Jinja template documentation at http://jinja.pocoo.org/docs/templates/ says: "A template is simply a text file. It can generate any text-based format (HTML, XML, CSV, LaTeX, etc.). It doesn’t have a specific extension, .html or .xml are just fine." As a workaround I can either include=[".py"] or omit=[".js.inc"] But it seems worthwhile to investigate a fix in coverage.py. Some thoughts:
|
Original comment by Anonymous (Sorry, last comment was from me. I guess I don't have a bitbucket account. My name is Mark Doliner. Email address is mark@kingant.net, if there's anything I can help with.) |
After soliciting opinions in http://nedbatchelder.com/blog/201203/what_files_should_coverage_measure.html , I've fixed this bug in <<changeset 316cb1ba9bea (bb)>> to not report errors if the file doesn't have a Python-ish file extension. |
Original comment by Mark Doliner (Bitbucket: markdoliner, GitHub: markdoliner) Thanks, Ned! |
This seems to still be happening with Jinja:
|
Closed again with <<changeset cad566556ce0 (bb)>> |
Original comment by Davide Setti (Bitbucket: vad, GitHub: vad) I have the same issue with coverage 3.5.3 and Jinja 2.6. My templates ends with .jinja2. Do i need to give them .html extension?
|
Davide, no, you don't have to change what you are doing. This is a bug in coverage.py. I'll re-open this ticket and fix it soon. |
This is fixed in <<changeset 5b49a4eacb8c (bb)>>. |
Issue #217 was marked as a duplicate of this issue. |
Originally reported by Chris AtLee (Bitbucket: chrisatlee, GitHub: Unknown)
I'm trying to run coverage on the buildbot source like this:
And get the following exception:
I think this is because there's one of the .html files in the coverage report for some reason. I can attach the .coverage file if that helps.
This patch seems to fix the problem:
The text was updated successfully, but these errors were encountered: