-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[mdatagen] Automatically generate goleak tests for packages #30483
Comments
Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
Pinging code owners for cmd/mdatagen: @dmitryax. See Adding Labels via Comments if you do not have permissions to add labels yourself. |
Removing |
Currently, the level of granularity between The This means there will need to be a way to have multiple paths provided for generating goleak tests, each with its own configuration options, as proposed. |
Another thing to consider is what I pointed out here, the fact that some packages already have |
As the first step, we should make sure that the test is generated per component/module. Then, we will see if it can be generated per module |
…1689) **Description:** The goal is for `goleak` to be required for every package, and also to be [generated by mdatagen](#30483). Once this is generated by `mdatagen` we'll be able to remove this from manual steps done by the user, but for now it would be good to state the it's required in docs. **Link to tracking Issue:** #30438
…en-telemetry#31689) **Description:** The goal is for `goleak` to be required for every package, and also to be [generated by mdatagen](open-telemetry#30483). Once this is generated by `mdatagen` we'll be able to remove this from manual steps done by the user, but for now it would be good to state the it's required in docs. **Link to tracking Issue:** open-telemetry#30438
…en-telemetry#31689) **Description:** The goal is for `goleak` to be required for every package, and also to be [generated by mdatagen](open-telemetry#30483). Once this is generated by `mdatagen` we'll be able to remove this from manual steps done by the user, but for now it would be good to state the it's required in docs. **Link to tracking Issue:** open-telemetry#30438
This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping |
We can have another option in metadata like
end expect users to implement additionalTestMain in a separate file |
That would be super helpful. There are a number of test suites that rely on an existing However, I believe the way it's written (with The options added here may need to be something like:
And then:
|
This PR pulls in the latest mdatagen that auto-generates goleak package tests. There are still some issues to sort out before being able to use it, but it's mostly there. I've found a few more modules where goleak can be enabled with no additional tests so i've done so as part of this PR Fixes #30483 --------- Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
Component(s)
cmd/mdatagen
Is your feature request related to a problem? Please describe.
While working on #30438 a lot of identical code is being copied into many different places in the repository.
Describe the solution you'd like
As @dmitryax suggested here:
Configurable metadata options:
package_test.go
file is not generated, and even deleted if it currently exists. To my knowledge, there's no way to includeTestMain
with thegoleak
call and also skip the resulting goleak check.goleak.IgnoreTopFunction
. There are sometimes known issues that can't be addressed and irrelevant to the collector itself that can be safely ignored. PR [chore] Enable goleak for tests failing on opencensus-go #30457 has examples of this.The text was updated successfully, but these errors were encountered: