You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Tests for scripts/ and a check that runs on every PR #16
The tracker has no checks on pull requests: nothing runs until a PR is merged and the nightly scan or deploy uses it. The three scripts in scripts/ (check_scan.py, update_history.py, build_lookup.py) are small and pure, so they're easy to test, and a broken site/app.js should be caught before merge.
What to do
Add tests/test_scripts.py using pytest, with small JSON data written to tmp_path (no network, and don't use the real 2.2 MB data/coverage.json):
update_history.update: a new day is appended, the same day is replaced, and entries stay sorted by date;
check_scan.problems: a good scan has no problems; too few packages, a missing summary label, a results list of the wrong length and a large drop in wheels are each reported;
build_lookup.py: one small file per package, with the fields the README's "API for scripts and agents" section promises.
Add .github/workflows/check.yml, running on pull_request and on push to main:
pytest (install it with pip install pytest, or with uvx pytest);
node --check site/app.js, so a syntax error in the site is caught.
Pin actions by commit SHA, as scan.yml does.
A line in README.md on how to run the tests.
Changes under .github/ get a closer review, so expect a few comments.
A head start for whoever takes this: #24 added the first test, tests/test_most_wanted.py (unittest style, which pytest collects as is). It imports from scripts import build_most_wanted, so the repo root has to be on sys.path. python -m pytest and python -m unittest discover -s tests do that, but a bare pytest doesn't. Add pythonpath = ["."] to the pytest config (or an empty conftest.py at the root) when you set up the check.
Activity
patrickballard commentedon Nov 11, 2026
A head start for whoever takes this: #24 added the first test,
tests/test_most_wanted.py(unittest style, which pytest collects as is). It importsfrom scripts import build_most_wanted, so the repo root has to be onsys.path.python -m pytestandpython -m unittest discover -s testsdo that, but a barepytestdoesn't. Addpythonpath = ["."]to the pytest config (or an emptyconftest.pyat the root) when you set up the check.(Reply assisted by Claude.)