From 936792af7173d9a9a44045dc7ef124d324916e28 Mon Sep 17 00:00:00 2001 From: Mehrn0ush Date: Sat, 26 Oct 2024 11:34:14 +0330 Subject: [PATCH] Database Connection Variables: Ensure DATABASE_URL is correctly set and recognized. Sometimes, even a slight syntax or permission misalignment can block actions from connecting to the database. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- .github/workflows/feature-ci.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/feature-ci.yml b/.github/workflows/feature-ci.yml index 807ba26..e61a8d9 100644 --- a/.github/workflows/feature-ci.yml +++ b/.github/workflows/feature-ci.yml @@ -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, @@ -96,8 +96,7 @@ 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: @@ -105,7 +104,7 @@ jobs: 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: