-
Notifications
You must be signed in to change notification settings - Fork 479
Add goleak-based package leak checks for pkg/cli and pkg/console tests
#47865
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| //go:build !integration | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing 💡 Suggested fixChange line 1 from: (go/redacted):build !integrationto: (go/redacted):build !integration && !js && !wasmThis matches the constraint pattern in the other wasm-incompatible test files in |
||
|
|
||
| package console | ||
|
|
||
| import ( | ||
| "testing" | ||
|
|
||
| "go.uber.org/goleak" | ||
| ) | ||
|
|
||
| func TestMain(m *testing.M) { | ||
| goleak.VerifyTestMain(m) | ||
| } | ||
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.
[/codebase-design] Missing
//go:build !integrationbuild tag —pkg/console/test_main_test.gohas it butpkg/cli/test_main_test.godoes not. This means goleak runs during integration tests forpkg/clibut not forpkg/console, creating inconsistent leak coverage.💡 Suggested fix
Add the build constraint at the top of
pkg/cli/test_main_test.goto matchpkg/console:Or remove the tag from
pkg/console/test_main_test.goif goleak should cover integration test runs in both packages.@copilot please address this.