Repository navigation
Test scripts/ and check every pull request - #26
Merged
Merged
Conversation
Add tests/test_scripts.py for update_history.update, check_scan.problems and build_lookup.build (small JSON in a temp dir, no network), a pytest config that puts the repo root on sys.path, and a Check workflow that runs the tests and node --check site/app.js on pull requests and pushes to main. Closes wheelgap#16 Signed-off-by: sarankumar1325 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…rors count Co-Authored-By: Claude Opus 5.5 <[email protected]>
Contributor
|
Merged, thanks @sarankumar1325! The tracker now checks every pull request. The independent review compared each assertion with the scripts and found none wrong or tautological. The workflow can't hand secrets to fork PRs: it triggers on I pushed three small changes:
The check passed on this PR: 26 tests on Python 3.14.4. If you'd like another one, #27 (knowledge base v0: the (Review assisted by Claude.) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #16.
Tests (
tests/test_scripts.py, unittest style liketest_most_wanted.py, small JSON written to a temp dir, no network, never the realdata/coverage.json):update_history.update: a new day is appended, a missing history file starts one, the same day is replaced, entries stay sorted by date.check_scan.problems: a good scan has no problems. Each of these is reported: too few packages, a missing summary label, no targets at all, aresultslist of the wrong length, a package missing fields, the wrong schema, too many lookup errors, and a >10% drop in wheels. A drop of exactly 10% passes, andALLOW_DROPskips the drop check.build_lookup.build: one file per package under its normalised name, with the fields the README's "API for scripts and agents" section lists (and no others), plus thepackages.jsonindex. Unsafe and duplicate names are skipped, and a wrong scan schema stops the build.Check workflow (
.github/workflows/check.yml): runs onpull_requestand onpushtomain, withcontents: readonly and no stored credentials. Steps:uvx --python 3.13 pytest, thennode --check site/app.js. The actions are pinned to the same commits asscan.yml.pytest config: a
pyproject.tomlwith only[tool.pytest.ini_options](pythonpath = ["."],testpaths = ["tests"]), so a barepytest/uvx pytestcan importscripts, as suggested in the issue comment.README: one line under Contributing on how to run the tests.
Checked locally:
uvx pytestgives 25 passed (the new tests plus the existing CSV and most-wanted tests), andpython -m unittest discover -s testsalso passes.node --check site/app.jsandruff check testsare clean, and the workflow YAML andpyproject.tomlparse.I used an AI assistant for this change and reviewed the code and tests myself.