|
10 | 10 | test: |
11 | 11 | runs-on: ubuntu-latest |
12 | 12 | strategy: |
| 13 | + # Report every leg. A failure on one Python version is information, not a |
| 14 | + # reason to stop testing the others. |
| 15 | + fail-fast: false |
13 | 16 | matrix: |
14 | 17 | python-version: ["3.8", "3.10", "3.12"] |
15 | 18 |
|
| 19 | + # PostgreSQL for the server store tests (Q1: PostgreSQL only). |
| 20 | + # |
| 21 | + # Without this the store tests SKIP, and a skipped test in CI reads exactly |
| 22 | + # like a passing one on the summary page — which is the same |
| 23 | + # looks-clean-but-was-never-checked failure the whole product is built to |
| 24 | + # avoid. tests/test_server_store.py refuses to skip when CI=true, so a |
| 25 | + # service that fails to start is a red build rather than a quiet one. |
| 26 | + services: |
| 27 | + postgres: |
| 28 | + image: postgres:16-alpine |
| 29 | + env: |
| 30 | + POSTGRES_USER: otfleet |
| 31 | + # Ephemeral, per-job container reachable only from this runner. |
| 32 | + POSTGRES_PASSWORD: ci-throwaway |
| 33 | + POSTGRES_DB: otfleet |
| 34 | + ports: |
| 35 | + - 5432:5432 |
| 36 | + options: >- |
| 37 | + --health-cmd "pg_isready -U otfleet -d otfleet" |
| 38 | + --health-interval 10s |
| 39 | + --health-timeout 5s |
| 40 | + --health-retries 5 |
| 41 | +
|
| 42 | + env: |
| 43 | + OT_TEST_DSN: postgresql://otfleet:ci-throwaway@localhost:5432/otfleet |
| 44 | + |
16 | 45 | steps: |
17 | 46 | - uses: actions/checkout@v4 |
18 | 47 |
|
|
31 | 60 | - name: Run tests |
32 | 61 | working-directory: ot_scanner |
33 | 62 | run: python -m pytest tests/ -v --tb=short |
| 63 | + |
| 64 | + - name: Confirm the store tests actually ran |
| 65 | + working-directory: ot_scanner |
| 66 | + # Belt and braces on top of the in-test guard: if the Postgres service |
| 67 | + # is unreachable these deselect to zero and the run would otherwise be |
| 68 | + # green having tested no SQL at all. |
| 69 | + run: | |
| 70 | + python -m pytest tests/test_server_store.py -q \ |
| 71 | + | tee /tmp/store.txt |
| 72 | + grep -qE "[0-9]+ passed" /tmp/store.txt |
| 73 | + ! grep -q "skipped" /tmp/store.txt |
0 commit comments