From 189f2a3ca3cb8c89bcd2395b3ccd424bd501d578 Mon Sep 17 00:00:00 2001 From: Pushkar Mishra Date: Thu, 4 Jan 2024 10:06:39 +0530 Subject: [PATCH 1/3] added tests for examples Signed-off-by: Pushkar Mishra --- examples/hotrod/cmd/.nocover | 1 - examples/hotrod/cmd/empty_test.go | 24 +++++++++++++++++++ examples/hotrod/pkg/delay/.nocover | 1 - examples/hotrod/pkg/delay/empty_test.go | 24 +++++++++++++++++++ examples/hotrod/pkg/httperr/.nocover | 1 - examples/hotrod/pkg/httperr/empty_test.go | 24 +++++++++++++++++++ examples/hotrod/pkg/log/.nocover | 1 - examples/hotrod/pkg/log/empty_test.go | 24 +++++++++++++++++++ examples/hotrod/pkg/pool/.nocover | 1 - examples/hotrod/pkg/pool/empty_test.go | 24 +++++++++++++++++++ examples/hotrod/pkg/tracing/.nocover | 1 - examples/hotrod/pkg/tracing/empty_test.go | 24 +++++++++++++++++++ examples/hotrod/services/config/.nocover | 1 - examples/hotrod/services/config/empty_test.go | 24 +++++++++++++++++++ examples/hotrod/services/customer/.nocover | 1 - .../hotrod/services/customer/empty_test.go | 24 +++++++++++++++++++ examples/hotrod/services/driver/.nocover | 1 - examples/hotrod/services/driver/empty_test.go | 24 +++++++++++++++++++ examples/hotrod/services/frontend/.nocover | 1 - .../hotrod/services/frontend/empty_test.go | 24 +++++++++++++++++++ examples/hotrod/services/route/.nocover | 1 - examples/hotrod/services/route/empty_test.go | 24 +++++++++++++++++++ 22 files changed, 264 insertions(+), 11 deletions(-) delete mode 100644 examples/hotrod/cmd/.nocover create mode 100644 examples/hotrod/cmd/empty_test.go delete mode 100644 examples/hotrod/pkg/delay/.nocover create mode 100644 examples/hotrod/pkg/delay/empty_test.go delete mode 100644 examples/hotrod/pkg/httperr/.nocover create mode 100644 examples/hotrod/pkg/httperr/empty_test.go delete mode 100644 examples/hotrod/pkg/log/.nocover create mode 100644 examples/hotrod/pkg/log/empty_test.go delete mode 100644 examples/hotrod/pkg/pool/.nocover create mode 100644 examples/hotrod/pkg/pool/empty_test.go delete mode 100644 examples/hotrod/pkg/tracing/.nocover create mode 100644 examples/hotrod/pkg/tracing/empty_test.go delete mode 100644 examples/hotrod/services/config/.nocover create mode 100644 examples/hotrod/services/config/empty_test.go delete mode 100644 examples/hotrod/services/customer/.nocover create mode 100644 examples/hotrod/services/customer/empty_test.go delete mode 100644 examples/hotrod/services/driver/.nocover create mode 100644 examples/hotrod/services/driver/empty_test.go delete mode 100644 examples/hotrod/services/frontend/.nocover create mode 100644 examples/hotrod/services/frontend/empty_test.go delete mode 100644 examples/hotrod/services/route/.nocover create mode 100644 examples/hotrod/services/route/empty_test.go diff --git a/examples/hotrod/cmd/.nocover b/examples/hotrod/cmd/.nocover deleted file mode 100644 index 1e107f52e47..00000000000 --- a/examples/hotrod/cmd/.nocover +++ /dev/null @@ -1 +0,0 @@ -examples diff --git a/examples/hotrod/cmd/empty_test.go b/examples/hotrod/cmd/empty_test.go new file mode 100644 index 00000000000..49e3db99bfe --- /dev/null +++ b/examples/hotrod/cmd/empty_test.go @@ -0,0 +1,24 @@ +// Copyright (c) 2024 The Jaeger Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package cmd + +import ( + "testing" +) + +func TestDummy(t *testing.T) { + // This is a dummy test in the root package. + // Without it `go test -v .` prints "testing: warning: no tests to run". +} diff --git a/examples/hotrod/pkg/delay/.nocover b/examples/hotrod/pkg/delay/.nocover deleted file mode 100644 index 1e107f52e47..00000000000 --- a/examples/hotrod/pkg/delay/.nocover +++ /dev/null @@ -1 +0,0 @@ -examples diff --git a/examples/hotrod/pkg/delay/empty_test.go b/examples/hotrod/pkg/delay/empty_test.go new file mode 100644 index 00000000000..166cdecfc8f --- /dev/null +++ b/examples/hotrod/pkg/delay/empty_test.go @@ -0,0 +1,24 @@ +// Copyright (c) 2024 The Jaeger Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package delay + +import ( + "testing" +) + +func TestDummy(t *testing.T) { + // This is a dummy test in the root package. + // Without it `go test -v .` prints "testing: warning: no tests to run". +} diff --git a/examples/hotrod/pkg/httperr/.nocover b/examples/hotrod/pkg/httperr/.nocover deleted file mode 100644 index 1e107f52e47..00000000000 --- a/examples/hotrod/pkg/httperr/.nocover +++ /dev/null @@ -1 +0,0 @@ -examples diff --git a/examples/hotrod/pkg/httperr/empty_test.go b/examples/hotrod/pkg/httperr/empty_test.go new file mode 100644 index 00000000000..99bdef9a848 --- /dev/null +++ b/examples/hotrod/pkg/httperr/empty_test.go @@ -0,0 +1,24 @@ +// Copyright (c) 2024 The Jaeger Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package httperr + +import ( + "testing" +) + +func TestDummy(t *testing.T) { + // This is a dummy test in the root package. + // Without it `go test -v .` prints "testing: warning: no tests to run". +} diff --git a/examples/hotrod/pkg/log/.nocover b/examples/hotrod/pkg/log/.nocover deleted file mode 100644 index 1e107f52e47..00000000000 --- a/examples/hotrod/pkg/log/.nocover +++ /dev/null @@ -1 +0,0 @@ -examples diff --git a/examples/hotrod/pkg/log/empty_test.go b/examples/hotrod/pkg/log/empty_test.go new file mode 100644 index 00000000000..58cf67207e5 --- /dev/null +++ b/examples/hotrod/pkg/log/empty_test.go @@ -0,0 +1,24 @@ +// Copyright (c) 2024 The Jaeger Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package log + +import ( + "testing" +) + +func TestDummy(t *testing.T) { + // This is a dummy test in the root package. + // Without it `go test -v .` prints "testing: warning: no tests to run". +} diff --git a/examples/hotrod/pkg/pool/.nocover b/examples/hotrod/pkg/pool/.nocover deleted file mode 100644 index 1e107f52e47..00000000000 --- a/examples/hotrod/pkg/pool/.nocover +++ /dev/null @@ -1 +0,0 @@ -examples diff --git a/examples/hotrod/pkg/pool/empty_test.go b/examples/hotrod/pkg/pool/empty_test.go new file mode 100644 index 00000000000..5e7198d4846 --- /dev/null +++ b/examples/hotrod/pkg/pool/empty_test.go @@ -0,0 +1,24 @@ +// Copyright (c) 2024 The Jaeger Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package pool + +import ( + "testing" +) + +func TestDummy(t *testing.T) { + // This is a dummy test in the root package. + // Without it `go test -v .` prints "testing: warning: no tests to run". +} diff --git a/examples/hotrod/pkg/tracing/.nocover b/examples/hotrod/pkg/tracing/.nocover deleted file mode 100644 index 1e107f52e47..00000000000 --- a/examples/hotrod/pkg/tracing/.nocover +++ /dev/null @@ -1 +0,0 @@ -examples diff --git a/examples/hotrod/pkg/tracing/empty_test.go b/examples/hotrod/pkg/tracing/empty_test.go new file mode 100644 index 00000000000..f4439100724 --- /dev/null +++ b/examples/hotrod/pkg/tracing/empty_test.go @@ -0,0 +1,24 @@ +// Copyright (c) 2024 The Jaeger Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package tracing + +import ( + "testing" +) + +func TestDummy(t *testing.T) { + // This is a dummy test in the root package. + // Without it `go test -v .` prints "testing: warning: no tests to run". +} diff --git a/examples/hotrod/services/config/.nocover b/examples/hotrod/services/config/.nocover deleted file mode 100644 index 1e107f52e47..00000000000 --- a/examples/hotrod/services/config/.nocover +++ /dev/null @@ -1 +0,0 @@ -examples diff --git a/examples/hotrod/services/config/empty_test.go b/examples/hotrod/services/config/empty_test.go new file mode 100644 index 00000000000..ff99d3f113f --- /dev/null +++ b/examples/hotrod/services/config/empty_test.go @@ -0,0 +1,24 @@ +// Copyright (c) 2024 The Jaeger Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package config + +import ( + "testing" +) + +func TestDummy(t *testing.T) { + // This is a dummy test in the root package. + // Without it `go test -v .` prints "testing: warning: no tests to run". +} diff --git a/examples/hotrod/services/customer/.nocover b/examples/hotrod/services/customer/.nocover deleted file mode 100644 index 1e107f52e47..00000000000 --- a/examples/hotrod/services/customer/.nocover +++ /dev/null @@ -1 +0,0 @@ -examples diff --git a/examples/hotrod/services/customer/empty_test.go b/examples/hotrod/services/customer/empty_test.go new file mode 100644 index 00000000000..78e5b0542aa --- /dev/null +++ b/examples/hotrod/services/customer/empty_test.go @@ -0,0 +1,24 @@ +// Copyright (c) 2024 The Jaeger Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package customer + +import ( + "testing" +) + +func TestDummy(t *testing.T) { + // This is a dummy test in the root package. + // Without it `go test -v .` prints "testing: warning: no tests to run". +} diff --git a/examples/hotrod/services/driver/.nocover b/examples/hotrod/services/driver/.nocover deleted file mode 100644 index 1e107f52e47..00000000000 --- a/examples/hotrod/services/driver/.nocover +++ /dev/null @@ -1 +0,0 @@ -examples diff --git a/examples/hotrod/services/driver/empty_test.go b/examples/hotrod/services/driver/empty_test.go new file mode 100644 index 00000000000..dfe24836f99 --- /dev/null +++ b/examples/hotrod/services/driver/empty_test.go @@ -0,0 +1,24 @@ +// Copyright (c) 2024 The Jaeger Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package driver + +import ( + "testing" +) + +func TestDummy(t *testing.T) { + // This is a dummy test in the root package. + // Without it `go test -v .` prints "testing: warning: no tests to run". +} diff --git a/examples/hotrod/services/frontend/.nocover b/examples/hotrod/services/frontend/.nocover deleted file mode 100644 index 1e107f52e47..00000000000 --- a/examples/hotrod/services/frontend/.nocover +++ /dev/null @@ -1 +0,0 @@ -examples diff --git a/examples/hotrod/services/frontend/empty_test.go b/examples/hotrod/services/frontend/empty_test.go new file mode 100644 index 00000000000..501fb3ba414 --- /dev/null +++ b/examples/hotrod/services/frontend/empty_test.go @@ -0,0 +1,24 @@ +// Copyright (c) 2024 The Jaeger Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package frontend + +import ( + "testing" +) + +func TestDummy(t *testing.T) { + // This is a dummy test in the root package. + // Without it `go test -v .` prints "testing: warning: no tests to run". +} diff --git a/examples/hotrod/services/route/.nocover b/examples/hotrod/services/route/.nocover deleted file mode 100644 index 1e107f52e47..00000000000 --- a/examples/hotrod/services/route/.nocover +++ /dev/null @@ -1 +0,0 @@ -examples diff --git a/examples/hotrod/services/route/empty_test.go b/examples/hotrod/services/route/empty_test.go new file mode 100644 index 00000000000..c18c37bacfb --- /dev/null +++ b/examples/hotrod/services/route/empty_test.go @@ -0,0 +1,24 @@ +// Copyright (c) 2024 The Jaeger Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package route + +import ( + "testing" +) + +func TestDummy(t *testing.T) { + // This is a dummy test in the root package. + // Without it `go test -v .` prints "testing: warning: no tests to run". +} From 3b07525c9dd9ec965ed7fb50e1a1ab3aeabf9edd Mon Sep 17 00:00:00 2001 From: Pushkar Mishra Date: Thu, 4 Jan 2024 22:21:04 +0530 Subject: [PATCH 2/3] fix Signed-off-by: Pushkar Mishra --- .codecov.yml | 1 + examples/hotrod/cmd/empty_test.go | 6 ++++++ examples/hotrod/pkg/delay/empty_test.go | 6 ++++++ examples/hotrod/pkg/httperr/empty_test.go | 6 ++++++ examples/hotrod/pkg/log/empty_test.go | 6 ++++++ examples/hotrod/pkg/pool/empty_test.go | 6 ++++++ examples/hotrod/pkg/tracing/empty_test.go | 6 ++++++ examples/hotrod/services/config/empty_test.go | 6 ++++++ examples/hotrod/services/customer/empty_test.go | 6 ++++++ examples/hotrod/services/driver/empty_test.go | 6 ++++++ examples/hotrod/services/frontend/empty_test.go | 6 ++++++ examples/hotrod/services/route/empty_test.go | 6 ++++++ 12 files changed, 67 insertions(+) diff --git a/.codecov.yml b/.codecov.yml index fde387c8d7a..58e1eb75695 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -11,6 +11,7 @@ ignore: - "thrift-gen/*/*" - "**/thrift-0.9.2/*" - "**/main.go" + - "examples/hotrod" coverage: precision: 2 diff --git a/examples/hotrod/cmd/empty_test.go b/examples/hotrod/cmd/empty_test.go index 49e3db99bfe..814ecb34ab9 100644 --- a/examples/hotrod/cmd/empty_test.go +++ b/examples/hotrod/cmd/empty_test.go @@ -16,9 +16,15 @@ package cmd import ( "testing" + + "go.uber.org/goleak" ) func TestDummy(t *testing.T) { // This is a dummy test in the root package. // Without it `go test -v .` prints "testing: warning: no tests to run". } + +func TestMain(m *testing.M) { + goleak.VerifyTestMain(m) +} diff --git a/examples/hotrod/pkg/delay/empty_test.go b/examples/hotrod/pkg/delay/empty_test.go index 166cdecfc8f..8b03d081241 100644 --- a/examples/hotrod/pkg/delay/empty_test.go +++ b/examples/hotrod/pkg/delay/empty_test.go @@ -16,9 +16,15 @@ package delay import ( "testing" + + "go.uber.org/goleak" ) func TestDummy(t *testing.T) { // This is a dummy test in the root package. // Without it `go test -v .` prints "testing: warning: no tests to run". } + +func TestMain(m *testing.M) { + goleak.VerifyTestMain(m) +} diff --git a/examples/hotrod/pkg/httperr/empty_test.go b/examples/hotrod/pkg/httperr/empty_test.go index 99bdef9a848..018e1b37637 100644 --- a/examples/hotrod/pkg/httperr/empty_test.go +++ b/examples/hotrod/pkg/httperr/empty_test.go @@ -16,9 +16,15 @@ package httperr import ( "testing" + + "go.uber.org/goleak" ) func TestDummy(t *testing.T) { // This is a dummy test in the root package. // Without it `go test -v .` prints "testing: warning: no tests to run". } + +func TestMain(m *testing.M) { + goleak.VerifyTestMain(m) +} diff --git a/examples/hotrod/pkg/log/empty_test.go b/examples/hotrod/pkg/log/empty_test.go index 58cf67207e5..6122dbd3e40 100644 --- a/examples/hotrod/pkg/log/empty_test.go +++ b/examples/hotrod/pkg/log/empty_test.go @@ -16,9 +16,15 @@ package log import ( "testing" + + "go.uber.org/goleak" ) func TestDummy(t *testing.T) { // This is a dummy test in the root package. // Without it `go test -v .` prints "testing: warning: no tests to run". } + +func TestMain(m *testing.M) { + goleak.VerifyTestMain(m) +} diff --git a/examples/hotrod/pkg/pool/empty_test.go b/examples/hotrod/pkg/pool/empty_test.go index 5e7198d4846..aeb56fecc11 100644 --- a/examples/hotrod/pkg/pool/empty_test.go +++ b/examples/hotrod/pkg/pool/empty_test.go @@ -16,9 +16,15 @@ package pool import ( "testing" + + "go.uber.org/goleak" ) func TestDummy(t *testing.T) { // This is a dummy test in the root package. // Without it `go test -v .` prints "testing: warning: no tests to run". } + +func TestMain(m *testing.M) { + goleak.VerifyTestMain(m) +} diff --git a/examples/hotrod/pkg/tracing/empty_test.go b/examples/hotrod/pkg/tracing/empty_test.go index f4439100724..273f0d3123e 100644 --- a/examples/hotrod/pkg/tracing/empty_test.go +++ b/examples/hotrod/pkg/tracing/empty_test.go @@ -16,9 +16,15 @@ package tracing import ( "testing" + + "go.uber.org/goleak" ) func TestDummy(t *testing.T) { // This is a dummy test in the root package. // Without it `go test -v .` prints "testing: warning: no tests to run". } + +func TestMain(m *testing.M) { + goleak.VerifyTestMain(m) +} diff --git a/examples/hotrod/services/config/empty_test.go b/examples/hotrod/services/config/empty_test.go index ff99d3f113f..bab08ab2ca5 100644 --- a/examples/hotrod/services/config/empty_test.go +++ b/examples/hotrod/services/config/empty_test.go @@ -16,9 +16,15 @@ package config import ( "testing" + + "go.uber.org/goleak" ) func TestDummy(t *testing.T) { // This is a dummy test in the root package. // Without it `go test -v .` prints "testing: warning: no tests to run". } + +func TestMain(m *testing.M) { + goleak.VerifyTestMain(m) +} diff --git a/examples/hotrod/services/customer/empty_test.go b/examples/hotrod/services/customer/empty_test.go index 78e5b0542aa..9de1ca833bd 100644 --- a/examples/hotrod/services/customer/empty_test.go +++ b/examples/hotrod/services/customer/empty_test.go @@ -16,9 +16,15 @@ package customer import ( "testing" + + "go.uber.org/goleak" ) func TestDummy(t *testing.T) { // This is a dummy test in the root package. // Without it `go test -v .` prints "testing: warning: no tests to run". } + +func TestMain(m *testing.M) { + goleak.VerifyTestMain(m) +} diff --git a/examples/hotrod/services/driver/empty_test.go b/examples/hotrod/services/driver/empty_test.go index dfe24836f99..3cee4962b5f 100644 --- a/examples/hotrod/services/driver/empty_test.go +++ b/examples/hotrod/services/driver/empty_test.go @@ -16,9 +16,15 @@ package driver import ( "testing" + + "go.uber.org/goleak" ) func TestDummy(t *testing.T) { // This is a dummy test in the root package. // Without it `go test -v .` prints "testing: warning: no tests to run". } + +func TestMain(m *testing.M) { + goleak.VerifyTestMain(m) +} diff --git a/examples/hotrod/services/frontend/empty_test.go b/examples/hotrod/services/frontend/empty_test.go index 501fb3ba414..61cc75bb652 100644 --- a/examples/hotrod/services/frontend/empty_test.go +++ b/examples/hotrod/services/frontend/empty_test.go @@ -16,9 +16,15 @@ package frontend import ( "testing" + + "go.uber.org/goleak" ) func TestDummy(t *testing.T) { // This is a dummy test in the root package. // Without it `go test -v .` prints "testing: warning: no tests to run". } + +func TestMain(m *testing.M) { + goleak.VerifyTestMain(m) +} diff --git a/examples/hotrod/services/route/empty_test.go b/examples/hotrod/services/route/empty_test.go index c18c37bacfb..1ba09adcae1 100644 --- a/examples/hotrod/services/route/empty_test.go +++ b/examples/hotrod/services/route/empty_test.go @@ -16,9 +16,15 @@ package route import ( "testing" + + "go.uber.org/goleak" ) func TestDummy(t *testing.T) { // This is a dummy test in the root package. // Without it `go test -v .` prints "testing: warning: no tests to run". } + +func TestMain(m *testing.M) { + goleak.VerifyTestMain(m) +} From ca69919ba24abfb5630bf710c6a94791e22e5db3 Mon Sep 17 00:00:00 2001 From: Pushkar Mishra Date: Thu, 4 Jan 2024 22:38:55 +0530 Subject: [PATCH 3/3] fix Signed-off-by: Pushkar Mishra --- examples/hotrod/cmd/empty_test.go | 5 ----- examples/hotrod/pkg/delay/empty_test.go | 5 ----- examples/hotrod/pkg/httperr/empty_test.go | 5 ----- examples/hotrod/pkg/log/empty_test.go | 5 ----- examples/hotrod/pkg/pool/empty_test.go | 5 ----- examples/hotrod/pkg/tracing/empty_test.go | 5 ----- examples/hotrod/services/config/empty_test.go | 5 ----- examples/hotrod/services/customer/empty_test.go | 5 ----- examples/hotrod/services/driver/empty_test.go | 5 ----- examples/hotrod/services/frontend/empty_test.go | 5 ----- examples/hotrod/services/route/empty_test.go | 5 ----- 11 files changed, 55 deletions(-) diff --git a/examples/hotrod/cmd/empty_test.go b/examples/hotrod/cmd/empty_test.go index 814ecb34ab9..e81a798d0c3 100644 --- a/examples/hotrod/cmd/empty_test.go +++ b/examples/hotrod/cmd/empty_test.go @@ -20,11 +20,6 @@ import ( "go.uber.org/goleak" ) -func TestDummy(t *testing.T) { - // This is a dummy test in the root package. - // Without it `go test -v .` prints "testing: warning: no tests to run". -} - func TestMain(m *testing.M) { goleak.VerifyTestMain(m) } diff --git a/examples/hotrod/pkg/delay/empty_test.go b/examples/hotrod/pkg/delay/empty_test.go index 8b03d081241..75c6d1e8a8d 100644 --- a/examples/hotrod/pkg/delay/empty_test.go +++ b/examples/hotrod/pkg/delay/empty_test.go @@ -20,11 +20,6 @@ import ( "go.uber.org/goleak" ) -func TestDummy(t *testing.T) { - // This is a dummy test in the root package. - // Without it `go test -v .` prints "testing: warning: no tests to run". -} - func TestMain(m *testing.M) { goleak.VerifyTestMain(m) } diff --git a/examples/hotrod/pkg/httperr/empty_test.go b/examples/hotrod/pkg/httperr/empty_test.go index 018e1b37637..73a7986c991 100644 --- a/examples/hotrod/pkg/httperr/empty_test.go +++ b/examples/hotrod/pkg/httperr/empty_test.go @@ -20,11 +20,6 @@ import ( "go.uber.org/goleak" ) -func TestDummy(t *testing.T) { - // This is a dummy test in the root package. - // Without it `go test -v .` prints "testing: warning: no tests to run". -} - func TestMain(m *testing.M) { goleak.VerifyTestMain(m) } diff --git a/examples/hotrod/pkg/log/empty_test.go b/examples/hotrod/pkg/log/empty_test.go index 6122dbd3e40..313bc0b5a92 100644 --- a/examples/hotrod/pkg/log/empty_test.go +++ b/examples/hotrod/pkg/log/empty_test.go @@ -20,11 +20,6 @@ import ( "go.uber.org/goleak" ) -func TestDummy(t *testing.T) { - // This is a dummy test in the root package. - // Without it `go test -v .` prints "testing: warning: no tests to run". -} - func TestMain(m *testing.M) { goleak.VerifyTestMain(m) } diff --git a/examples/hotrod/pkg/pool/empty_test.go b/examples/hotrod/pkg/pool/empty_test.go index aeb56fecc11..fc9263f8115 100644 --- a/examples/hotrod/pkg/pool/empty_test.go +++ b/examples/hotrod/pkg/pool/empty_test.go @@ -20,11 +20,6 @@ import ( "go.uber.org/goleak" ) -func TestDummy(t *testing.T) { - // This is a dummy test in the root package. - // Without it `go test -v .` prints "testing: warning: no tests to run". -} - func TestMain(m *testing.M) { goleak.VerifyTestMain(m) } diff --git a/examples/hotrod/pkg/tracing/empty_test.go b/examples/hotrod/pkg/tracing/empty_test.go index 273f0d3123e..8f76b53ef73 100644 --- a/examples/hotrod/pkg/tracing/empty_test.go +++ b/examples/hotrod/pkg/tracing/empty_test.go @@ -20,11 +20,6 @@ import ( "go.uber.org/goleak" ) -func TestDummy(t *testing.T) { - // This is a dummy test in the root package. - // Without it `go test -v .` prints "testing: warning: no tests to run". -} - func TestMain(m *testing.M) { goleak.VerifyTestMain(m) } diff --git a/examples/hotrod/services/config/empty_test.go b/examples/hotrod/services/config/empty_test.go index bab08ab2ca5..7b868ab9b52 100644 --- a/examples/hotrod/services/config/empty_test.go +++ b/examples/hotrod/services/config/empty_test.go @@ -20,11 +20,6 @@ import ( "go.uber.org/goleak" ) -func TestDummy(t *testing.T) { - // This is a dummy test in the root package. - // Without it `go test -v .` prints "testing: warning: no tests to run". -} - func TestMain(m *testing.M) { goleak.VerifyTestMain(m) } diff --git a/examples/hotrod/services/customer/empty_test.go b/examples/hotrod/services/customer/empty_test.go index 9de1ca833bd..5df12a80314 100644 --- a/examples/hotrod/services/customer/empty_test.go +++ b/examples/hotrod/services/customer/empty_test.go @@ -20,11 +20,6 @@ import ( "go.uber.org/goleak" ) -func TestDummy(t *testing.T) { - // This is a dummy test in the root package. - // Without it `go test -v .` prints "testing: warning: no tests to run". -} - func TestMain(m *testing.M) { goleak.VerifyTestMain(m) } diff --git a/examples/hotrod/services/driver/empty_test.go b/examples/hotrod/services/driver/empty_test.go index 3cee4962b5f..cf898e03edb 100644 --- a/examples/hotrod/services/driver/empty_test.go +++ b/examples/hotrod/services/driver/empty_test.go @@ -20,11 +20,6 @@ import ( "go.uber.org/goleak" ) -func TestDummy(t *testing.T) { - // This is a dummy test in the root package. - // Without it `go test -v .` prints "testing: warning: no tests to run". -} - func TestMain(m *testing.M) { goleak.VerifyTestMain(m) } diff --git a/examples/hotrod/services/frontend/empty_test.go b/examples/hotrod/services/frontend/empty_test.go index 61cc75bb652..30dd9391ab3 100644 --- a/examples/hotrod/services/frontend/empty_test.go +++ b/examples/hotrod/services/frontend/empty_test.go @@ -20,11 +20,6 @@ import ( "go.uber.org/goleak" ) -func TestDummy(t *testing.T) { - // This is a dummy test in the root package. - // Without it `go test -v .` prints "testing: warning: no tests to run". -} - func TestMain(m *testing.M) { goleak.VerifyTestMain(m) } diff --git a/examples/hotrod/services/route/empty_test.go b/examples/hotrod/services/route/empty_test.go index 1ba09adcae1..bc61c746ce9 100644 --- a/examples/hotrod/services/route/empty_test.go +++ b/examples/hotrod/services/route/empty_test.go @@ -20,11 +20,6 @@ import ( "go.uber.org/goleak" ) -func TestDummy(t *testing.T) { - // This is a dummy test in the root package. - // Without it `go test -v .` prints "testing: warning: no tests to run". -} - func TestMain(m *testing.M) { goleak.VerifyTestMain(m) }