Skip to content
This repository has been archived by the owner on Aug 31, 2021. It is now read-only.

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Discard logs created during tests
Browse files Browse the repository at this point in the history
- Make sure output is being set to discard for logrus to reduce clutter in the console
rmulhol committed Feb 12, 2019
1 parent ffb2ea8 commit 24ec8e8
Showing 15 changed files with 58 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -17,6 +17,8 @@
package repositories_test

import (
"github.com/sirupsen/logrus"
"io/ioutil"
"testing"

. "github.com/onsi/ginkgo"
@@ -27,3 +29,7 @@ func TestRepositories(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, "Repositories Suite")
}

var _ = BeforeSuite(func() {
logrus.SetOutput(ioutil.Discard)
})
4 changes: 2 additions & 2 deletions pkg/omni/full/retriever/retriever_suite_test.go
Original file line number Diff line number Diff line change
@@ -17,8 +17,8 @@
package retriever_test

import (
"github.com/sirupsen/logrus"
"io/ioutil"
"log"
"testing"

. "github.com/onsi/ginkgo"
@@ -31,5 +31,5 @@ func TestRetriever(t *testing.T) {
}

var _ = BeforeSuite(func() {
log.SetOutput(ioutil.Discard)
logrus.SetOutput(ioutil.Discard)
})
4 changes: 2 additions & 2 deletions pkg/omni/full/transformer/transformer_suite_test.go
Original file line number Diff line number Diff line change
@@ -17,8 +17,8 @@
package transformer_test

import (
"github.com/sirupsen/logrus"
"io/ioutil"
"log"
"testing"

. "github.com/onsi/ginkgo"
@@ -31,5 +31,5 @@ func TestTransformer(t *testing.T) {
}

var _ = BeforeSuite(func() {
log.SetOutput(ioutil.Discard)
logrus.SetOutput(ioutil.Discard)
})
4 changes: 2 additions & 2 deletions pkg/omni/light/repository/repository_suite_test.go
Original file line number Diff line number Diff line change
@@ -17,8 +17,8 @@
package repository_test

import (
"github.com/sirupsen/logrus"
"io/ioutil"
"log"
"testing"

. "github.com/onsi/ginkgo"
@@ -31,5 +31,5 @@ func TestRepository(t *testing.T) {
}

var _ = BeforeSuite(func() {
log.SetOutput(ioutil.Discard)
logrus.SetOutput(ioutil.Discard)
})
4 changes: 2 additions & 2 deletions pkg/omni/light/retriever/retriever_suite_test.go
Original file line number Diff line number Diff line change
@@ -17,8 +17,8 @@
package retriever_test

import (
"github.com/sirupsen/logrus"
"io/ioutil"
"log"
"testing"

. "github.com/onsi/ginkgo"
@@ -31,5 +31,5 @@ func TestRetriever(t *testing.T) {
}

var _ = BeforeSuite(func() {
log.SetOutput(ioutil.Discard)
logrus.SetOutput(ioutil.Discard)
})
4 changes: 2 additions & 2 deletions pkg/omni/light/transformer/transformer_suite_test.go
Original file line number Diff line number Diff line change
@@ -17,8 +17,8 @@
package transformer_test

import (
"github.com/sirupsen/logrus"
"io/ioutil"
"log"
"testing"

. "github.com/onsi/ginkgo"
@@ -31,5 +31,5 @@ func TestTransformer(t *testing.T) {
}

var _ = BeforeSuite(func() {
log.SetOutput(ioutil.Discard)
logrus.SetOutput(ioutil.Discard)
})
4 changes: 2 additions & 2 deletions pkg/omni/shared/poller/poller_suite_test.go
Original file line number Diff line number Diff line change
@@ -17,8 +17,8 @@
package poller_test

import (
"github.com/sirupsen/logrus"
"io/ioutil"
"log"
"testing"

. "github.com/onsi/ginkgo"
@@ -31,5 +31,5 @@ func TestPoller(t *testing.T) {
}

var _ = BeforeSuite(func() {
log.SetOutput(ioutil.Discard)
logrus.SetOutput(ioutil.Discard)
})
4 changes: 2 additions & 2 deletions pkg/omni/shared/repository/repository_suite_test.go
Original file line number Diff line number Diff line change
@@ -17,8 +17,8 @@
package repository_test

import (
"github.com/sirupsen/logrus"
"io/ioutil"
"log"
"testing"

. "github.com/onsi/ginkgo"
@@ -31,5 +31,5 @@ func TestRepository(t *testing.T) {
}

var _ = BeforeSuite(func() {
log.SetOutput(ioutil.Discard)
logrus.SetOutput(ioutil.Discard)
})
4 changes: 2 additions & 2 deletions pkg/omni/shared/retriever/retriever_suite_test.go
Original file line number Diff line number Diff line change
@@ -17,8 +17,8 @@
package retriever_test

import (
"github.com/sirupsen/logrus"
"io/ioutil"
"log"
"testing"

. "github.com/onsi/ginkgo"
@@ -31,5 +31,5 @@ func TestRetriever(t *testing.T) {
}

var _ = BeforeSuite(func() {
log.SetOutput(ioutil.Discard)
logrus.SetOutput(ioutil.Discard)
})
6 changes: 6 additions & 0 deletions pkg/transformers/flop_kick/flop_kick_suite_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package flop_kick_test

import (
"github.com/sirupsen/logrus"
"io/ioutil"
"testing"

. "github.com/onsi/ginkgo"
@@ -11,3 +13,7 @@ func TestFlopKick(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, "FlopKick Suite")
}

var _ = BeforeSuite(func() {
logrus.SetOutput(ioutil.Discard)
})
6 changes: 6 additions & 0 deletions pkg/transformers/shared/shared_suite_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package shared_test

import (
"github.com/sirupsen/logrus"
"io/ioutil"
"testing"

. "github.com/onsi/ginkgo"
@@ -11,3 +13,7 @@ func TestShared(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, "Shared Suite")
}

var _ = BeforeSuite(func() {
logrus.SetOutput(ioutil.Discard)
})
6 changes: 6 additions & 0 deletions pkg/transformers/storage_diffs/maker/maker_suite_test.go
Original file line number Diff line number Diff line change
@@ -17,6 +17,8 @@
package maker_test

import (
"github.com/sirupsen/logrus"
"io/ioutil"
"testing"

. "github.com/onsi/ginkgo"
@@ -27,3 +29,7 @@ func TestMaker(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, "Maker Suite")
}

var _ = BeforeSuite(func() {
logrus.SetOutput(ioutil.Discard)
})
6 changes: 6 additions & 0 deletions pkg/transformers/storage_diffs/maker/pit/pit_suite_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package pit_test

import (
"github.com/sirupsen/logrus"
"io/ioutil"
"testing"

. "github.com/onsi/ginkgo"
@@ -11,3 +13,7 @@ func TestPit(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, "Pit Suite")
}

var _ = BeforeSuite(func() {
logrus.SetOutput(ioutil.Discard)
})
6 changes: 6 additions & 0 deletions pkg/transformers/storage_diffs/maker/vat/vat_suite_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package vat_test

import (
"github.com/sirupsen/logrus"
"io/ioutil"
"testing"

. "github.com/onsi/ginkgo"
@@ -11,3 +13,7 @@ func TestVat(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, "Vat Suite")
}

var _ = BeforeSuite(func() {
logrus.SetOutput(ioutil.Discard)
})
6 changes: 6 additions & 0 deletions pkg/transformers/storage_diffs/shared/shared_suite_test.go
Original file line number Diff line number Diff line change
@@ -17,6 +17,8 @@
package shared_test

import (
"github.com/sirupsen/logrus"
"io/ioutil"
"testing"

. "github.com/onsi/ginkgo"
@@ -27,3 +29,7 @@ func TestShared(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, "Shared Suite")
}

var _ = BeforeSuite(func() {
logrus.SetOutput(ioutil.Discard)
})

0 comments on commit 24ec8e8

Please sign in to comment.