Skip to content

Commit 285fe4f

Browse files
authored
addon-unit: skip test_windows_* on the Ubuntu platform (#4)
Mirrors the filename convention introduced in addons-source (ci.yml): test_*.py general — every platform test_linux_*.py Linux-only test_windows_*.py Windows-only test_integration_*.py Linux-only, full-pipeline/DB-backed The Ubuntu runner and its CI counterpart now skip test_windows_*.py so a Windows-only test file doesn't fail spuriously on Linux. A future scripts/windows/run-addon-unit.sh will do the inverse filter. Until a Windows image exists in the testbed, test_windows_*.py runs nowhere here — Windows coverage remains in addons-source's own Windows CI job. Verified locally: TMGimporter still passes all 175 tests, and a synthesised test_windows_fake.py was correctly skipped.
1 parent bf1a721 commit 285fe4f

3 files changed

Lines changed: 33 additions & 0 deletions

File tree

.github/workflows/addon-unit-tests.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,9 +214,20 @@ jobs:
214214
echo "=== $addon ==="
215215
out_dir="$GITHUB_WORKSPACE/gramps-testbed/test-results/$addon"
216216
mkdir -p "$out_dir"
217+
# Filename convention (mirrors
218+
# addons-source/.github/workflows/ci.yml):
219+
# test_*.py general — every platform
220+
# test_linux_*.py Linux-only
221+
# test_windows_*.py Windows-only (skipped here)
222+
# test_integration_*.py Linux-only, full-pipeline/DB-backed
223+
# This job runs on ubuntu-24.04. A sibling Windows job would
224+
# do the inverse (skip test_linux_*/test_integration_*).
217225
modules=()
218226
for f in "$GITHUB_WORKSPACE"/addons-source/"$addon"/tests/test_*.py; do
219227
[ -f "$f" ] || continue
228+
case "$(basename "$f")" in
229+
test_windows_*) continue ;;
230+
esac
220231
rel="${f#$GITHUB_WORKSPACE/addons-source/}"
221232
mod="${rel%.py}"
222233
mod="${mod//\//.}"

CLAUDE.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,17 @@ If `../addons-source/AGENTS.md` exists, it applies inside that repo:
3535
class under dotted-path loading.
3636
- Platform-specific scripts live under ./scripts/<platform>/; today only
3737
scripts/ubuntu/ exists (Fedora/Arch/macOS/Windows equivalents are planned)
38+
- Addon test filename convention (mirrors addons-source/.github/workflows/ci.yml):
39+
- `test_*.py` — general, runs on every platform
40+
- `test_linux_*.py` — Linux-only
41+
- `test_windows_*.py` — Windows-only
42+
- `test_integration_*.py` — Linux-only, full-pipeline/DB-backed
43+
Each platform's `run-addon-unit.sh` (and the corresponding CI job) filters
44+
out the prefixes that don't match its OS. The Ubuntu runner skips
45+
`test_windows_*` and runs everything else; a future `scripts/windows/`
46+
runner would do the inverse. Until a Windows image/runner exists in the
47+
testbed, `test_windows_*.py` runs nowhere here — Windows coverage lives
48+
in addons-source's own Windows CI job.
3849
- Docker image: gramps-testbed:ubuntu-<gramps-version> (e.g. gramps-testbed:ubuntu-6.0.8),
3950
built from docker/Dockerfile.ubuntu; version is auto-read from gramps/version.py
4051
by the wrapper scripts so different Gramps versions get different tags

scripts/ubuntu/run-addon-unit.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,20 @@ PY
158158
# surfaces package-shadowing bugs like bug 0012691, where
159159
# "from <Addon> import <Addon>" binds the submodule instead of the
160160
# class. Discover-from-tests/ hides the trap.
161+
# Filename convention (mirrors addons-source/.github/workflows/ci.yml):
162+
# test_*.py general — every platform
163+
# test_linux_*.py Linux-only
164+
# test_windows_*.py Windows-only (skipped here)
165+
# test_integration_*.py Linux-only, full-pipeline/DB-backed
166+
# This is the Ubuntu runner, so test_windows_* is excluded. When
167+
# scripts/windows/run-addon-unit.sh is added it will do the inverse
168+
# (skip test_linux_*/test_integration_*).
161169
modules=()
162170
for f in /workspace/addons-source/"$addon"/tests/test_*.py; do
163171
[ -f "$f" ] || continue
172+
case "$(basename "$f")" in
173+
test_windows_*) continue ;;
174+
esac
164175
rel="${f#/workspace/addons-source/}"
165176
mod="${rel%.py}"
166177
mod="${mod//\//.}"

0 commit comments

Comments
 (0)