Skip to content
Merged
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
53 changes: 53 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: ServeSense Tests

on:
push:
branches:
- main
pull_request:
workflow_dispatch:

permissions:
contents: read

jobs:
tests:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pip

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt

- name: Python syntax check
run: |
python -m py_compile app/web.py
python -m py_compile tools/richmack_metrics.py

- name: Run ServeSense tests
env:
ADMIN_USERNAME: testadmin
ADMIN_PASSWORD: testpassword
SECRET_KEY: ci-secret
PYTHONPATH: ${{ github.workspace }}
run: |
python -m pytest -q

- name: Verify metrics are internal only
run: |
! grep -q "@app.get('/metrics')" app/web.py
! grep -q "Metrics','metrics" app/templates/base.html

- name: Verify Weissman test exists
run: |
grep -q "def test_weissman_score" tests/test_richmack_metrics.py
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ Flask==3.1.1
Flask-Login==0.6.3
gunicorn==23.0.0
Werkzeug==3.1.3
pytest==8.3.5
7 changes: 7 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import sys
from pathlib import Path

ROOT = Path(__file__).resolve().parents[1]

if str(ROOT) not in sys.path:
sys.path.insert(0, str(ROOT))
Loading
Loading