-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: generate Go boilerplate to disable logging in tests.
Signed-off-by: i4k <[email protected]>
- Loading branch information
Showing
74 changed files
with
442 additions
and
135 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// Copyright 2024 Terramate GmbH | ||
// SPDX-License-Identifier: MPL-2.0 | ||
|
||
package deployment_test | ||
|
||
import "github.com/rs/zerolog" | ||
|
||
func init() { | ||
zerolog.SetGlobalLevel(zerolog.Disabled) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// Copyright 2024 Terramate GmbH | ||
// SPDX-License-Identifier: MPL-2.0 | ||
|
||
package drift_test | ||
|
||
import "github.com/rs/zerolog" | ||
|
||
func init() { | ||
zerolog.SetGlobalLevel(zerolog.Disabled) | ||
} |
2 changes: 1 addition & 1 deletion
2
e2etests/cloud/loglevel_test.go → cloud/loglevel_disable_test.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// Copyright 2024 Terramate GmbH | ||
// SPDX-License-Identifier: MPL-2.0 | ||
|
||
package preview_test | ||
|
||
import "github.com/rs/zerolog" | ||
|
||
func init() { | ||
zerolog.SetGlobalLevel(zerolog.Disabled) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// Copyright 2024 Terramate GmbH | ||
// SPDX-License-Identifier: MPL-2.0 | ||
|
||
package cloudstore_test | ||
|
||
import "github.com/rs/zerolog" | ||
|
||
func init() { | ||
zerolog.SetGlobalLevel(zerolog.Disabled) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// Copyright 2024 Terramate GmbH | ||
// SPDX-License-Identifier: MPL-2.0 | ||
|
||
package testserver_test | ||
|
||
import "github.com/rs/zerolog" | ||
|
||
func init() { | ||
zerolog.SetGlobalLevel(zerolog.Disabled) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
loglevel_test.go → ...te/cli/cliconfig/loglevel_disable_test.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// Copyright 2024 Terramate GmbH | ||
// SPDX-License-Identifier: MPL-2.0 | ||
|
||
package github_test | ||
|
||
import "github.com/rs/zerolog" | ||
|
||
func init() { | ||
zerolog.SetGlobalLevel(zerolog.Disabled) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// Copyright 2024 Terramate GmbH | ||
// SPDX-License-Identifier: MPL-2.0 | ||
|
||
package gitlab_test | ||
|
||
import "github.com/rs/zerolog" | ||
|
||
func init() { | ||
zerolog.SetGlobalLevel(zerolog.Disabled) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// Copyright 2024 Terramate GmbH | ||
// SPDX-License-Identifier: MPL-2.0 | ||
|
||
package out_test | ||
|
||
import "github.com/rs/zerolog" | ||
|
||
func init() { | ||
zerolog.SetGlobalLevel(zerolog.Disabled) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// Copyright 2024 Terramate GmbH | ||
// SPDX-License-Identifier: MPL-2.0 | ||
|
||
package filter_test | ||
|
||
import "github.com/rs/zerolog" | ||
|
||
func init() { | ||
zerolog.SetGlobalLevel(zerolog.Disabled) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// Copyright 2024 Terramate GmbH | ||
// SPDX-License-Identifier: MPL-2.0 | ||
|
||
package config_test | ||
|
||
import "github.com/rs/zerolog" | ||
|
||
func init() { | ||
zerolog.SetGlobalLevel(zerolog.Disabled) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// Copyright 2024 Terramate GmbH | ||
// SPDX-License-Identifier: MPL-2.0 | ||
|
||
package cloud_test | ||
|
||
import "github.com/rs/zerolog" | ||
|
||
func init() { | ||
zerolog.SetGlobalLevel(zerolog.Disabled) | ||
} |
2 changes: 1 addition & 1 deletion
2
e2etests/core/disable_loglevel_test.go → e2etests/core/loglevel_disable_test.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// Copyright 2024 Terramate GmbH | ||
// SPDX-License-Identifier: MPL-2.0 | ||
|
||
package errors_test | ||
|
||
import "github.com/rs/zerolog" | ||
|
||
func init() { | ||
zerolog.SetGlobalLevel(zerolog.Disabled) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// Copyright 2024 Terramate GmbH | ||
// SPDX-License-Identifier: MPL-2.0 | ||
|
||
package event_test | ||
|
||
import "github.com/rs/zerolog" | ||
|
||
func init() { | ||
zerolog.SetGlobalLevel(zerolog.Disabled) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// Copyright 2024 Terramate GmbH | ||
// SPDX-License-Identifier: MPL-2.0 | ||
|
||
package fs_test | ||
|
||
import "github.com/rs/zerolog" | ||
|
||
func init() { | ||
zerolog.SetGlobalLevel(zerolog.Disabled) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// Copyright 2024 Terramate GmbH | ||
// SPDX-License-Identifier: MPL-2.0 | ||
|
||
package genfile_test | ||
|
||
import "github.com/rs/zerolog" | ||
|
||
func init() { | ||
zerolog.SetGlobalLevel(zerolog.Disabled) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// Copyright 2024 Terramate GmbH | ||
// SPDX-License-Identifier: MPL-2.0 | ||
|
||
package genhcl_test | ||
|
||
import "github.com/rs/zerolog" | ||
|
||
func init() { | ||
zerolog.SetGlobalLevel(zerolog.Disabled) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// Copyright 2024 Terramate GmbH | ||
// SPDX-License-Identifier: MPL-2.0 | ||
|
||
package generate_test | ||
|
||
import "github.com/rs/zerolog" | ||
|
||
func init() { | ||
zerolog.SetGlobalLevel(zerolog.Disabled) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// Copyright 2024 Terramate GmbH | ||
// SPDX-License-Identifier: MPL-2.0 | ||
|
||
globals { | ||
# you can enable this only in the stack you are debugging the tests. | ||
enable_test_logging = false | ||
|
||
is_go_package = tm_anytrue([ | ||
tm_contains(terramate.stack.tags, "golang"), | ||
tm_contains(terramate.stack.tags, "e2etests"), | ||
]) | ||
has_test_files = tm_length(tm_fileset(".", "*_test.go")) > 0 | ||
} | ||
|
||
generate_file "loglevel_disable_test.go" { | ||
condition = !global.enable_test_logging && global.is_go_package && global.has_test_files | ||
lets { | ||
special_cases = { | ||
"ls" = "tmls" | ||
"/" = "terramate" | ||
} | ||
is_main = tm_can(tm_file("main.go")) | ||
basename = terramate.stack.path.basename | ||
pkgname = let.is_main ? "main" : tm_try(let.special_cases[let.basename], let.basename) | ||
} | ||
content = <<-EOF | ||
// Copyright 2024 Terramate GmbH | ||
// SPDX-License-Identifier: MPL-2.0 | ||
package ${let.pkgname}_test | ||
import "github.com/rs/zerolog" | ||
func init() { | ||
zerolog.SetGlobalLevel(zerolog.Disabled) | ||
} | ||
EOF | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// Copyright 2024 Terramate GmbH | ||
// SPDX-License-Identifier: MPL-2.0 | ||
|
||
package git_test | ||
|
||
import "github.com/rs/zerolog" | ||
|
||
func init() { | ||
zerolog.SetGlobalLevel(zerolog.Disabled) | ||
} |
Oops, something went wrong.