Skip to content

Commit d6e73dd

Browse files
ci: add Windows unit-test job to catch OS-specific path bugs (#1522)
* ci: add Windows unit-test job to catch OS-specific path bugs The CI matrix ran Linux-only, so platform-specific defects — e.g. #1520, where file-protocol paths rendered with native backslashes broke garbage collection on Windows — could not be caught. Add a windows-latest leg running the container-free unit suite across both ends of the supported Python range (3.10, 3.14). pixi targets linux/osx only ([tool.pixi] platforms), so this leg installs via pip (.[test]) rather than pixi. Unit tests need no containers, so no Docker/DB is required on Windows. * ci: note the Windows pip leg resolves a different test dep-set than pixi The pip fallback resolves [project.optional-dependencies].test, which differs from the pixi legs' [dependency-groups].test (e.g. omits graphviz). Flag the latent trap so a dep-set mismatch isn't mistaken for an OS-specific failure. Addresses MilagrosMarin's review on #1522.
1 parent 8d05d98 commit d6e73dd

1 file changed

Lines changed: 35 additions & 0 deletions

File tree

.github/workflows/test.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,38 @@ jobs:
6868

6969
- name: Run unit tests
7070
run: pixi run -e test pytest tests/unit -v
71+
72+
# Windows unit tests: guard OS-specific behavior (path separators, etc.) that
73+
# the Linux jobs above cannot catch — e.g. #1520, where file-protocol paths
74+
# rendered with native backslashes broke garbage collection on Windows.
75+
# pixi targets linux/osx only (see [tool.pixi] platforms), so this leg uses
76+
# pip. Unit tests need no containers, so no Docker/DB is required on Windows.
77+
unit-tests-windows:
78+
runs-on: windows-latest
79+
strategy:
80+
fail-fast: false
81+
matrix:
82+
# Exercise both ends of the supported range (requires-python >=3.10,<3.15).
83+
python-version: ["3.10", "3.14"]
84+
name: unit-tests-windows (py${{ matrix.python-version }})
85+
steps:
86+
- uses: actions/checkout@v4
87+
with:
88+
fetch-depth: 0 # hatch-vcs derives the version from git history/tags
89+
90+
- name: Set up Python
91+
uses: actions/setup-python@v5
92+
with:
93+
python-version: ${{ matrix.python-version }}
94+
95+
# NOTE: pip resolves `[project.optional-dependencies].test`, which is a
96+
# DIFFERENT set than the pixi Linux legs' `[dependency-groups].test`
97+
# (e.g. it omits graphviz). A unit test importing a dep present in only
98+
# one set would then pass on Linux but error on Windows (or vice versa) —
99+
# a dep-set mismatch that reads like an OS bug. Keep the two `test` sets
100+
# in sync when unit-test dependencies change.
101+
- name: Install package with test extras
102+
run: pip install -e ".[test]"
103+
104+
- name: Run unit tests
105+
run: pytest tests/unit -v

0 commit comments

Comments
 (0)