Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -277,11 +277,6 @@ jobs:
# We use pytest-xdist to make this run much faster.
# The downside is that we cannot use -s / --capture=no.
#
# We use coverage to collect coverage data but we currently
# do not upload / use it because combining Windows and Linux
# coverage is challenging.
#
# We therefore have a few ``# pragma: no cover`` statements.
uv run --extra=dev \
coverage run -m pytest \
--skip-real \
Expand All @@ -292,6 +287,14 @@ jobs:
env:
UV_PYTHON: ${{ matrix.python-version }}

- name: Upload coverage data
uses: actions/upload-artifact@v7
with:
name: coverage-data-windows-${{ matrix.python-version }}
path: .coverage.*
include-hidden-files: true
if-no-files-found: error

coverage:
name: Combine & check coverage
needs: [ci-tests, skip-tests, windows-tests]
Expand Down
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,8 @@ run.omit = [
"src/mock_vws/_flask_server/healthcheck.py",
]
run.parallel = true
run.patch = [ "subprocess" ]
run.relative_files = true
run.source = [ "ci/", "src/", "tests/" ]
report.exclude_also = [
"class .*\\bProtocol\\):",
Expand Down
10 changes: 3 additions & 7 deletions tests/mock_vws/test_docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,7 @@ def fixture_custom_bridge_network() -> Iterator[Network]:
name = "test-vws-bridge-" + uuid.uuid4().hex
try:
network = client.networks.create(name=name, driver="bridge")
# We skip coverage here because combining Windows and Linux coverage
# is challenging.
except NotFound: # pragma: no cover
except NotFound:
# On Windows the "bridge" network driver is not available and we use
# the "nat" driver instead.
network = client.networks.create(name=name, driver="nat")
Expand Down Expand Up @@ -145,9 +143,7 @@ def test_build_and_run(
target="target-manager",
rm=True,
)
# We skip coverage here because combining Windows and Linux coverage
# is challenging.
except BuildError as exc: # pragma: no cover
except BuildError as exc:
full_log = "\n".join(
[item["stream"] for item in exc.build_log if "stream" in item],
)
Expand All @@ -161,7 +157,7 @@ def test_build_and_run(
windows_message_substring in exc.msg
for windows_message_substring in windows_message_substrings
):
raise AssertionError(full_log) from exc
raise AssertionError(full_log) from exc # pragma: no cover
pytest.skip(
reason="We do not currently support using Windows containers."
)
Expand Down
Loading