ci: run python unit tests on push and PR - #15
Merged
Conversation
No test runner existed in CI (only GitGuardian secret scanning), so tests/test_analysis_cache.py ran only when invoked by hand. Add a GitHub Actions job that runs 'unittest discover' on tests/test_*.py. serve.py and the tests are stdlib-only, so no dependency install step. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds automated Python unit test execution via GitHub Actions so changes to the Python server and related logic are continuously validated on pushes to main and on pull requests.
Changes:
- Introduces a new GitHub Actions workflow to run
unittestdiscovery againsttests/test_*.py. - Sets up a Python runtime on
ubuntu-latestand executes the test suite without any dependency install step.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+9
to
+16
| python: | ||
| name: python unit tests | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: "3.13" |
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.
Adds a GitHub Actions workflow (
.github/workflows/test.yml) that runs the Python unit tests on every push tomainand on every PR.python -m unittest discover -s tests -p "test_*.py", so any futuretests/test_*.pyis picked up automatically (not just the currenttest_analysis_cache.py).serve.pyand the tests are stdlib-only, so there's no dependency install step — checkout, set up Python 3.13, run.Closes the gap from #14: the negative-cache gate logic is now guarded automatically instead of only on manual invocation.
Verified locally — the exact CI command passes:
🤖 Generated with Claude Code