mirror of
https://github.com/Mezeporta/Erupe.git
synced 2026-03-22 07:32:32 +01:00
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:
22
.github/workflows/go.yml
vendored
22
.github/workflows/go.yml
vendored
@@ -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: |
|
||||
|
||||
Reference in New Issue
Block a user