Skip to content

Commit

Permalink
Database Connection Variables: Ensure DATABASE_URL is correctly set a…
Browse files Browse the repository at this point in the history
…nd recognized. Sometimes, even a slight syntax or permission misalignment can block actions from connecting to the database.

Migration Sequence Timing: Adding extra delays or an explicit verification step after setting up tables in test can help confirm readiness.

Debugging and Logging: To capture detailed output from the database for further diagnosis, let’s add debugging steps right before and after migrations to verify table existence.
  • Loading branch information
Mehrn0ush committed Oct 26, 2024
1 parent cb54596 commit 936792a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/feature-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ jobs:
response_types JSONB,
software_statement TEXT
);
CREATE TABLE IF NOT EXISTS tokens (
access_token VARCHAR PRIMARY KEY,
refresh_token VARCHAR,
Expand All @@ -96,16 +96,15 @@ jobs:
DATABASE_URL: postgres://rustify_auth:password@localhost:5432/rustify_auth_db
run: |
echo "Checking tables in PostgreSQL..."
psql $DATABASE_URL -c "\dt"
psql $DATABASE_URL -c "SELECT * FROM clients LIMIT 1;" # Optional to check data presence
psql $DATABASE_URL -c "\dt" # Ensure tables are created
- name: Run cargo test with backtrace enabled
env:
DATABASE_URL: postgres://rustify_auth:password@localhost:5432/rustify_auth_db
REDIS_URL: redis://localhost:6379
JWT_SECRET: test_secret
RUST_BACKTRACE: full
RUST_LOG: debug
RUST_LOG: debug
run: cargo test -- --test-threads=1

format:
Expand Down

0 comments on commit 936792a

Please sign in to comment.