TMGimporter: skip real-DB import tests on Windows#930
Merged
GaryGriffin merged 1 commit intoJun 3, 2026
Merged
Conversation
The import tests drive a real in-memory Gramps database (make_database + db.load) through the shared _make_db() helper. On the Windows CI lane the only available Gramps is from conda-forge, which has no 6.1 yet, and Gramps 6.1 does not build in the conda env (its Windows build targets MSYS2 UCRT64, not conda). Run against that mismatched Gramps the real-DB import path hangs. Raise unittest.SkipTest from _make_db() on win32 so all 13 DB-backed test classes skip in one place; the pure-function tests (code stripping, date conversion, name parsing) do not call _make_db() and continue to run on Windows. On Linux every test runs unchanged (157 pass). Verified the Windows path with sys.platform forced to win32: 95 tests skip, 62 run and pass, the module is not all-skipped. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
Author
|
I will have to see how to address this issue once the CI process has landed. |
Member
|
Is there a MacOS lane for CI? |
Contributor
Author
|
@GaryGriffin - I looked into that and didn't bother so far because we can't build a ui test and there's a heavy overlap with linux on the unit test level. I can add if you like - gramps does have one for mac specfic tests |
Member
|
I think I'd need to build an installation tarball of the dependencies. It would take forever to build everything from scratch and I don't know if Homebrew has everything we need. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Root cause
The import tests in
TMGimporter/tests/test_libtmg.pydrive a real in-memoryGramps database (
make_database+db.load) through the shared_make_db()helper. On Windows the only Gramps available to CI comes from conda-forge, which
has no 6.1 yet and where Gramps 6.1 does not build (its Windows build targets
MSYS2 UCRT64, not conda); run against that mismatched Gramps the real-DB import
path hangs. The Windows CI lane that surfaces this is the one introduced by
#820.
Fix
Raise
unittest.SkipTestfrom_make_db()whensys.platform == "win32". Everyreal-DB test obtains its database through this single helper (all 43 db
creations route through it), so the 13 DB-backed classes skip in one place. The
pure-function tests (code stripping, date conversion, name parsing) do not call
_make_db()and continue to run on Windows.Verified against
TMGimporter/tests/test_libtmg.py—_make_db()is the solemake_databasecall site; confirmed every DB-backed class reaches the database only through
it, so one guard covers them all.
sys.platformforced towin32): 95 tests skip, 62 runand pass, and the module is not all-skipped (the pure-function classes keep
running), so a skip-detecting runner does not mistake it for an empty module.
Test
This change is itself in the test suite. Pre-change, the Windows lane added by
#820 hangs in
import_*against the mismatched Gramps; post-change it skips thereal-DB tests cleanly. Validated on that lane (gramps61): the module reports
157 tests, 95 skipped, 0 brokein ~5 min (previously an indefinite hang), withthe Linux run unaffected. The skip self-heals once Gramps 6.1 reaches conda-forge
and the Windows lane runs the matching Gramps.