From 476561c63edbe08aec73d1b0dd1b4ac33a8789b6 Mon Sep 17 00:00:00 2001 From: Aidan Cornelius-Bell Date: Wed, 1 Jan 2025 07:14:21 +1030 Subject: [PATCH] Fiddling with test some more for CI etc --- .github/workflows/ci.yml | 5 +++-- config/database.yml | 12 ++++++++++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index da7f229..1d6393f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,6 +38,7 @@ jobs: image: mysql:8.0 env: MYSQL_ALLOW_EMPTY_PASSWORD: true + MYSQL_DATABASE: arelpe_test ports: - 3306:3306 options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 @@ -58,8 +59,8 @@ jobs: - name: Setup test database and run tests env: RAILS_ENV: test - DATABASE_URL: mysql2://127.0.0.1:3306 - # REDIS_URL: redis://localhost:6379/0 + DATABASE_URL: mysql2://root@127.0.0.1:3306/arelpe_test + MYSQL_ALLOW_EMPTY_PASSWORD: true ENCRYPTION_PRIMARY_KEY: ${{ secrets.ENCRYPTION_PRIMARY_KEY || 'test_primary_key_1234567890' }} ENCRYPTION_DETERMINISTIC_KEY: ${{ secrets.ENCRYPTION_DETERMINISTIC_KEY || 'test_deterministic_key_1234567890' }} ENCRYPTION_KEY_DERIVATION_SALT: ${{ secrets.ENCRYPTION_KEY_DERIVATION_SALT || 'test_derivation_salt_1234567890' }} diff --git a/config/database.yml b/config/database.yml index 0fe2e44..bc06414 100644 --- a/config/database.yml +++ b/config/database.yml @@ -22,8 +22,16 @@ development: database: arelpe_development test: - <<: *default - database: arelpe_test + adapter: mysql2 + encoding: utf8mb4 + collation: utf8mb4_0900_ai_ci + pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> + url: <%= ENV['DATABASE_URL'] %> + database: <%= ENV.fetch('MYSQL_DATABASE') { 'arelpe_test' } %> + username: <%= ENV.fetch('MYSQL_USERNAME') { 'root' } %> + password: <%= ENV.fetch('MYSQL_PASSWORD') { nil } %> + host: <%= ENV.fetch('MYSQL_HOST') { '127.0.0.1' } %> + port: <%= ENV.fetch('MYSQL_PORT') { 3306 } %> production: <<: *default -- 2.39.5