cloudapi: silence logrus in tests
This commit discards the logrus output when the tests are run. That might be a controversial change but the amount of redundant output that drowns the actual failures makes it very hard to work with these tests.
This commit is contained in:
parent
536b7d95c5
commit
4584d05eff
1 changed files with 9 additions and 0 deletions
|
|
@ -1,8 +1,10 @@
|
||||||
package v2
|
package v2
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"io"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
|
"github.com/sirupsen/logrus"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
|
||||||
|
|
@ -11,6 +13,13 @@ import (
|
||||||
"github.com/osbuild/osbuild-composer/internal/common"
|
"github.com/osbuild/osbuild-composer/internal/common"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
// logrus is creating so much output that it drowns the useful
|
||||||
|
// test output and we don't get test anything logrus related
|
||||||
|
// anyway so silence it by default
|
||||||
|
logrus.SetOutput(io.Discard)
|
||||||
|
}
|
||||||
|
|
||||||
func TestSplitExtension(t *testing.T) {
|
func TestSplitExtension(t *testing.T) {
|
||||||
tests := []struct {
|
tests := []struct {
|
||||||
filename string
|
filename string
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue