-
Notifications
You must be signed in to change notification settings - Fork 92
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
Cannot read property 'lines' of undefined #354
Comments
@reganheath Thanks for the issue, I will try to dig into it for yeah soon. To give you something high level to try out, I know cobertura has been annoying for some to get working, so if you are able to use lcov or clover formats for coverage instead... that would be preferable. I also found this person setup with erlang and the extension with a lcov generate they built. I am no erlang expert though so it might not work with rebar3 🤔 . Maybe that will help? |
@ryanluker Hi, thanks. No rush on this. GitLab itself handles the coverage data, so we've got that and I can easily write a small script to clean it up for coverage gutters. Thanks! |
@reganheath I might close this ticket then as eventually Cobertura will be deprecated given it isn't maintained anymore and will slowly rot... https://github.com/vokal/cobertura-parse Most of the issues that show up like this are due to bugs not being fixed in the upstream package. We even had to pin the package to a specific commit to get what we needed 😓 . If we could find a different js / ts package for consuming Cobertura style coverage... then we should definitely switch to that! |
@reganheath I believe this is fixed with #360 possibly. |
@ryanluker Hi, unfortunately the bug persists in v2.10.1 unchanged (same stack, same cause, same result). |
I have created a patch: fschwaiger/cobertura-parse#1 |
@reganheath Thanks for the heads up! |
@reganheath Upstream is merged, so we just need to update the commit hash, do you have an example file we can use to simulate the error and test that it has been fixed? |
Any file with a package with no classes will do, e.g. |
@reganheath This will be fixed in the 2.11.0 release! |
@reganheath I just saw that 2.11.0 has a bunch of stuff in it already 😅 if this upcoming release ends up taking longer than a month to finish, I will do a smaller release to get this stuff out and into the marketplace store. |
@reganheath sorry for the delay, 2.10.2 is going out now and includes the cobertura fix. |
I have coverage gutters v2.9.1
I am generating code coverage for Erlang using rebar3, then converting the output to Cobertura using https://github.com/covertool/covertool.
The top of the stack is..
[1643108745489][coverageparser][cobertura-parse]: Stacktrace: TypeError: filename: //Dev/game/X/_build/test/covertool/X.covertool.xml Cannot read property 'lines' of undefined
at extractLcovStyleBranches (/***/.vscode-server/extensions/ryanluker.vscode-coverage-gutters-2.9.1/node_modules/cobertura-parse/source/index.js:30:12)
at //.vscode-server/extensions/ryanluker.vscode-coverage-gutters-2.9.1/node_modules/cobertura-parse/source/index.js:77:24
at Array.map (:null:null)
at unpackage (//.vscode-server/extensions/ryanluker.vscode-coverage-gutters-2.9.1/node_modules/cobertura-parse/source/index.js:75:20)
at //.vscode-server/extensions/ryanluker.vscode-coverage-gutters-2.9.1/node_modules/cobertura-parse/source/index.js:134:22
at Parser. (//.vscode-server/extensions/ryanluker.vscode-coverage-gutters-2.9.1/node_modules/xml2js/lib/parser.js:303:18)
Which, I believe, indicates that the c (class) object passed to extractLcovStyleBranches is undefined. Which seems to indicate that the array returned by classesFromPackages has included an 'undefined' element.
I checked classesFromPackages, and compared to the XML I have, which looks like (cut down, removed identifiers, etc)
If I remove all the packages with no classes, e.g.
Then it works without error.
The text was updated successfully, but these errors were encountered: