-
Notifications
You must be signed in to change notification settings - Fork 17
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
python coverage not supported with --branch
#109
Comments
Hey! Thank you for reporting the issue. Python coverage calculation from |
Hi @mrexox! Good pointer on the XML reports; that fixed a lot of the issues, and it's clearly on me for not reading the documentation closely enough. 😅 After switching to XML reports, a new display issue on Coveralls was easily solved by tweaking However, even after figuring out the correct format and configuration, coverage upload with the new reporter is still a step down from uploading with the Going beyond just the color-coding, branch-coverage tooltips are also less useful with the newer reporter. Compare this block in a build uploaded by …against the same location as uploaded by this newer binary using In this particular case, the That's enough nitpicking from me for one day, I'm sure. Better support for Python coverage reports is undoubtedly in the works, and we'll keep an eye out for developments. For now, though, as long as the older tool still works and provides more readable reports, I think we'll put our migration (sopel-irc/sopel#2551) to the newer binary on hold. |
Closing this as python parser now converts |
I ran a quick test of this using the following workflow steps: - name: Run pytest
run: make test_norecord
- name: Generate coverage report
run: coverage report
- name: Upload coverage report to coveralls.io
uses: coverallsapp/github-action@v2
with:
flag-name: ${{ matrix.python-version }}
parallel: true In the resulting Coveralls build, other than our build configuration not yet aligning with the ideal for avoiding "drifted build" warnings, branch coverage still is not being reported as expected after Branch coverage reported using Unless I've configured our test job wrong (see recent commits to sopel-irc/sopel#2551), it doesn't seem to me that this issue is actually resolved yet. 😕 |
Thanks, @dgw. We will have another look at this. The question is: Why were previous conditional statement (with branch coverage) showing partial coverage (yellow) when their child branches had misses (correct), while, now, those same conditionals, whose child branches still have misses, now show as fully covered (green)? Example provide by @dgw: |
The SQL query below used to parse
.coverage
for Python projects returns 0 results ifcoverage
was run with--branch
on the CLI or withbranch = True
in.coveragerc
.coverage-reporter/src/coverage_reporter/parsers/coveragepy_parser.cr
Lines 10 to 14 in fd443e4
With this argument/setting,
coverage
seems not to add any rows in theline_bits
table, andcoverage-reporter
will therefore find that there is "nothing to report" using the above query; only thearc
table is populated with--branch
, and it isn't queried.Omitting the
--branch
argument or removing/commenting out thebranch = True
configuration setting letscoverage-reporter
find results in the.coverage
file, with the obvious caveat that only statement coverage data is reported.Note that without
--branch
, thearc
table is now empty, andline_bits
is populated.I attempted to work around this by running
coverage lcov
prior to thecoverallsapp/github-action@v2
step, and it appears to work, but doesn't seem ideal. With zero code changes, the project's coverage jumped by 0.6% and spot-checking a few places showed a lot of unexpected branch coverage annotations on Coveralls. For example, partially covered branches I checked are now shown as fully covered, and sometimes branch-coverage annotations appear in the Coveralls UI where there is no branch at all:I'm unsure yet whether
coverage
outputs badlcov
format when branch tracking is enabled, or ifcoveralls-reporter
isn't parsing it correctly. At this point I've only managed to figure out that something isn't working as expected. 😅The text was updated successfully, but these errors were encountered: