Skip to content

Consolidate CI images and fix Windows + integration tests - #2

Merged
eduralph merged 1 commit into
maintenance/gramps60from
feature/ci-cd-pipeline
Apr 17, 2026
Merged

Consolidate CI images and fix Windows + integration tests#2
eduralph merged 1 commit into
maintenance/gramps60from
feature/ci-cd-pipeline

Conversation

@eduralph

Copy link
Copy Markdown
Owner

Summary

  • Merges the gramps-headless and gramps-gtk images into a single gramps-ci image. GTK typelibs live in the base (so addon modules that do from gi.repository import Gtk at module load are importable); xvfb/xauth are bundled for tests that actually render widgets.
  • Windows unit tests switch from pip install gramps (which can't pull PyGObject on Windows without a bundled GTK runtime) to conda-incubator/setup-miniconda + mamba install pygobject gtk3 gramps from conda-forge.
  • Integration-test container gets options: --init so xvfb-run doesn't hang waiting for Xvfb's SIGUSR1 ready signal when it runs as PID 1.
  • Narrows unit-test discovery to */tests/ only (drops DynamicWeb's nose-based root-level test that violates the convention) and explicitly ignores Sqlite/tests/test_sqlite.py, which reads GRAMPS_RESOURCES at module import time.
  • Adds debug.log to .gitignore to prevent future accidental commits.

Verification (local)

  • Unified image builds cleanly in ~19s
  • 185 per-addon unit tests pass in 0.83s in the new image
  • 6 integration tests pass in 85.78s with --init

Test plan

  • Build Docker Images workflow rebuilds gramps-ci after merge
  • CI on the next push uses the new image (all jobs pull ghcr.io/eduralph/addons-source/gramps-ci:gramps60)
  • Unit Tests (Linux) — 185 tests pass
  • Unit Tests (Windows) — conda-forge install succeeds, tests run
  • Integration Tests (Gramps) — 6 tests pass (no more xvfb-run hang)
  • Old gramps-headless / gramps-gtk packages on GHCR can be deleted manually

🤖 Generated with Claude Code

- Merge gramps-headless and gramps-gtk into one gramps-ci image.
  GTK typelibs live in the base so addon modules that do
  `from gi.repository import Gtk` at load time are importable;
  xvfb/xauth are bundled for tests that actually render.
- Windows unit tests switch to conda-incubator/setup-miniconda and
  install pygobject, gtk3, and gramps from conda-forge. Pip alone
  can't install PyGObject on Windows without a bundled GTK runtime.
- Integration-test container gets `options: --init` so xvfb-run
  doesn't hang waiting for SIGUSR1 when it runs as PID 1.
- Narrow unit-test discovery to `*/tests/` only (drops DynamicWeb's
  nose-based root-level test that violates the convention) and
  explicitly ignore Sqlite/tests/test_sqlite.py which reads
  GRAMPS_RESOURCES at module import.
- Add debug.log to .gitignore to prevent accidental re-commits.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@eduralph
eduralph merged commit b29463a into maintenance/gramps60 Apr 17, 2026
1 of 7 checks passed
eduralph added a commit that referenced this pull request Jul 9, 2026
Addresses a second-pass adversarial review whose theme was that advisory
buckets can hide real defects, plus a clearer failure message.

Failure message (test_load_all_addon_modules): on failure, lead with only the
real load failures (each with its error), then one plain-language line per
advisory category explaining the cause and the fix. The full advisory lists
stay in the warning log instead of burying the actionable failures under a
wall of text.

#1 Environment classifier is now specific and anchored. Dropped the over-broad
signatures ("DISPLAY", bare "load_icon") that could match a genuine addon
exception; kept anchored ones ("Gtk couldn't be initialized",
"gtk-icon-theme-error-quark", the NoneType-load_icon phrase, missing-namespace)
and only match them on a real error line, not an indented traceback frame or
echoed source. Added TestEnvLoadClassifier with positive and negative cases.

#2 A real import hang no longer passes as advisory. The isolated-load
subprocess prints REGISTRY_READY after registration; on timeout, if the marker
was emitted the addon's own import hung -> hard failure, otherwise the registry
scan was slow -> advisory. (subprocess.TimeoutExpired captures partial stdout,
so this needs no signals and works cross-platform.)

#4 Opt-in strict mode for the depends_on load test. Environmentally
inconclusive dependents stay advisory by default (headless local runs
legitimately can't import GUI addons); setting GRAMPS_ADDON_TEST_STRICT=1 in a
CI job with a full runtime promotes any unverified dependent to a failure.

The i18n finding was again out of scope: test_i18n_extraction.py is
pre-existing on maintenance/gramps60, not part of this PR.

Verified against Gramps 6.0.8: classifier unit tests pass, the headless load
test still passes with ClipboardGramplet kept advisory, hang-vs-slow-scan and
strict-mode gating behave as intended.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant