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
Update log level to run tests on debug level #5071
Conversation
Hi @taragu. Thanks for your PR. I'm waiting for a knative member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This changes the default loglevel everywhere. I'm not certain that's what we want, do we?
It actually changes the level nowhere, because it's in the example block. |
@markusthoemmes ahh got it. Is |
That configmap has nothing to do with loglevels I think? I don't know how to approach this issue best tbh. We'll beed to change what we install in the tests before we install it I guess. |
serving.knative.dev/release: devel | ||
|
||
data: | ||
zap-logger-config: | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can leave this out entirely to pick up the default? Not entirely sure though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just tried applying this yaml without this block and the zap-logger-config
was not set
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NewConfigFromConfigMap
function will not pick up logging config without zap-logger-config
key. @markusthoemmes were you talking about labels or the zap-logger-config
key?
cc @andrew-su
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My thought was that we'd only need the specific loglevels below and that the broader loggingconfig would be defaulted in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If both are kubectl applied, then applying this without it will strip it in the three way merge.
/ok-to-test |
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: config-logging |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So for the main file, we symlink it under testdata
and validate it's content in a Go test. Can we do the same here to validate changes? Otherwise this looks good to me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mattmoor Sounds good. Should it be a new test under test/
? Which package should it belong?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd just put it right next to where we test the real config (same test, second symlink)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mattmoor sounds good! Just added the test and symlink
58fd6a9
to
dde6921
Compare
The following tests are currently flaky. Running them again to verify...
Failed non-flaky tests preventing automatic retry of pull-knative-serving-integration-tests:
|
/test pull-knative-serving-integration-tests |
dde6921
to
db5296f
Compare
@markusthoemmes @mattmoor this PR is ready for another review. Would you please take a look? |
pkg/logging/config_test.go
Outdated
@@ -93,6 +95,56 @@ func TestOurConfig(t *testing.T) { | |||
} | |||
} | |||
|
|||
func TestLogLevelTestConfig(t *testing.T) { | |||
wantCfg := `{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const here and the next one.
pkg/logging/config_test.go
Outdated
} | ||
} | ||
if got := cfg.LoggingConfig; got != wantCfg { | ||
t.Errorf("LoggingConfig = %v, want %v, diff %s", got, wantCfg, cmp.Diff(got, wantCfg)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
t.Errorf("LoggingConfig = %v, want %v, diff %s", got, wantCfg, cmp.Diff(got, wantCfg)) | |
t.Errorf("LoggingConfig = %v, want %v, diff(-want +got) %s", got, wantCfg, cmp.Diff(wantCfg, got)) |
(https://godoc.org/github.com/google/go-cmp/cmp#Diff, most (but surely not all) follows this, see the Diff
example)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mattmoor, taragu The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/lint
Fixes #2313
Proposed Changes
Release Note