From 95f1b4e04a465309a2f1bfe93cecdb2a37f803af Mon Sep 17 00:00:00 2001 From: syntaxbullet Date: Fri, 30 Jan 2026 16:42:59 +0100 Subject: [PATCH] ci: Update test database host in deployment workflow and add support for running specific tests in the CI simulation script. --- .github/workflows/deploy.yml | 4 ++-- shared/scripts/simulate-ci.sh | 21 ++++++++++++++++----- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 2533c1d..b5c2c62 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -78,7 +78,7 @@ jobs: - name: Setup Test Database run: bun run db:push:local env: - DATABASE_URL: postgresql://postgres:postgres@127.0.0.1:5432/aurora_test + DATABASE_URL: postgresql://postgres:postgres@postgres:5432/aurora_test # Create .env.test for implicit usage by bun DISCORD_BOT_TOKEN: test_token DISCORD_CLIENT_ID: 123 @@ -88,7 +88,7 @@ jobs: run: | # Create .env.test for test-sequential.sh / bun test cat < .env.test - DATABASE_URL="postgresql://postgres:postgres@127.0.0.1:5432/aurora_test" + DATABASE_URL="postgresql://postgres:postgres@postgres:5432/aurora_test" DISCORD_BOT_TOKEN="test_token" DISCORD_CLIENT_ID="123456789" DISCORD_GUILD_ID="123456789" diff --git a/shared/scripts/simulate-ci.sh b/shared/scripts/simulate-ci.sh index 8485c39..bb5abe3 100755 --- a/shared/scripts/simulate-ci.sh +++ b/shared/scripts/simulate-ci.sh @@ -82,12 +82,23 @@ export LOG_LEVEL="error" # 5. Run Tests echo "๐Ÿงช Running Tests..." -if bash shared/scripts/test-sequential.sh; then - echo "โœ… CI Simulation Passed!" - EXIT_CODE=0 +if [ -n "$1" ]; then + echo "Running specific test: $1" + if bun test "$1"; then + echo "โœ… Specific Test Passed!" + EXIT_CODE=0 + else + echo "โŒ Specific Test Failed!" + EXIT_CODE=1 + fi else - echo "โŒ CI Simulation Failed!" - EXIT_CODE=1 + if bash shared/scripts/test-sequential.sh; then + echo "โœ… CI Simulation Passed!" + EXIT_CODE=0 + else + echo "โŒ CI Simulation Failed!" + EXIT_CODE=1 + fi fi # 6. Cleanup