Add a CI job running pytest and a minimal lint gate #39

Merged
mysticalsoap merged 3 commits from add/ci into trunk 2026-08-18 12:36:19 -04:00
Owner

Problem

Second half of #25: nothing runs the test suite or any lint automatically -- the escape-sequence regexes (#30) and the conf.ROOTDIR typo both shipped because nothing was watching.

Along the way: tests/test_scripts_button.py landed from a branch cut before the pytest conversion and still runs its checks at import time, which breaks collection for the whole suite.

Closes #25.

Fix

  • Adds .forgejo/workflows/ci.yml: every push to trunk and every PR runs, in an archlinux job container (the target platform -- deps mirror the PKGBUILD), ruff check --select E9,F63,F7,F82, compileall with SyntaxWarning promoted to error, and pytest. Installing openvpn in the container means the two real-parser tests run in CI instead of skipping.
  • Folds the four scripts-button checks into tests/test_aqomui_gui.py per the CONTRIBUTING layout rule and drops the script.
  • Fixes the import tests to run from a bare checkout: country_translate reads countries.json from the installed data dir, so they only passed on a machine with the package installed. CI's clean container caught this on its first run; the fixture now points ROOTDIR at the checkout's resources/ copy.

The lint selection is deliberately the always-a-real-bug class only; the fuller pyflakes set currently has ~70 pre-existing findings, so widening the gate means fixing those first.

Verification

All three gates pass locally (27 tests), in a clean archlinux container replicating the job environment, and in CI itself: run 19 on this branch is green on the new aqomui-ci runner. First runs surfaced two real infrastructure/test bugs (job containers couldn't reach the forge through rootless podman's pasta networking -- fixed and documented in the docker repo -- and the installed-data-dir dependency above), so the pipeline has already caught things.

## Problem Second half of #25: nothing runs the test suite or any lint automatically -- the escape-sequence regexes (#30) and the `conf.ROOTDIR` typo both shipped because nothing was watching. Along the way: `tests/test_scripts_button.py` landed from a branch cut before the pytest conversion and still runs its checks at import time, which breaks collection for the whole suite. Closes #25. ## Fix - Adds `.forgejo/workflows/ci.yml`: every push to trunk and every PR runs, in an `archlinux` job container (the target platform -- deps mirror the PKGBUILD), `ruff check --select E9,F63,F7,F82`, `compileall` with SyntaxWarning promoted to error, and `pytest`. Installing `openvpn` in the container means the two real-parser tests run in CI instead of skipping. - Folds the four scripts-button checks into `tests/test_aqomui_gui.py` per the CONTRIBUTING layout rule and drops the script. - Fixes the import tests to run from a bare checkout: `country_translate` reads `countries.json` from the installed data dir, so they only passed on a machine with the package installed. CI's clean container caught this on its first run; the fixture now points `ROOTDIR` at the checkout's `resources/` copy. The lint selection is deliberately the always-a-real-bug class only; the fuller pyflakes set currently has ~70 pre-existing findings, so widening the gate means fixing those first. ## Verification All three gates pass locally (27 tests), in a clean `archlinux` container replicating the job environment, and in CI itself: run 19 on this branch is green on the new `aqomui-ci` runner. First runs surfaced two real infrastructure/test bugs (job containers couldn't reach the forge through rootless podman's pasta networking -- fixed and documented in the docker repo -- and the installed-data-dir dependency above), so the pipeline has already caught things.
The file predates the pytest conversion (it landed from a branch cut
before it) and still runs its checks at import time, which would break
pytest collection. Same four cases, now in the module-named file.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
add: a CI job running pytest and a minimal lint gate
Some checks failed
ci / test (pull_request) Failing after 1m19s
eaca712f79
The lint selection is deliberately narrow: E9/F63/F7/F82 are the
undefined-name/syntax-error class that is always a real bug, and the
current tree passes it. The fuller pyflakes set has ~70 pre-existing
findings; widening the gate means fixing those first, not loosening it.

compileall with SyntaxWarning as error is what would have caught the
escape-sequence regexes before they shipped.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
mysticalsoap force-pushed add/ci from eaca712f79
Some checks failed
ci / test (pull_request) Failing after 1m19s
to 7981b9dcce
Some checks failed
ci / test (pull_request) Failing after 30s
2026-08-17 22:40:18 -04:00
Compare
mysticalsoap force-pushed add/ci from 7981b9dcce
Some checks failed
ci / test (pull_request) Failing after 30s
to efa350aadc
All checks were successful
ci / test (pull_request) Successful in 32s
ci / test (push) Successful in 52s
2026-08-17 22:46:39 -04:00
Compare
Sign in to join this conversation.
No description provided.