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")