From 3cb6a7f6ad38d91106874858dd10ce4896d8474e Mon Sep 17 00:00:00 2001 From: Stephen Adamson Date: Thu, 25 Jun 2026 00:56:45 +0100 Subject: [PATCH] ci: set POSTGRES_HOST directly in workflow --- .gitea/workflows/backend-tests.yaml | 2 +- backend/db/db_test.go | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/backend-tests.yaml b/.gitea/workflows/backend-tests.yaml index 1540d65..43566fe 100644 --- a/.gitea/workflows/backend-tests.yaml +++ b/.gitea/workflows/backend-tests.yaml @@ -62,7 +62,7 @@ jobs: working-directory: backend run: go test -tags "test,dev" -count=1 -v -timeout 120s ./handlers/... ./auth/... ./mw/... ./internal/... ./db/... env: - TEST_DB_HOST: postgres + POSTGRES_HOST: postgres PGUSER: myuser PGPASSWORD: mypassword PGDATABASE: mydb diff --git a/backend/db/db_test.go b/backend/db/db_test.go index 30eab86..7566080 100644 --- a/backend/db/db_test.go +++ b/backend/db/db_test.go @@ -13,7 +13,9 @@ import ( func resetEnv() { host := "localhost" - if h := os.Getenv("TEST_DB_HOST"); h != "" { + if h := os.Getenv("POSTGRES_HOST"); h != "" { + host = h + } else if h := os.Getenv("TEST_DB_HOST"); h != "" { host = h } os.Setenv("POSTGRES_USER", "myuser")