diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1fe2a83..ee2f5fd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,7 +11,8 @@ concurrency: cancel-in-progress: true jobs: - pytest: + prod-install-smoke: + name: Verify prod requirements.txt is sufficient runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -22,8 +23,37 @@ jobs: cache: pip cache-dependency-path: requirements.txt - - name: Install dependencies + - name: Install production dependencies only run: pip install -r requirements.txt + # Boots the app under test_client without pytest. Catches the case + # where someone adds a real third-party import (e.g. werkzeug.X) + # to the source without bumping requirements.txt — that would + # surface here as ImportError before merge. + - name: Import + boot app + run: | + python - <<'PY' + from app import create_app + app = create_app() + client = app.test_client() + assert client.get("/").status_code == 200 + PY + + pytest: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-python@v5 + with: + python-version: "3.12" + cache: pip + cache-dependency-path: | + requirements.txt + requirements-dev.txt + + - name: Install dev dependencies (Flask + pytest) + run: pip install -r requirements-dev.txt + - name: Run tests run: pytest --tb=short -q diff --git a/README.md b/README.md index 3047796..cf027b8 100644 --- a/README.md +++ b/README.md @@ -107,9 +107,20 @@ claude-code-chat-browser/ └── tests/ ``` +## Development + +To run the test suite, install the dev requirements (Flask + pytest): + +```bash +pip install -r requirements-dev.txt +pytest +``` + +`requirements.txt` carries only the runtime dep (Flask); `requirements-dev.txt` pulls it in via `-r` and adds pytest. + ## Continuous integration -Every push and pull request runs **`pytest`** on **Ubuntu** (Python 3.12) via [`.github/workflows/ci.yml`](.github/workflows/ci.yml). +Every push and pull request runs **`pytest`** on **Ubuntu** (Python 3.12) via [`.github/workflows/ci.yml`](.github/workflows/ci.yml). A separate job verifies that `pip install -r requirements.txt` (production-only) is sufficient to import and boot the app. ## Exported Markdown Format diff --git a/requirements-dev.txt b/requirements-dev.txt new file mode 100644 index 0000000..bdf88e0 --- /dev/null +++ b/requirements-dev.txt @@ -0,0 +1,2 @@ +-r requirements.txt +pytest==9.0.2 diff --git a/requirements.txt b/requirements.txt index 8912804..af266d2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,15 +1 @@ -blinker==1.9.0 -click==8.3.1 -colorama==0.4.6 -exceptiongroup==1.3.1 Flask==3.1.3 -iniconfig==2.3.0 -itsdangerous==2.2.0 -Jinja2==3.1.6 -MarkupSafe==3.0.3 -packaging==26.0 -pluggy==1.6.0 -pytest==9.0.2 -tomli==2.4.0 -typing_extensions==4.15.0 -Werkzeug==3.1.6