ci: gate qualified offline Python and Node tests separately

This commit is contained in:
martino
2026-09-23 18:46:47 +02:00
parent 4f79144c5a
commit 4b24ab9681
5 changed files with 280 additions and 0 deletions
+36
View File
@@ -860,6 +860,42 @@ provisions Python and Node and runs this same command on relevant pull requests
and main/develop pushes (or manually). It is separate from the translation
publication workflow and has read-only repository permissions.
#### Qualified offline `tests/` CI lanes
`.github/workflows/test-offline-qualified.yml` runs **only** the explicitly listed
seven Python files and ten Node files in `.github/scripts/run_offline_qualified.py`.
Run the same allowlist locally from the root of a clean, disposable checkout
with no `AppImage/node_modules`. Do not run this over a normal Monitor install:
the commands refuse an existing directory, file, or symlink (including a
dangling symlink) rather than overwrite or reuse it. In Bash:
```bash
(
set -e
if [[ -e AppImage/node_modules || -L AppImage/node_modules ]]; then
printf '%s\n' 'Refusing: AppImage/node_modules already exists; use a clean disposable checkout (nothing overwritten).' >&2
exit 1
fi
npm ci --prefix .github/ci/offline-node --legacy-peer-deps --ignore-scripts --no-audit --no-fund
ln -s ../.github/ci/offline-node/node_modules AppImage/node_modules
python3 -I -B .github/scripts/run_offline_qualified.py --lane python
NODE_PATH="$PWD/AppImage/node_modules" python3 -I -B .github/scripts/run_offline_qualified.py --lane node
)
```
Requires Python 3.11, Node 22.14, npm and Bash/coreutils for the bounded shell
fixtures. The separate lockfile installs only TypeScript, React, React DOM,
Lucide icons and the locked scheduler dependency; it does not build the Monitor
or run npm lifecycle scripts. `--legacy-peer-deps` admits the existing Lucide
React peer constraint against locked React 19; it does not resolve that mismatch. The runner fails on missing files, zero discovered Python
tests, skipped Python tests, or a nonzero exit from either lane. Node fixtures
use top-level assertions, not a runner that reports case/skip totals.
These are local fixture tests, not the whole `tests/` tree, `AppImage/tests/`,
`AppImage/scripts/tests/`, browser smoke, a live Proxmox host, or an AppImage
build. The CI workflow has read-only permissions and runs on relevant PRs and
main/develop pushes, or manually. Review the input paths and the test's imports
before extending the explicit manifest.
#### Monitor checks
- **Python tests** — under `AppImage/scripts/tests/`. Run with `python3 -m unittest discover -s AppImage/scripts/tests`. Add a test file when you add non-trivial backend logic (auth, notifications, background checks).