Skip to content

Commit

Permalink
tests: remove logging on tests output (#144)
Browse files Browse the repository at this point in the history
  • Loading branch information
katcipis authored Jan 6, 2022
1 parent 2bee460 commit 1a67cb2
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 0 deletions.
21 changes: 21 additions & 0 deletions cmd/terramate/cli/loglevel_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Copyright 2022 Mineiros GmbH
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package cli_test

import "github.com/rs/zerolog"

func init() {
zerolog.SetGlobalLevel(zerolog.Disabled)
}
5 changes: 5 additions & 0 deletions dag/dag_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"github.com/madlambda/spells/assert"
"github.com/madlambda/spells/errutil"
"github.com/mineiros-io/terramate/dag"
"github.com/rs/zerolog"
)

type node struct {
Expand Down Expand Up @@ -308,3 +309,7 @@ func assertOrder(t *testing.T, want, got []dag.ID) {
assert.EqualStrings(t, string(w), string(got[i]), "id %d mismatch", i)
}
}

func init() {
zerolog.SetGlobalLevel(zerolog.Disabled)
}
5 changes: 5 additions & 0 deletions generate/generate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import (
"github.com/mineiros-io/terramate/test"
"github.com/mineiros-io/terramate/test/hclwrite"
"github.com/mineiros-io/terramate/test/sandbox"
"github.com/rs/zerolog"
)

func TestGenerateFailsIfPathDoesntExist(t *testing.T) {
Expand Down Expand Up @@ -1360,3 +1361,7 @@ func findFiles(t *testing.T, rootdir string, filename string) []string {

return found
}

func init() {
zerolog.SetGlobalLevel(zerolog.Disabled)
}
5 changes: 5 additions & 0 deletions git/git_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
"github.com/mineiros-io/terramate/git"
"github.com/mineiros-io/terramate/test"
"github.com/mineiros-io/terramate/test/sandbox"
"github.com/rs/zerolog"
)

const CookedCommitID = "4e991b55e3d58b9c3137a791a9986ed9c5069697"
Expand Down Expand Up @@ -380,3 +381,7 @@ func assertEqualRemotes(t *testing.T, got []git.Remote, want []git.Remote) {
)
}
}

func init() {
zerolog.SetGlobalLevel(zerolog.Disabled)
}
5 changes: 5 additions & 0 deletions hcl/hcl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"github.com/madlambda/spells/assert"
"github.com/mineiros-io/terramate/hcl"
"github.com/mineiros-io/terramate/test"
"github.com/rs/zerolog"
)

type want struct {
Expand Down Expand Up @@ -756,3 +757,7 @@ func testParser(t *testing.T, tc testcase) {
}
})
}

func init() {
zerolog.SetGlobalLevel(zerolog.Disabled)
}
21 changes: 21 additions & 0 deletions loglevel_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Copyright 2022 Mineiros GmbH
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package terramate_test

import "github.com/rs/zerolog"

func init() {
zerolog.SetGlobalLevel(zerolog.Disabled)
}

0 comments on commit 1a67cb2

Please sign in to comment.