ci: run the test suite on pull requests and pushes to main - #45
Merged
Conversation
tests/ exists and passes, but none of the four workflows referenced pytest, unittest or tests/ — so the suite had never been executed by CI. Two changes to production-behaviour scripts were merged with tests attached that nothing ran. Adds .github/workflows/tests.yml running `pytest tests/` on pull_request and on push to main, with contents: read and both actions pinned to the same SHAs the sibling workflows use. Dependencies come from a new requirements/tests.txt, hash-pinned and wheels-only. beautifulsoup4 is not optional there: tests/test_check_stars.py imports scripts/check-stars.py at module scope, so in a venv without it pytest fails during collection rather than in one test. Signed-off-by: Sebastian Mendel <github@sebastianmendel.de>
|
Contributor
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.OpenSSF ScorecardScorecard details
Scanned Files
|
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.



tests/exists and passes, but none of the four workflows referenced pytest, unittest ortests/— so the suite had never been executed by CI. Two changes to production-behaviour scripts were merged with tests attached that nothing ran.This adds
.github/workflows/tests.yml, runningpytest tests/on every pull request and on pushes tomain, withcontents: readand both actions pinned to the same SHAs the sibling workflows already use.Dependencies come from a new
requirements/tests.txt, hash-pinned and wheels-only.beautifulsoup4is not optional there:tests/test_check_stars.pyimportsscripts/check-stars.pyat module scope, so in a venv without it pytest fails during collection rather than in a single test — verified,ModuleNotFoundError: No module named 'bs4'atscripts/check-stars.py:11,Interrupted: 1 error during collection.Verification
Run locally in a clean venv, with the same two commands the workflow issues:
actionlint .github/workflows/tests.ymlexits 0.Notes
No
ruff formatwas run and no ruff config was added — at ruff's 88-column default it would reformat every existing file, and this PR adds no Python.persist-credentials: falseis not set on the checkout, because no sibling workflow in this repo sets it; adding it here alone would be the first instance of a convention rather than an application of one. Worth doing across all five workflows in a separate change if wanted.This does not depend on #44 and shares no file with it. #44 adds
requirements/scheduled-failures.txt; this addsrequirements/tests.txt. In whichever order they land, the workflow here picks up the test files #44 brings with it.