From 194e272a3b61eaa09240500eb77af832c01af8aa Mon Sep 17 00:00:00 2001 From: Curtis Robert Date: Thu, 9 May 2024 08:13:51 -0700 Subject: [PATCH 1/2] [mdatagen] Run tests when skipping goleak --- cmd/mdatagen/templates/package_test.go.tmpl | 1 + 1 file changed, 1 insertion(+) diff --git a/cmd/mdatagen/templates/package_test.go.tmpl b/cmd/mdatagen/templates/package_test.go.tmpl index bbb4878c527..112501a9eec 100644 --- a/cmd/mdatagen/templates/package_test.go.tmpl +++ b/cmd/mdatagen/templates/package_test.go.tmpl @@ -14,6 +14,7 @@ func TestMain(m *testing.M) { {{- end }} {{- if .Tests.GoLeak.Skip }} // skipping goleak test as per metadata.yml configuration + os.Exit(m.Run()) {{- else }} goleak.VerifyTestMain(m {{- range $val := .Tests.GoLeak.Ignore.Top}}, goleak.IgnoreTopFunction("{{$val}}"){{end}}{{- range $val := .Tests.GoLeak.Ignore.Any}}, goleak.IgnoreAnyFunction("{{$val}}"){{end}} ) {{- end }} From 411407b39ecea58b44657d7833e5630b60745b34 Mon Sep 17 00:00:00 2001 From: Curtis Robert Date: Thu, 9 May 2024 08:24:59 -0700 Subject: [PATCH 2/2] Add changelog --- .chloggen/fix_skip_goleak.yaml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .chloggen/fix_skip_goleak.yaml diff --git a/.chloggen/fix_skip_goleak.yaml b/.chloggen/fix_skip_goleak.yaml new file mode 100644 index 00000000000..7ab790d9c9e --- /dev/null +++ b/.chloggen/fix_skip_goleak.yaml @@ -0,0 +1,25 @@ +# Use this changelog template to create an entry for release notes. + +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: bug_fix + +# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver) +component: mdatagen + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Run package tests when goleak is skipped + +# One or more tracking issues or pull requests related to the change +issues: [10125] + +# (Optional) One or more lines of additional information to render under the primary note. +# These lines will be padded with 2 spaces and then inserted directly into the document. +# Use pipe (|) for multiline entries. +subtext: + +# Optional: The change log or logs in which this entry should be included. +# e.g. '[user]' or '[user, api]' +# Include 'user' if the change is relevant to end users. +# Include 'api' if there is a change to a library API. +# Default: '[user]' +change_logs: []