mirror of
https://github.com/kuhyx/screen-locker.git
synced 2026-11-11 00:27:11 +01:00
The lock-popup-safety job failed on its first CI run for two reasons, and only one of them was the obvious one. The obvious one: the script imports screen_locker directly rather than through pytest, which would have put the rootdir on sys.path for it. CI now installs the package. The one worth having found: CI installs gatelock from the pinned tag, which predated `holds_grab`, so every hostile tick died on an AttributeError -- inside a Tk `after` callback, where exceptions are swallowed and logged rather than raised. The harness sailed past, printed OK and exited 0 while doing no grab re-assertion whatsoever. A verification script that passes when it is broken is worse than not having it. So it now fails closed twice over: an explicit check that the installed gatelock has the predicate at all, with a message naming the fix, and a count of ticks that actually completed -- incremented after the work, so a raising tick does not count. Fewer completed ticks than asked for is reported as "the harness itself is broken, so this result proves nothing", not as a pass. The pin moves to gatelock-v0.2.1, which carries both of yesterday's fixes: the grab predicate that no longer steals the grab off our own posted menus, and the recovery loop that no longer stops forever when a tick raises. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
54 lines
1.5 KiB
YAML
54 lines
1.5 KiB
YAML
name: Tests
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
python-version: ["3.10", "3.11", "3.12"]
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
- name: Install dependencies
|
|
run: pip install -r requirements.txt
|
|
|
|
- name: Run tests with coverage
|
|
run: python -m pytest -v
|
|
|
|
# The pytest suite replaces the whole `tk` module so it can never reach a
|
|
# display, which means the lock-screen widget behaviour it guards cannot be
|
|
# asserted there. This job runs the real-Tk half against a throwaway X
|
|
# server. See scripts/verify_lock_popup_safety.py.
|
|
lock-popup-safety:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-python@v5
|
|
with:
|
|
python-version: "3.12"
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y xvfb python3-tk
|
|
pip install -r requirements.txt
|
|
# The script imports screen_locker directly rather than through
|
|
# pytest, which would put the rootdir on sys.path for it.
|
|
pip install -e . --no-deps
|
|
|
|
- name: Sport selector survives gatelock's recovery tick
|
|
run: python3 scripts/verify_lock_popup_safety.py
|