Skip to content

Commit

Permalink
Suppress logrus output during tests
Browse files Browse the repository at this point in the history
  • Loading branch information
marco6 committed Jul 9, 2024
1 parent 092e35e commit 0e77aa3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/kine/drivers/generic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,21 @@ package drivers_test
import (
"context"
"fmt"
"io"
"testing"

"github.com/canonical/k8s-dqlite/pkg/kine/drivers/generic"
"github.com/canonical/k8s-dqlite/pkg/kine/logstructured/sqllog"
"github.com/canonical/k8s-dqlite/pkg/kine/server"
. "github.com/onsi/gomega"
"github.com/sirupsen/logrus"
)

func init() {
logrus.SetOutput(io.Discard)
logrus.SetLevel(logrus.FatalLevel)
}

type makeBackendFunc func(ctx context.Context, tb testing.TB) (server.Backend, *generic.Generic, error)

func testCompaction(t *testing.T, makeBackend makeBackendFunc) {
Expand Down
7 changes: 7 additions & 0 deletions test/util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,22 @@ package test
import (
"context"
"fmt"
"io"
"strings"
"testing"
"time"

"github.com/canonical/go-dqlite/app"
"github.com/canonical/k8s-dqlite/pkg/kine/endpoint"
"github.com/sirupsen/logrus"
clientv3 "go.etcd.io/etcd/client/v3"
)

func init() {
logrus.SetOutput(io.Discard)
logrus.SetLevel(logrus.FatalLevel)
}

// newKine spins up a new instance of kine.
//
// newKine will create a sqlite or dqlite endpoint based on the provided backendType.
Expand Down

0 comments on commit 0e77aa3

Please sign in to comment.