diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml index 6baa7e3..6460bfd 100644 --- a/.gitea/workflows/ci.yaml +++ b/.gitea/workflows/ci.yaml @@ -452,6 +452,7 @@ jobs: run: go test -tags "${{ matrix.gotags }}" -count=1 -timeout 1800s ${{ matrix.verbose }} ${{ matrix.coverflags }} ./... env: GO_TESTING: "1" + DAV_SKIP_INIT: "1" POSTGRES_HOST: postgres TEST_DB_HOST: postgres @@ -542,6 +543,7 @@ jobs: run: go test -tags "${{ matrix.gotags }}" -race -count=1 -timeout 1800s ./... env: GO_TESTING: "1" + DAV_SKIP_INIT: "1" POSTGRES_HOST: postgres TEST_DB_HOST: postgres CGO_ENABLED: "1" diff --git a/backend/internal/dav/service_dev.go b/backend/internal/dav/service_dev.go index 509aebe..671d7c0 100644 --- a/backend/internal/dav/service_dev.go +++ b/backend/internal/dav/service_dev.go @@ -15,7 +15,7 @@ var Service *BaseService func init() { if err := connect(); err != nil { // Don't fatal in test mode - tests will use testdb instead - if os.Getenv("GO_TESTING") != "" { + if os.Getenv("DAV_SKIP_INIT") != "" { return } panic("failed to initialize dev service: " + err.Error()) diff --git a/backend/internal/dav/service_prod.go b/backend/internal/dav/service_prod.go index 84ad4cc..bbcefa7 100644 --- a/backend/internal/dav/service_prod.go +++ b/backend/internal/dav/service_prod.go @@ -15,7 +15,7 @@ var Service *BaseService func init() { if err := connect(); err != nil { // Don't fatal in test mode - tests will use testdb instead - if os.Getenv("GO_TESTING") != "" { + if os.Getenv("DAV_SKIP_INIT") != "" { return } panic("failed to initialize prod service: " + err.Error())