-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
[good-first-issue] Incomplete Cobertura XML spec support #17689
Labels
bug
mypy got something wrong
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug Report
The
cobetura.xml
file generated does not contain thelines-covered
andlines-valid
attributes. According to https://stackoverflow.com/a/71116722/595220, the spec is at https://github.com/cobertura/web/blob/master/htdocs/xml/coverage-04.dtd which hasI haven't checked ll
To Reproduce
Add
--cobertura-xml-report
to any MyPy invocation, grab the resulting XML file, and feed it toirongut/CodeCoverageSummary
@ GHA.Expected Behavior
Spec-compliant tools shouldn't crash when presented with a MyPy-produced coverage XML report advertising its compatibility with the Cobertura standard.
Actual Behavior
Tools like the
irongut/CodeCoverageSummary
action error out because of missing required XML attributes: irongut/CodeCoverageSummary#324. It fails upon checking for the presence of thelines-covered
attribute in the<coverage>
node with"Overall lines covered not found"
in this case. But I looked further into their source code, and I saw that it'd also choke on missinglines-valid
with"Overall lines valid not found"
.I haven't checked any further but it might be a good idea to check the implementation against anything marked as
#REQUIRED
in said DTD spec.Extra research
Looking into https://github.com/python/mypy/blob/fe15ee6/mypy/report.py#L597, it seems to me that the values that could be mapped to the missing attributes are already present in the class and the mapping should be straightforward:
The text was updated successfully, but these errors were encountered: