You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add --cobertura-xml-report to any MyPy invocation, grab the resulting XML file, and feed it to irongut/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 the lines-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 missing lines-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.
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: