From 3b38d8042eeb324ab6a9e959a89d9c5a0b3740c5 Mon Sep 17 00:00:00 2001 From: Jan Eitzinger Date: Wed, 15 Feb 2023 13:07:19 +0100 Subject: [PATCH] Fix tests --- internal/repository/job_test.go | 2 ++ pkg/archive/fsBackend_test.go | 5 +++++ test/integration_test.go | 2 ++ 3 files changed, 9 insertions(+) diff --git a/internal/repository/job_test.go b/internal/repository/job_test.go index 98b6fe2..6370581 100644 --- a/internal/repository/job_test.go +++ b/internal/repository/job_test.go @@ -8,10 +8,12 @@ import ( "fmt" "testing" + "github.com/ClusterCockpit/cc-backend/pkg/log" _ "github.com/mattn/go-sqlite3" ) func init() { + log.Init("info", true) Connect("sqlite3", "../../test/test.db") } diff --git a/pkg/archive/fsBackend_test.go b/pkg/archive/fsBackend_test.go index 962aa23..1dadd5b 100644 --- a/pkg/archive/fsBackend_test.go +++ b/pkg/archive/fsBackend_test.go @@ -10,9 +10,14 @@ import ( "testing" "time" + "github.com/ClusterCockpit/cc-backend/pkg/log" "github.com/ClusterCockpit/cc-backend/pkg/schema" ) +func init() { + log.Init("info", true) +} + func TestInitEmptyPath(t *testing.T) { var fsa FsArchive err := fsa.Init(json.RawMessage("{\"kind\":\"../../test/archive\"}")) diff --git a/test/integration_test.go b/test/integration_test.go index 1fbd5f6..3eb523c 100644 --- a/test/integration_test.go +++ b/test/integration_test.go @@ -20,6 +20,7 @@ import ( "github.com/ClusterCockpit/cc-backend/internal/metricdata" "github.com/ClusterCockpit/cc-backend/internal/repository" "github.com/ClusterCockpit/cc-backend/pkg/archive" + "github.com/ClusterCockpit/cc-backend/pkg/log" "github.com/ClusterCockpit/cc-backend/pkg/schema" "github.com/gorilla/mux" @@ -245,6 +246,7 @@ func setup(t *testing.T) *api.RestApi { ] }` + log.Init("info", true) tmpdir := t.TempDir() jobarchive := filepath.Join(tmpdir, "job-archive") if err := os.Mkdir(jobarchive, 0777); err != nil {