Compare commits

...

3 Commits

Author SHA1 Message Date
Alexander Whitestone
363407293d ci: add pytest workflow for #190
All checks were successful
Test / pytest (pull_request) Successful in 30s
2026-04-15 11:29:23 -04:00
Alexander Whitestone
4bd0a5d7ac test: define CI configuration acceptance for #190 2026-04-15 11:26:08 -04:00
e6f1b07f16 Merge pull request 'feat: Knowledge store staleness detector (closes #179)' (#185) from feat/179-staleness-check into main 2026-04-15 06:09:14 +00:00
4 changed files with 46 additions and 0 deletions

22
.gitea/workflows/test.yml Normal file
View File

@@ -0,0 +1,22 @@
name: Test
on:
pull_request:
push:
branches: [main]
jobs:
pytest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install test dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run test suite
run: |
make test

4
Makefile Normal file
View File

@@ -0,0 +1,4 @@
.PHONY: test
test:
python3 -m pytest tests/test_ci_config.py scripts/test_*.py -v

1
requirements.txt Normal file
View File

@@ -0,0 +1 @@
pytest>=8,<9

19
tests/test_ci_config.py Normal file
View File

@@ -0,0 +1,19 @@
from pathlib import Path
def test_requirements_makefile_and_workflow_exist() -> None:
assert Path("requirements.txt").exists()
assert Path("Makefile").exists()
assert Path(".gitea/workflows/test.yml").exists()
def test_ci_workflow_runs_project_test_command() -> None:
workflow = Path(".gitea/workflows/test.yml").read_text(encoding="utf-8")
requirements = Path("requirements.txt").read_text(encoding="utf-8")
makefile = Path("Makefile").read_text(encoding="utf-8")
assert "pytest" in requirements
assert "test:" in makefile
assert "python3 -m pytest tests/test_ci_config.py scripts/test_*.py -v" in makefile
assert "pip install -r requirements.txt" in workflow
assert "make test" in workflow