Open jaraco opened 4 months ago
git checkout e5c6df77d
This commit doesn't seem to be in the repo anymore, and when I ran nox on trunk, I got:
nox > Running session coverage_report
nox > Creating virtual environment (virtualenv) using python in .nox/coverage_report
nox > python -m pip install 'coverage[toml]'
nox > coverage combine
Combined data file .coverage.geometer.lan.5627.XAuKZYsx
Combined data file .coverage.geometer.lan.5871.XazxqWlx
Combined data file .coverage.geometer.lan.6111.XTCIvhpx
Combined data file .coverage.geometer.lan.6360.XbLLYRNx
Combined data file .coverage.geometer.lan.6611.XtIfvEOx
Combined data file .coverage.geometer.lan.6851.XzORrlFx
nox > coverage report
Name Stmts Miss Branch BrPart Cover Missing
---------------------------------------------------
TOTAL 674 0 265 0 100%
13 files skipped due to complete coverage.
Is this still happening somewhere I can look at?
I pushed a tag for the commit. git checkout coverage-1770
should get the commit. It's definitely there, as the github link to the code above is pinned to that commit. You may need to fetch it explicitly, something like git fetch https://github.com/jaraco/towncrier e5c6df77d
.
I just double-checked and ran the repro steps in a clean docker image and they do work for me. So maybe pushing that tag helped keep that commit active.
OK, I got the commit, but I still have 100% coverage: https://gist.github.com/nedbat/3ad003d2c6428282e3249fd33a5f8e2d
So hard to reproduce the issue reliably :(
I see in your run that the typecheck
job failed, but the others passed. In my run, the docs
job fails, but the others pass. When I run it locally on my mac, all the jobs pass (but tests-pypy3.8 is skipped). In both of my cases, the coverage reports show the missing branch.
Since I supplied the Docker repro instructions, are you able to use those to replicate the missed expectation?
Since you're not able to reproduce the issue, that suggests the issue may be sensitive to the environment, and since the issue occurs on my mac and in a Linux docker image I created, it makes me think there may be something about my environment that's triggering the behavior. I'll try paring the Docker image down to its minimal requirements.
Here's a more minimal docker image that replicates the missed branch:
FROM ubuntu:noble
ENV TZ=UTC
RUN apt update
RUN apt install -y software-properties-common
RUN apt-add-repository -y ppa:deadsnakes
RUN apt update
RUN DEBIAN_FRONTEND=noninteractive apt install -y git python3 pipx
RUN apt install -y python3.9-dev python3.9-venv
RUN git clone https://github.com/jaraco/towncrier
WORKDIR towncrier
RUN git checkout e5c6df77d
RUN pipx install nox
ENV PATH=/root/.local/bin:$PATH
CMD nox
Describe the bug
In https://github.com/twisted/towncrier/pull/591#issuecomment-2081516763, I encountered what appears to be a spurious false positive. The coverage report is indicating that
20->exit
is not covered. even though that line seems to be unequivocally covered (how could that context not exit?).To Reproduce How can we reproduce the problem? Please be specific. Don't link to a failing CI job. Answer the questions below:
Expected behavior That line is covered by the code, so there should be no coverage concerns. Moreover, an earlier version of the code does not exhibit the issue (even though it also opens the file in a context).
Am I missing some crucial detail here?