Discard logs created during tests

- Make sure output is being set to discard for logrus to reduce clutter in the console
This commit is contained in:
Rob Mulholand 2019-02-12 11:18:39 -06:00
parent f73623789e
commit ac9375ae47
15 changed files with 58 additions and 16 deletions

View File

@ -17,6 +17,8 @@
package repositories_test package repositories_test
import ( import (
"github.com/sirupsen/logrus"
"io/ioutil"
"testing" "testing"
. "github.com/onsi/ginkgo" . "github.com/onsi/ginkgo"
@ -27,3 +29,7 @@ func TestRepositories(t *testing.T) {
RegisterFailHandler(Fail) RegisterFailHandler(Fail)
RunSpecs(t, "Repositories Suite") RunSpecs(t, "Repositories Suite")
} }
var _ = BeforeSuite(func() {
logrus.SetOutput(ioutil.Discard)
})

View File

@ -17,8 +17,8 @@
package retriever_test package retriever_test
import ( import (
"github.com/sirupsen/logrus"
"io/ioutil" "io/ioutil"
"log"
"testing" "testing"
. "github.com/onsi/ginkgo" . "github.com/onsi/ginkgo"
@ -31,5 +31,5 @@ func TestRetriever(t *testing.T) {
} }
var _ = BeforeSuite(func() { var _ = BeforeSuite(func() {
log.SetOutput(ioutil.Discard) logrus.SetOutput(ioutil.Discard)
}) })

View File

@ -17,8 +17,8 @@
package transformer_test package transformer_test
import ( import (
"github.com/sirupsen/logrus"
"io/ioutil" "io/ioutil"
"log"
"testing" "testing"
. "github.com/onsi/ginkgo" . "github.com/onsi/ginkgo"
@ -31,5 +31,5 @@ func TestTransformer(t *testing.T) {
} }
var _ = BeforeSuite(func() { var _ = BeforeSuite(func() {
log.SetOutput(ioutil.Discard) logrus.SetOutput(ioutil.Discard)
}) })

View File

@ -17,8 +17,8 @@
package repository_test package repository_test
import ( import (
"github.com/sirupsen/logrus"
"io/ioutil" "io/ioutil"
"log"
"testing" "testing"
. "github.com/onsi/ginkgo" . "github.com/onsi/ginkgo"
@ -31,5 +31,5 @@ func TestRepository(t *testing.T) {
} }
var _ = BeforeSuite(func() { var _ = BeforeSuite(func() {
log.SetOutput(ioutil.Discard) logrus.SetOutput(ioutil.Discard)
}) })

View File

@ -17,8 +17,8 @@
package retriever_test package retriever_test
import ( import (
"github.com/sirupsen/logrus"
"io/ioutil" "io/ioutil"
"log"
"testing" "testing"
. "github.com/onsi/ginkgo" . "github.com/onsi/ginkgo"
@ -31,5 +31,5 @@ func TestRetriever(t *testing.T) {
} }
var _ = BeforeSuite(func() { var _ = BeforeSuite(func() {
log.SetOutput(ioutil.Discard) logrus.SetOutput(ioutil.Discard)
}) })

View File

@ -17,8 +17,8 @@
package transformer_test package transformer_test
import ( import (
"github.com/sirupsen/logrus"
"io/ioutil" "io/ioutil"
"log"
"testing" "testing"
. "github.com/onsi/ginkgo" . "github.com/onsi/ginkgo"
@ -31,5 +31,5 @@ func TestTransformer(t *testing.T) {
} }
var _ = BeforeSuite(func() { var _ = BeforeSuite(func() {
log.SetOutput(ioutil.Discard) logrus.SetOutput(ioutil.Discard)
}) })

View File

@ -17,8 +17,8 @@
package poller_test package poller_test
import ( import (
"github.com/sirupsen/logrus"
"io/ioutil" "io/ioutil"
"log"
"testing" "testing"
. "github.com/onsi/ginkgo" . "github.com/onsi/ginkgo"
@ -31,5 +31,5 @@ func TestPoller(t *testing.T) {
} }
var _ = BeforeSuite(func() { var _ = BeforeSuite(func() {
log.SetOutput(ioutil.Discard) logrus.SetOutput(ioutil.Discard)
}) })

View File

@ -17,8 +17,8 @@
package repository_test package repository_test
import ( import (
"github.com/sirupsen/logrus"
"io/ioutil" "io/ioutil"
"log"
"testing" "testing"
. "github.com/onsi/ginkgo" . "github.com/onsi/ginkgo"
@ -31,5 +31,5 @@ func TestRepository(t *testing.T) {
} }
var _ = BeforeSuite(func() { var _ = BeforeSuite(func() {
log.SetOutput(ioutil.Discard) logrus.SetOutput(ioutil.Discard)
}) })

View File

@ -17,8 +17,8 @@
package retriever_test package retriever_test
import ( import (
"github.com/sirupsen/logrus"
"io/ioutil" "io/ioutil"
"log"
"testing" "testing"
. "github.com/onsi/ginkgo" . "github.com/onsi/ginkgo"
@ -31,5 +31,5 @@ func TestRetriever(t *testing.T) {
} }
var _ = BeforeSuite(func() { var _ = BeforeSuite(func() {
log.SetOutput(ioutil.Discard) logrus.SetOutput(ioutil.Discard)
}) })

View File

@ -1,6 +1,8 @@
package flop_kick_test package flop_kick_test
import ( import (
"github.com/sirupsen/logrus"
"io/ioutil"
"testing" "testing"
. "github.com/onsi/ginkgo" . "github.com/onsi/ginkgo"
@ -11,3 +13,7 @@ func TestFlopKick(t *testing.T) {
RegisterFailHandler(Fail) RegisterFailHandler(Fail)
RunSpecs(t, "FlopKick Suite") RunSpecs(t, "FlopKick Suite")
} }
var _ = BeforeSuite(func() {
logrus.SetOutput(ioutil.Discard)
})

View File

@ -1,6 +1,8 @@
package shared_test package shared_test
import ( import (
"github.com/sirupsen/logrus"
"io/ioutil"
"testing" "testing"
. "github.com/onsi/ginkgo" . "github.com/onsi/ginkgo"
@ -11,3 +13,7 @@ func TestShared(t *testing.T) {
RegisterFailHandler(Fail) RegisterFailHandler(Fail)
RunSpecs(t, "Shared Suite") RunSpecs(t, "Shared Suite")
} }
var _ = BeforeSuite(func() {
logrus.SetOutput(ioutil.Discard)
})

View File

@ -17,6 +17,8 @@
package maker_test package maker_test
import ( import (
"github.com/sirupsen/logrus"
"io/ioutil"
"testing" "testing"
. "github.com/onsi/ginkgo" . "github.com/onsi/ginkgo"
@ -27,3 +29,7 @@ func TestMaker(t *testing.T) {
RegisterFailHandler(Fail) RegisterFailHandler(Fail)
RunSpecs(t, "Maker Suite") RunSpecs(t, "Maker Suite")
} }
var _ = BeforeSuite(func() {
logrus.SetOutput(ioutil.Discard)
})

View File

@ -1,6 +1,8 @@
package pit_test package pit_test
import ( import (
"github.com/sirupsen/logrus"
"io/ioutil"
"testing" "testing"
. "github.com/onsi/ginkgo" . "github.com/onsi/ginkgo"
@ -11,3 +13,7 @@ func TestPit(t *testing.T) {
RegisterFailHandler(Fail) RegisterFailHandler(Fail)
RunSpecs(t, "Pit Suite") RunSpecs(t, "Pit Suite")
} }
var _ = BeforeSuite(func() {
logrus.SetOutput(ioutil.Discard)
})

View File

@ -1,6 +1,8 @@
package vat_test package vat_test
import ( import (
"github.com/sirupsen/logrus"
"io/ioutil"
"testing" "testing"
. "github.com/onsi/ginkgo" . "github.com/onsi/ginkgo"
@ -11,3 +13,7 @@ func TestVat(t *testing.T) {
RegisterFailHandler(Fail) RegisterFailHandler(Fail)
RunSpecs(t, "Vat Suite") RunSpecs(t, "Vat Suite")
} }
var _ = BeforeSuite(func() {
logrus.SetOutput(ioutil.Discard)
})

View File

@ -17,6 +17,8 @@
package shared_test package shared_test
import ( import (
"github.com/sirupsen/logrus"
"io/ioutil"
"testing" "testing"
. "github.com/onsi/ginkgo" . "github.com/onsi/ginkgo"
@ -27,3 +29,7 @@ func TestShared(t *testing.T) {
RegisterFailHandler(Fail) RegisterFailHandler(Fail)
RunSpecs(t, "Shared Suite") RunSpecs(t, "Shared Suite")
} }
var _ = BeforeSuite(func() {
logrus.SetOutput(ioutil.Discard)
})