fix(ci): also update database url for tests in ci

This commit is contained in:
perf3ct 2025-07-21 21:07:47 +00:00
parent 47ce114ef4
commit b5e196a2be
No known key found for this signature in database
GPG Key ID: 569C4EEC436F5232
2 changed files with 10 additions and 10 deletions

View File

@ -21,9 +21,9 @@ jobs:
postgres: postgres:
image: postgres:17 image: postgres:17
env: env:
POSTGRES_USER: postgres POSTGRES_USER: readur
POSTGRES_PASSWORD: postgres POSTGRES_PASSWORD: readur
POSTGRES_DB: readur_test POSTGRES_DB: readur
ports: ports:
- 5432:5432 - 5432:5432
options: >- options: >-
@ -78,7 +78,7 @@ jobs:
- name: Build backend - name: Build backend
run: cargo build --release run: cargo build --release
env: env:
DATABASE_URL: postgres://postgres:postgres@localhost:5432/readur_test DATABASE_URL: postgres://readur:readur@localhost:5432/readur
RUST_BACKTRACE: 1 RUST_BACKTRACE: 1
- name: Build frontend - name: Build frontend
@ -92,7 +92,7 @@ jobs:
./target/release/readur & ./target/release/readur &
echo $! > backend.pid echo $! > backend.pid
env: env:
DATABASE_URL: postgres://postgres:postgres@localhost:5432/readur_test DATABASE_URL: postgres://readur:readur@localhost:5432/readur
JWT_SECRET: test-secret-key JWT_SECRET: test-secret-key
PORT: 8000 PORT: 8000
FRONTEND_PATH: ./frontend/dist FRONTEND_PATH: ./frontend/dist

View File

@ -22,9 +22,9 @@ jobs:
postgres: postgres:
image: postgres:17 image: postgres:17
env: env:
POSTGRES_USER: postgres POSTGRES_USER: readur
POSTGRES_PASSWORD: postgres POSTGRES_PASSWORD: readur
POSTGRES_DB: readur_test POSTGRES_DB: readur
ports: ports:
- 5432:5432 - 5432:5432
options: >- options: >-
@ -125,7 +125,7 @@ jobs:
- name: Wait for PostgreSQL to be ready - name: Wait for PostgreSQL to be ready
run: | run: |
until pg_isready -h localhost -p 5432 -U postgres; do until pg_isready -h localhost -p 5432 -U readur; do
echo "Waiting for PostgreSQL..." echo "Waiting for PostgreSQL..."
sleep 1 sleep 1
done done
@ -134,7 +134,7 @@ jobs:
- name: Verify database connection - name: Verify database connection
run: | run: |
echo "Testing database connection..." echo "Testing database connection..."
PGPASSWORD=postgres psql -h localhost -p 5432 -U postgres -d readur_test -c "SELECT version();" PGPASSWORD=readur psql -h localhost -p 5432 -U readur -d readur -c "SELECT version();"
echo "Database connection successful!" echo "Database connection successful!"
- name: Run integration tests - name: Run integration tests