CI: cherry-pick shell:bash + OS-split test filename convention from PR 820#12
Merged
eduralph merged 2 commits intomaintenance/gramps60from May 6, 2026
Merged
Conversation
Root cause of "Unit Tests (Linux)" and "Integration Tests (Gramps)"
failures was not broken test modules — the steps never invoked
unittest. The container's default shell is /bin/sh (dash on
python:3.12-slim), and the inline scripts use bash-only parameter
expansions (${f%.py}, ${mod//\//.}) to build the dotted module list.
Dash fails with "Bad substitution" on the first such line; the rest
of the script never runs. continue-on-error: true masked this as a
generic job failure for two CI rounds.
Add "shell: bash" explicitly to:
- unit-test-linux / Run per-addon unit tests (bashisms)
- integration-test / Run per-addon integration tests (bashisms)
- integration-test / Run plugin registration tests (no bashisms today,
but consistent and future-proof)
Compile Check already sets shell: bash. Windows jobs inherit bash
via defaults.run at the job level. No other steps affected.
The Windows unit-test job hung on TMGimporter's DB-backed tests because
make_database("sqlite").load(":memory:", None) deadlocks under the
conda-forge GTK + pip Gramps combination. Rather than patch the hang,
introduce a filename convention so per-addon authors can declare OS
scope up front:
test_*.py general (every OS)
test_linux_*.py Linux-only
test_windows_*.py Windows-only
test_integration_*.py Linux-only, full-pipeline/DB-backed (pre-existing)
unit-test-linux skips test_windows_* and test_integration_*;
unit-test-windows skips test_linux_* and test_integration_*.
Applied to TMGimporter: the 13 DB-backed classes in tests/test_libtmg.py
move to tests/test_linux_libtmg.py (along with the _Rec/_table/_make_db/
_add_person/_MockUser helpers they use). The 7 pure-logic classes
(TestStripTmgCodes, TestTmgDateToGrampsDate, TestNumTo{Month,Date},
TestParseDate, TestRepoTypeFromName, TestUrlFromName) stay in
test_libtmg.py and will run on every OS.
Locally all 175 tests still pass via run-addon-unit.sh TMGimporter.
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.
Summary
Cherry-picks two companion CI fixes from
feature/ci-cd-pipeline-upstream(= upstream PR 820) onto fork'smaintenance/gramps60, so the fork-internal CI stops failing/hanging while we wait for 820 to land upstream:28febdcd—shell: bashonunit-test-linux+integration-teststeps715e71dd— OS-split addon test filename convention (test_linux_*/test_windows_*/test_integration_*) + applying the convention to TMGimporterBackground
Issue 1:
Bad substitutionon Unit Tests (Linux) and Integration TestsThe container default shell on
python:3.12-slimis/bin/sh(dash). The current workflow steps use bash-only parameter expansions:Dash fails on the second line with
Bad substitution, the script aborts, andunittestis never invoked. Visible in the April 19 maintenance/gramps60 run:28febdcdaddsshell: bashto the affected steps. Compile Check already sets it; Windows jobs inherit bash via job-leveldefaults.run.Issue 2: Unit Tests (Windows) hangs for 6 hours
Visible in the same April 19 run:
Unit Tests (Windows) in 6h5m1s— GitHub's job timeout. Cause: TMGimporter'stests/test_libtmg.pycallsmake_database("sqlite").load(":memory:", None), which deadlocks under conda-forge GTK + pip Gramps on Windows.715e71ddintroduces a filename convention (mirroring the existingtest_integration_*convention) and applies it to TMGimporter:test_*.pytest_linux_*.pytest_windows_*.pytest_integration_*.pyFor TMGimporter:
tests/test_libtmg.py— run on every OS._Rec/_table/_make_db/_add_person/_MockUserhelpers they use) move totests/test_linux_libtmg.py— Linux only, no behavioural change.Why fork-only
Both fixes are already in upstream PR 820 (commits
28febdcdand715e71ddonfeature/ci-cd-pipeline-upstream). When 820 merges and the fork resyncs, this cherry-pick becomes a no-op merge. No upstream PR is needed.This PR exists only to clear the immediate red/hung CI on
eduralph/addons-source maintenance/gramps60until upstream catches up.Verification
yaml.safe_loadparses the resulting workflow (7 jobs).${var//pat/repl}sites verified under bash (two via step-levelshell: bash, one via Windows-job-leveldefaults.run.shell: bash -el {0}).test_windows_*+test_integration_*; Windows job skipstest_linux_*+test_integration_*.Bad substitutionfailure under dash and confirmed bash succeeds on the same expansion.Same total count as before the OS split (the 13 DB-backed classes now load via the dotted path
TMGimporter.tests.test_linux_libtmg.*instead of…test_libtmg.*, with no test cases lost or added).Remaining red on fork's maintenance/gramps60 after this lands
Out of scope for this PR (separate follow-ups; all
continue-on-error: trueso non-blocking):po/template.pot→ waiting on agramps60backport of upstream #831.tests/test_filetable.pybare-import bug → addressed by #11 / upstream #833.🤖 Generated with Claude Code