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

Exception in parsing jacoco xml report #217

Closed
foxpluto opened this issue May 3, 2019 · 4 comments
Closed

Exception in parsing jacoco xml report #217

foxpluto opened this issue May 3, 2019 · 4 comments
Labels

Comments

@foxpluto
Copy link

foxpluto commented May 3, 2019

Describe the bug
Exception thrown "Cannot read property 'filter' of undefined"

To Reproduce
Steps to reproduce the behaviour:
I am using vscode coverage with jacoco and I have found a bug parsing a jacoco xml report. I attach the file for further inspection.
The complete stack trace is:

[1556875420792][coverageservice]: Loading 1 file(s)
[1556875420792][coverageservice]: Loaded 1 data file(s)
[1556875420805][coverageparser][jacoco-parse]: Error: filename: /Users/fox/Documents/workspace/2019-04-09-Automation/metrics/build/reports/jacoco.xml Cannot read property 'filter' of undefined
[1556875420805][coverageparser][jacoco-parse]: Stacktrace: TypeError: filename: /Users/fox/Documents/workspace/2019-04-09-Automation/metrics/build/reports/jacoco.xml Cannot read property 'filter' of undefined
	at getCounter (/Users/fox/.vscode/extensions/ryanluker.vscode-coverage-gutters-2.3.1/node_modules/jacoco-parse/source/index.js:9:27)
	at /Users/fox/.vscode/extensions/ryanluker.vscode-coverage-gutters-2.3.1/node_modules/jacoco-parse/source/index.js:33:27
	at Array.map (<anonymous>)
	at /Users/fox/.vscode/extensions/ryanluker.vscode-coverage-gutters-2.3.1/node_modules/jacoco-parse/source/index.js:23:35
	at Array.forEach (<anonymous>)
	at unpackage (/Users/fox/.vscode/extensions/ryanluker.vscode-coverage-gutters-2.3.1/node_modules/jacoco-parse/source/index.js:21:14)
	at /Users/fox/.vscode/extensions/ryanluker.vscode-coverage-gutters-2.3.1/node_modules/jacoco-parse/source/index.js:123:22
	at Parser.<anonymous> (/Users/fox/.vscode/extensions/ryanluker.vscode-coverage-gutters-2.3.1/node_modules/xml2js/lib/parser.js:303:18)
	at Parser.emit (events.js:182:13)
	at SAXParser.onclosetag (/Users/fox/.vscode/extensions/ryanluker.vscode-coverage-gutters-2.3.1/node_modules/xml2js/lib/parser.js:261:26)
	at emit (/Users/fox/.vscode/extensions/ryanluker.vscode-coverage-gutters-2.3.1/node_modules/sax/lib/sax.js:624:35)
	at emitNode (/Users/fox/.vscode/extensions/ryanluker.vscode-coverage-gutters-2.3.1/node_modules/sax/lib/sax.js:629:5)
	at closeTag (/Users/fox/.vscode/extensions/ryanluker.vscode-coverage-gutters-2.3.1/node_modules/sax/lib/sax.js:889:7)
	at SAXParser.write (/Users/fox/.vscode/extensions/ryanluker.vscode-coverage-gutters-2.3.1/node_modules/sax/lib/sax.js:1436:13)
	at Parser.exports.Parser.Parser.parseString (/Users/fox/.vscode/extensions/ryanluker.vscode-coverage-gutters-2.3.1/node_modules/xml2js/lib/parser.js:322:31)
	at Parser.bind [as parseString] (/Users/fox/.vscode/extensions/ryanluker.vscode-coverage-gutters-2.3.1/node_modules/xml2js/lib/parser.js:5:59)
	at exports.parseString (/Users/fox/.vscode/extensions/ryanluker.vscode-coverage-gutters-2.3.1/node_modules/xml2js/lib/parser.js:354:19)
	at Object.parse.parseContent (/Users/fox/.vscode/extensions/ryanluker.vscode-coverage-gutters-2.3.1/node_modules/jacoco-parse/source/index.js:116:5)
	at xmlExtractJacoco.Promise (/Users/fox/.vscode/extensions/ryanluker.vscode-coverage-gutters-2.3.1/out/src/files/coverageparser.js:103:32)
	at new module.exports.t.exports (/Users/fox/.vscode/extensions/vscjava.vscode-java-dependency-0.4.0/dist/extension.js:1:120859)
	at CoverageParser.xmlExtractJacoco (/Users/fox/.vscode/extensions/ryanluker.vscode-coverage-gutters-2.3.1/out/src/files/coverageparser.js:94:16)
	at CoverageParser.<anonymous> (/Users/fox/.vscode/extensions/ryanluker.vscode-coverage-gutters-2.3.1/out/src/files/coverageparser.js:42:47)
	at Generator.next (<anonymous>)
	at __awaiter (/Users/fox/.vscode/extensions/ryanluker.vscode-coverage-gutters-2.3.1/out/src/files/coverageparser.js:7:71)
	at new module.exports.t.exports (/Users/fox/.vscode/extensions/vscjava.vscode-java-dependency-0.4.0/dist/extension.js:1:120859)
	at __awaiter (/Users/fox/.vscode/extensions/ryanluker.vscode-coverage-gutters-2.3.1/out/src/files/coverageparser.js:3:12)
	at CoverageParser.filesToSections (/Users/fox/.vscode/extensions/ryanluker.vscode-coverage-gutters-2.3.1/out/src/files/coverageparser.js:27:16)
	at CoverageService.<anonymous> (/Users/fox/.vscode/extensions/ryanluker.vscode-coverage-gutters-2.3.1/out/src/coverage-system/coverageservice.js:76:64)
	at Generator.next (<anonymous>)
	at fulfilled (/Users/fox/.vscode/extensions/ryanluker.vscode-coverage-gutters-2.3.1/out/src/coverage-system/coverageservice.js:4:58)
	at i (/Users/fox/.vscode/extensions/vscjava.vscode-java-dependency-0.4.0/dist/extension.js:1:101710)
	at /Users/fox/.vscode/extensions/vscjava.vscode-java-dependency-0.4.0/dist/extension.js:1:102054

Expected behaviour
The normal behaviour of the plugin

Desktop (please complete the following information):

  • OS: macos
  • Extension Version 2.3.1
  • VSCode Version 1.33.1

Additional context
With other classes I don't have any problem.
jacoco.xml.zip

Thanks very much for your work!
S.

@ryanluker
Copy link
Owner

ryanluker commented May 12, 2019

@foxpluto Thanks for submitting a bug! I probably wont be able to investigate this one until the 2.4.0 release is finished. One other thing you could maybe do is report this issue to https://github.com/vokal/jacoco-parse and see if they would be able to fix it on their end (if it truly is an issue on their side). Otherwise I should be able to start work on this in the next release.

@ryanluker
Copy link
Owner

@foxpluto pretty annoying but https://github.com/vokal/jacoco-parse has been deprecated / made read only. We might need to consider writing our own jacoco xml parser (similar to what we will have to do for the python coverage one here #224). I will put this into the 3.0.0 release with the python coverage support.

@ryanluker ryanluker added this to the 3.0.0 milestone Aug 25, 2019
@foxpluto
Copy link
Author

foxpluto commented Aug 26, 2019 via email

@ryanluker
Copy link
Owner

Closing this ticket due to Jacoco being deprecated and archived now.
There is also other options for python devs and soon we will also support coverage in 3.0.0.

@ryanluker ryanluker removed this from the 3.0.0 milestone May 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants