Skip to content
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

fix(tests): no more "log.SetLogger(...) was never called..." log entry during e2e tests #20

Merged
merged 1 commit into from
Mar 18, 2024

Conversation

programmer04
Copy link
Member

What this PR does / why we need it:

During e2e tests the below is logged

test_webhook.go:26: initializing Kubernetes API clients
test_webhook.go:26: intializing manager client
[controller-runtime] log.SetLogger(...) was never called; logs will not be displayed.
Detected at:
    >  goroutine 55 [running]:
    >  runtime/debug.Stack()
    >       /opt/homebrew/Cellar/go/1.22.1/libexec/src/runtime/debug/stack.go:24 +0x6c
    >  sigs.k8s.io/controller-runtime/pkg/log.eventuallyFulfillRoot()
    >       /Users/[email protected]/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/log/log.go:60 +0xc8
    >  sigs.k8s.io/controller-runtime/pkg/log.(*delegatingLogSink).WithName(0xc000a00440, {0x10288d0dc, 0x14})
    >       /Users/[email protected]/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/log/deleg.go:147 +0x38
    >  github.com/go-logr/logr.Logger.WithName({{0x1037bdbd0, 0xc000a00440}, 0x0}, {0x10288d0dc, 0x14})
    >       /Users/[email protected]/go/pkg/mod/github.com/go-logr/[email protected]/logr.go:345 +0x50
    >  sigs.k8s.io/controller-runtime/pkg/client.newClient(0xc000b60008, {0x0, 0x0, {0x0, 0x0}, 0x0, {0x0, 0x0}, 0x0})
    >       /Users/[email protected]/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/client/client.go:129 +0x10c
    >  sigs.k8s.io/controller-runtime/pkg/client.New(0xc000b60008, {0x0, 0x0, {0x0, 0x0}, 0x0, {0x0, 0x0}, 0x0})
    >       /Users/[email protected]/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/client/client.go:110 +0x90
    >  github.com/kong/gateway-operator/test/e2e.CreateEnvironment(0xc000c2fa00, {0x1037b7f00, 0xc000974960}, {0x0, 0x0, 0x10453f5a8?})
    >       /Users/[email protected]/Documents/work/gateway-operator/test/e2e/environment.go:173 +0x10f4
    >  github.com/kong/gateway-operator/test/e2e.TestDataPlaneValidatingWebhook(0xc000c2fa00)
    >       /Users/[email protected]/Documents/work/gateway-operator/test/e2e/test_webhook.go:26 +0x78
    >  testing.tRunner(0xc000c2fa00, 0x10377f7e8)
    >       /opt/homebrew/Cellar/go/1.22.1/libexec/src/testing/testing.go:1689 +0x184
    >  created by testing.(*T).Run in goroutine 52
    >       /opt/homebrew/Cellar/go/1.22.1/libexec/src/testing/testing.go:1742 +0x5e8
test_webhook.go:26: deploying Gateway APIs CRDs from github.com/kubernetes-sigs/gateway-api/config/crd/experimental?ref=v1.0.0
test_webhook.go:26: deploying KIC CRDs from https://github.com/Kong/kubernetes-ingress-controller/config/crd?ref=v3.1.2
test_webhook.go:26: creating system namespaces and serviceaccounts

this PR gets rid of it.

@programmer04 programmer04 self-assigned this Mar 18, 2024
@programmer04 programmer04 requested a review from a team as a code owner March 18, 2024 10:12
@programmer04 programmer04 enabled auto-merge (squash) March 18, 2024 10:12
test/e2e/environment.go Outdated Show resolved Hide resolved
@programmer04 programmer04 merged commit 8427c0c into main Mar 18, 2024
13 checks passed
@programmer04 programmer04 deleted the logger-panic-e2e branch March 18, 2024 10:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants