fedora-happiness-packets/happinesspackets
Justin Wheeler 51d6014997
All checks were successful
CI / lint (pull_request) Successful in 22s
CI / test (pull_request) Successful in 50s
CI / lint (push) Successful in 16s
CI / test (push) Successful in 40s
💚 ci: Switch test suite to SQLite, remove service container deps
The Forgejo Actions CI `test` job has never passed — all 24 runs show
failure. Two root causes: the Forgejo `podman` runner's service
container networking doesn't reliably expose the PostgreSQL hostname,
and the CI pipeline doesn't provision RabbitMQ, causing
`fedora_messaging.api.publish()` to raise `ConnectionException`.

Since the codebase uses zero PostgreSQL-specific features, the test
database backend can safely be switched to SQLite in-memory. This
eliminates all external service dependencies for tests.

Changes to test infrastructure:
- Override `DATABASES` in `tsting.py` to use SQLite in-memory
- Add Celery memory broker settings to prevent Redis connections
- Add `CRISPY_ALLOWED_TEMPLATE_PACKS` for `bootstrap5` compatibility
- Set dummy `ADMIN_USERNAME`/`ADMIN_PASSWORD` for FAS `AccountSystem`
- Create `conftest.py` with autouse fixtures to mock `publish()`,
  `AccountSystem.people_query()`, and provide a stub `STATIC_ROOT`

Changes to CI pipeline:
- Remove `postgres:15` and `redis:7` service containers
- Remove `gcc`/`libpq-dev` system dependency step

Bug fixes surfaced by the new test environment:
- Replace stale `import ckeditor.fields` in migration 0007 with
  `models.TextField` (old `django-ckeditor` removed in Phase 5)
- Pass `link_rel=None` to `nh3.clean()` to fix `ValueError` when `'rel'`
  is in `allowed_attributes` (nh3 >= 0.2.18 API change)

Closes #281.

Assisted-by: Claude Opus 4.6 (1M context)
Signed-off-by: Justin Wheeler <jwheel@fedoraproject.org>
2026-06-20 18:34:22 -04:00
..
messaging 💚 ci: Switch test suite to SQLite, remove service container deps 2026-06-20 18:34:22 -04:00
settings 💚 ci: Switch test suite to SQLite, remove service container deps 2026-06-20 18:34:22 -04:00
utils 🔥 messaging/utils: Remove dead code and Python 2 compatibility 2026-03-28 23:54:10 -04:00
__init__.py 🔥 messaging/utils: Remove dead code and Python 2 compatibility 2026-03-28 23:54:10 -04:00
_celery.py 🔥 messaging/utils: Remove dead code and Python 2 compatibility 2026-03-28 23:54:10 -04:00
tasks.py 💚 ci: Fix lint and test job failures 2026-05-10 16:58:30 +02:00
urls.py ⬆️ frontend: Migrate CKEditor 4 → CKEditor 5 2026-05-10 12:47:01 -04:00
wsgi.py Port code from Github to Pagure 2018-03-21 12:45:07 -05:00