From f57e931931585b1900cc12950adc355016cacc8e Mon Sep 17 00:00:00 2001 From: CJ_Clippy Date: Thu, 20 Feb 2025 08:59:14 -0800 Subject: [PATCH] enable alternate db port during testing --- .gitea/workflows/tests.yaml | 2 +- apps/bright/config/test.exs | 1 + devbox.json | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/tests.yaml b/.gitea/workflows/tests.yaml index 6e7b26e..1a7095d 100644 --- a/.gitea/workflows/tests.yaml +++ b/.gitea/workflows/tests.yaml @@ -35,7 +35,7 @@ jobs: db: image: postgres:16 ports: - - 5432:5432 + - 5433:5432 env: POSTGRES_DB: ${{ vars.DB_NAME }} POSTGRES_USER: ${{ vars.DB_USER }} diff --git a/apps/bright/config/test.exs b/apps/bright/config/test.exs index b24c828..65876e3 100644 --- a/apps/bright/config/test.exs +++ b/apps/bright/config/test.exs @@ -13,6 +13,7 @@ config :bright, Bright.Repo, hostname: System.get_env("DB_HOST", "localhost"), username: System.get_env("DB_USER", "postgres"), password: System.get_env("DB_PASS", "password"), + port: System.get_env("DB_PORT", "5433"), # database: "bright_test#{System.get_env("MIX_TEST_PARTITION")}", pool: Ecto.Adapters.SQL.Sandbox, pool_size: System.schedulers_online() * 4 diff --git a/devbox.json b/devbox.json index 870ccd7..fe554c6 100644 --- a/devbox.json +++ b/devbox.json @@ -39,7 +39,7 @@ "bright:dev": "cd ./apps/bright && dotenvx run -f ../../.kamal/secrets.development -e MIX_ENV=dev -- mix phx.server", "bright:test:unit:watch": "cd ./apps/bright && pnpx chokidar-cli '**/*' -i \"deps/**\" -i '_build/**' -c 'mix test --only=unit'", "bright:act": "cd ./apps/bright && act --env MIX_ENV=test -W ./.gitea/workflows/tests.yaml --secret-file .kamal/secrets.development", - "test": "act -W ./.gitea/workflows/tests.yaml --secret-file .kamal/secrets.development && devbox run beep || devbox run boop", + "test": "act -W ./.gitea/workflows/tests.yaml --secret-file .kamal/secrets.testing --var-file .kamal/secrets.testing && devbox run beep || devbox run boop", "beep": "ffplay -nodisp -loglevel quiet -autoexit ./apps/beep/beep2.wav", "boop": "ffplay -nodisp -loglevel quiet -autoexit ./apps/beep/beep1.wav" }