Make sure postgres env variables for test stage are consistent
Some checks failed
Some checks failed
This commit is contained in:
parent
40cd2f4797
commit
2e5fb1e212
3 changed files with 6 additions and 6 deletions
|
@ -77,7 +77,7 @@ jobs:
|
||||||
|
|
||||||
- name: Validate migration files
|
- name: Validate migration files
|
||||||
env:
|
env:
|
||||||
DATABASE_URL: postgres://postgres:postgres@localhost:5432/sharenet_test
|
DATABASE_URL: postgres://postgres:password@localhost:5432/sharenet_test
|
||||||
run: |
|
run: |
|
||||||
# Wait for PostgreSQL to be ready
|
# Wait for PostgreSQL to be ready
|
||||||
echo "Waiting for PostgreSQL to be ready..."
|
echo "Waiting for PostgreSQL to be ready..."
|
||||||
|
@ -95,7 +95,7 @@ jobs:
|
||||||
- name: Run backend tests
|
- name: Run backend tests
|
||||||
working-directory: ./backend
|
working-directory: ./backend
|
||||||
env:
|
env:
|
||||||
DATABASE_URL: postgres://postgres:postgres@localhost:5432/sharenet_test
|
DATABASE_URL: postgres://postgres:password@localhost:5432/sharenet_test
|
||||||
run: |
|
run: |
|
||||||
# Run tests with increased parallelism for Rust
|
# Run tests with increased parallelism for Rust
|
||||||
docker exec ci-dind docker exec ci-cd-test-rust cargo test --all --jobs 4
|
docker exec ci-dind docker exec ci-cd-test-rust cargo test --all --jobs 4
|
||||||
|
|
|
@ -23,13 +23,13 @@ CREATE DATABASE sharenet_test;
|
||||||
Set the `DATABASE_URL` environment variable:
|
Set the `DATABASE_URL` environment variable:
|
||||||
|
|
||||||
```bash
|
```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:
|
Or create a `.env` file in the postgres crate directory:
|
||||||
|
|
||||||
```env
|
```env
|
||||||
DATABASE_URL=postgres://username:password@localhost:5432/sharenet_test
|
DATABASE_URL=postgres://postgres:password@localhost:5432/sharenet_test
|
||||||
```
|
```
|
||||||
|
|
||||||
### 3. SQLx Setup
|
### 3. SQLx Setup
|
||||||
|
@ -199,7 +199,7 @@ Example GitHub Actions setup:
|
||||||
|
|
||||||
- name: Run Postgres Tests
|
- name: Run Postgres Tests
|
||||||
env:
|
env:
|
||||||
DATABASE_URL: postgres://postgres:postgres@localhost:5432/sharenet_test
|
DATABASE_URL: postgres://postgres:password@localhost:5432/sharenet_test
|
||||||
run: |
|
run: |
|
||||||
cd backend/crates/postgres
|
cd backend/crates/postgres
|
||||||
cargo test
|
cargo test
|
||||||
|
|
|
@ -9,7 +9,7 @@ services:
|
||||||
environment:
|
environment:
|
||||||
POSTGRES_DB: sharenet_test
|
POSTGRES_DB: sharenet_test
|
||||||
POSTGRES_USER: postgres
|
POSTGRES_USER: postgres
|
||||||
POSTGRES_PASSWORD: postgres
|
POSTGRES_PASSWORD: password
|
||||||
ports:
|
ports:
|
||||||
- "5432:5432"
|
- "5432:5432"
|
||||||
healthcheck:
|
healthcheck:
|
||||||
|
|
Loading…
Add table
Reference in a new issue