chore: generate Go boilerplate to disable logging in tests.#1889
Draft
i4ki wants to merge 3 commits into
Draft
Conversation
|
25e6f9d to
0751458
Compare
Preview of ubuntu-focal/go1.21 tests in 454eee3🔍 View Details on Terramate Cloud .
benchmarks/changed
cloud
cloud/deployment
cloud/drift
cloud/preview
cloud/stack
cloud/testserver
cloud/testserver/cloudstore
cmd/terramate/cli/cliconfig
cmd/terramate/cli/github
cmd/terramate/cli/gitlab
cmd/terramate/cli/out
config
config/filter
errors
event
fs
generate
generate/genfile
generate/genhcl
git
globals
hcl
hcl/ast
hcl/eval
hcl/fmt
hcl/info
ls
modvendor/download
printer
project
run
run/dag
scheduler
stack
stack/trigger
stdlib
test
test/hclwrite
test/ls
test/sandbox
tf
tg
versions
e2etests/cloud
e2etests/core |
|
Preview of macos-ventura/go1.21 tests in 454eee3🔍 View Details on Terramate Cloud .
benchmarks/changed
cloud
cloud/deployment
cloud/drift
cloud/preview
cloud/stack
cloud/testserver
cloud/testserver/cloudstore
cmd/terramate/cli/cliconfig
cmd/terramate/cli/github
cmd/terramate/cli/gitlab
cmd/terramate/cli/out
config
config/filter
errors
event
fs
generate
generate/genfile
generate/genhcl
git
globals
hcl
hcl/ast
hcl/eval
hcl/fmt
hcl/info
ls
modvendor/download
printer
project
run
run/dag
scheduler
stack
stack/trigger
stdlib
test
test/hclwrite
test/ls
test/sandbox
tf
tg
versions
e2etests/cloud
e2etests/core |
0751458 to
2753c6a
Compare
Signed-off-by: i4k <t.nateldemoura@gmail.com>
…erate-log-disabling
2753c6a to
bae9481
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it:
By default we disable logging by calling
zerolog.SetGlobalLevel(zerolog.Disabled)in theinit()function of a test file. There's no consistency and sometimes it's done inside an specific test file and sometimes this is done in a separateloglevel_test.gofile.This PR generates this boilerplate file using Terramate, with the additional feature that you can easily re-enable the logging in a specific package by just setting a
global.enable_test_logging = truein a specific directory.Which issue(s) this PR fixes:
none
Special notes for your reviewer:
Does this PR introduce a user-facing change?