-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: generate Go boilerplate to disable logging in tests. #1889
Draft
i4ki
wants to merge
3
commits into
main
Choose a base branch
from
i4k-generate-log-disabling
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
|
i4ki
force-pushed
the
i4k-generate-log-disabling
branch
2 times, most recently
from
September 26, 2024 01:03
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 |
i4ki
force-pushed
the
i4k-generate-log-disabling
branch
from
September 26, 2024 15:23
0751458
to
2753c6a
Compare
Signed-off-by: i4k <[email protected]>
…erate-log-disabling
i4ki
force-pushed
the
i4k-generate-log-disabling
branch
from
September 27, 2024 08:23
2753c6a
to
bae9481
Compare
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.go
file.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 = true
in a specific directory.Which issue(s) this PR fixes:
none
Special notes for your reviewer:
Does this PR introduce a user-facing change?