Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Backend tests

on:
push:
branches: [main]
pull_request:
workflow_dispatch:

permissions:
contents: read

concurrency:
group: backend-tests-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
tests:
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
python: ['3.11', '3.13']

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Exercise the minimum supported Python version

The package declares requires-python = ">=3.10" and advertises Python 3.10 support in pyproject.toml, but both matrix entries are newer. Changes using 3.11-only APIs can therefore remain green while breaking supported 3.10 users; in fact, tests/test_auth_session_recovery.py currently imports datetime.UTC, which is unavailable in 3.10. Include Python 3.10 as the minimum-version job, fixing incompatible tests as needed.

Useful? React with 👍 / 👎.

steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
with:
persist-credentials: false
- uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6
with:
python-version: ${{ matrix.python }}
cache: pip
cache-dependency-path: |
requirements.txt
requirements-test.txt
- name: Install test dependencies
run: python -m pip install -r requirements-test.txt
- name: Run offline regression suite
run: python -m pytest tests -q
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -302,3 +302,12 @@ surface and method documentation.
## License

This project is released under the [MIT License](LICENSE).

## Automated regression checks

Install `requirements-test.txt` in a virtual environment, then run
`python -m pytest tests -q` from the repository root. This runs the mocked
regression suite without SPH credentials; the optional live timetable fixture
test is skipped unless explicitly configured. GitHub Actions runs the suite on
Python 3.11 and 3.13 for pull requests and pushes to main, caches pip downloads,
and cancels superseded runs. This workflow does not deploy the backend.
3 changes: 3 additions & 0 deletions requirements-test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
-r requirements.txt
pytest>=7.0.0
httpx>=0.27.0
Loading