Make sure postgres env variables for test stage are consistent
Some checks failed
CI/CD Pipeline (Fully Isolated DinD) / Run Tests (DinD) (push) Has been cancelled
CI/CD Pipeline (Fully Isolated DinD) / Build and Push Docker Images (DinD) (push) Has been cancelled
CI/CD Pipeline (Fully Isolated DinD) / Deploy to Production (push) Has been cancelled

This commit is contained in:
continuist 2025-07-05 02:35:10 -04:00
parent 40cd2f4797
commit 2e5fb1e212
3 changed files with 6 additions and 6 deletions

View file

@ -77,7 +77,7 @@ jobs:
- name: Validate migration files
env:
DATABASE_URL: postgres://postgres:postgres@localhost:5432/sharenet_test
DATABASE_URL: postgres://postgres:password@localhost:5432/sharenet_test
run: |
# Wait for PostgreSQL to be ready
echo "Waiting for PostgreSQL to be ready..."
@ -95,7 +95,7 @@ jobs:
- name: Run backend tests
working-directory: ./backend
env:
DATABASE_URL: postgres://postgres:postgres@localhost:5432/sharenet_test
DATABASE_URL: postgres://postgres:password@localhost:5432/sharenet_test
run: |
# Run tests with increased parallelism for Rust
docker exec ci-dind docker exec ci-cd-test-rust cargo test --all --jobs 4

View file

@ -23,13 +23,13 @@ CREATE DATABASE sharenet_test;
Set the `DATABASE_URL` environment variable:
```bash
export DATABASE_URL="postgres://username:password@localhost:5432/sharenet_test"
export DATABASE_URL="postgres://postgres:password@localhost:5432/sharenet_test"
```
Or create a `.env` file in the postgres crate directory:
```env
DATABASE_URL=postgres://username:password@localhost:5432/sharenet_test
DATABASE_URL=postgres://postgres:password@localhost:5432/sharenet_test
```
### 3. SQLx Setup
@ -199,7 +199,7 @@ Example GitHub Actions setup:
- name: Run Postgres Tests
env:
DATABASE_URL: postgres://postgres:postgres@localhost:5432/sharenet_test
DATABASE_URL: postgres://postgres:password@localhost:5432/sharenet_test
run: |
cd backend/crates/postgres
cargo test

View file

@ -9,7 +9,7 @@ services:
environment:
POSTGRES_DB: sharenet_test
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_PASSWORD: password
ports:
- "5432:5432"
healthcheck: