test(repos): add SQL integration tests for 17 untested repo files

Add 148 integration tests exercising actual SQL against PostgreSQL for
all previously untested repository files. Includes 6 new fixture helpers
in testhelpers_db.go and CI PostgreSQL service configuration.

Discovered and documented existing RecordPurchase SQL bug (ambiguous
column reference in ON CONFLICT clause).
This commit is contained in:
Houmgaor
2026-02-24 16:57:47 +01:00
parent c5fd0444f4
commit f9d4252860
19 changed files with 3309 additions and 0 deletions

View File

@@ -29,6 +29,22 @@ jobs:
name: Test
runs-on: ubuntu-latest
services:
postgres:
image: postgres:15-alpine
env:
POSTGRES_USER: test
POSTGRES_PASSWORD: test
POSTGRES_DB: erupe_test
ports:
- 5433:5432
options: >-
--health-cmd pg_isready
--health-interval 2s
--health-timeout 2s
--health-retries 10
--mount type=tmpfs,destination=/var/lib/postgresql/data
steps:
- uses: actions/checkout@v4
@@ -42,6 +58,12 @@ jobs:
- name: Run Tests with Race Detector and Coverage
run: go test -race -coverprofile=coverage.out ./... -timeout=10m
env:
TEST_DB_HOST: localhost
TEST_DB_PORT: 5433
TEST_DB_USER: test
TEST_DB_PASSWORD: test
TEST_DB_NAME: erupe_test
- name: Check coverage threshold
run: |