Skip to content

TMGimporter: port the libtmg OS-test split (PR #949) to maintenance/gramps61 #48

@eduralph

Description

@eduralph

Summary

Upstream addons-source PR 949 split TMGimporter/tests/test_libtmg.py into
pure-function tests (test_libtmg.py, every OS) and DB-backed tests
(test_linux_libtmg.py, Linux-only via the test_linux_* filename convention)
and merged to maintenance/gramps60. The maintainer's cherry-pick forward
to maintenance/gramps61 failed, and he asked for a separate gramps61 PR:

Cherry picking this to gramps61 failed. Need a new PR for the changes for gramps61.
@GaryGriffin

Why the cherry-pick fails

maintenance/gramps61's test_libtmg.py has independently diverged from
the gramps60 version that split was cut against. gramps61 added, in exactly the
regions the split rewrites:

  1. an inline gi.require_version("Gtk"/"Gdk", "3.0") + SkipTest block at the top, and
  2. a sys.platform == "win32" skip inside the shared _make_db() helper.

The patch's context lines (the old _make_db body, import tempfile) no longer
match, so git cannot replay it.

Target state — converge gramps61 onto gramps60's post-split structure

Make TMGimporter/tests/ on maintenance/gramps61 identical to
maintenance/gramps60
after the split:

  • test_libtmg.py → pure-function tests only (gramps60 blob 4851746a).
  • test_linux_libtmg.py → DB-backed tests + helpers (gramps60 blob 35bd117).
  • tests/__init__.py stays empty (already matches gramps60).

This drops the two gramps61-only stopgaps:

  • inline GTK pin — GTK-version pinning is not an individual test file's
    job. It is owned by the central repo-root tests/__init__.py (the central
    repo-root pin, present on both branches), by Gramps' own GUI launcher, and —
    for per-addon invocation — by the planned per-addon tests/__init__.py
    migration (Move inline gi.require_version pins into each addon's tests/__init__.py #38). Under the testbed harness the GI versions are also pinned by
    the gi_bootstrap sitecustomize. gramps60's merged files carry no inline pin.
  • win32 skip in _make_db() — superseded by the file split: the DB tests
    now live in test_linux_*, which the Windows lane excludes, so the runtime
    skip is redundant. gramps60's merged test_linux_libtmg.py carries no
    win32 skip and is green on the maintainer's CI.

Out of scope

Verification

  • The gramps60 split is merged and green on the maintainer's CI (he is asking to
    port it, not revert) — proving the test_linux_* Windows-exclusion works and
    that dropping both stopgaps is the production-correct shape.
  • Testbed Linux runner (engine/scripts/ubuntu/run-addon-unit.sh) runs
    test_linux_* on Linux (excludes only test_windows_*), so the DB tests run
    against the matching gramps 6.1.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions