diff --git a/cmd/collector/app/processor/empty_test.go b/cmd/collector/app/processor/empty_test.go index 270cab51e63..7d6dcbe2a28 100644 --- a/cmd/collector/app/processor/empty_test.go +++ b/cmd/collector/app/processor/empty_test.go @@ -13,3 +13,13 @@ // limitations under the License. package processor + +import ( + "testing" + + "go.uber.org/goleak" +) + +func TestMain(m *testing.M) { + goleak.VerifyTestMain(m) +} diff --git a/cmd/collector/app/sampling/model/empty_test.go b/cmd/collector/app/sampling/model/empty_test.go index b2766e2b274..c7fedda32c6 100644 --- a/cmd/collector/app/sampling/model/empty_test.go +++ b/cmd/collector/app/sampling/model/empty_test.go @@ -14,8 +14,12 @@ package model -// import "testing" +import ( + "testing" -// func TestNothing(t *testing.T) { -// // just get the code coverage -// } + "go.uber.org/goleak" +) + +func TestMain(m *testing.M) { + goleak.VerifyTestMain(m) +} diff --git a/cmd/collector/app/sampling/strategystore/empty_test.go b/cmd/collector/app/sampling/strategystore/empty_test.go index 3b7e0c6a89c..d39578922f8 100644 --- a/cmd/collector/app/sampling/strategystore/empty_test.go +++ b/cmd/collector/app/sampling/strategystore/empty_test.go @@ -13,3 +13,13 @@ // limitations under the License. package strategystore + +import ( + "testing" + + "go.uber.org/goleak" +) + +func TestMain(m *testing.M) { + goleak.VerifyTestMain(m) +} diff --git a/cmd/ingester/app/builder/empty_test.go b/cmd/ingester/app/builder/empty_test.go index a5945b93110..0498415cd31 100644 --- a/cmd/ingester/app/builder/empty_test.go +++ b/cmd/ingester/app/builder/empty_test.go @@ -13,3 +13,13 @@ // limitations under the License. package builder + +import ( + "testing" + + "go.uber.org/goleak" +) + +func TestMain(m *testing.M) { + goleak.VerifyTestMain(m) +} diff --git a/cmd/query/app/ui/empty_test.go b/cmd/query/app/ui/empty_test.go index d8be28bf20b..a5940340cd9 100644 --- a/cmd/query/app/ui/empty_test.go +++ b/cmd/query/app/ui/empty_test.go @@ -13,3 +13,13 @@ // limitations under the License. package ui + +import ( + "testing" + + "go.uber.org/goleak" +) + +func TestMain(m *testing.M) { + goleak.VerifyTestMain(m) +} diff --git a/empty_test.go b/empty_test.go index 6becea9a8cb..9cdf96af026 100644 --- a/empty_test.go +++ b/empty_test.go @@ -14,9 +14,17 @@ package jaeger -import "testing" +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/model/json/empty_test.go b/model/json/empty_test.go index 08cf7c966e5..7808f78783f 100644 --- a/model/json/empty_test.go +++ b/model/json/empty_test.go @@ -13,3 +13,13 @@ // limitations under the License. package json + +import ( + "testing" + + "go.uber.org/goleak" +) + +func TestMain(m *testing.M) { + goleak.VerifyTestMain(m) +} diff --git a/pkg/cassandra/config/empty_test.go b/pkg/cassandra/config/empty_test.go index be1f5fecf95..f2f65cd0f1d 100644 --- a/pkg/cassandra/config/empty_test.go +++ b/pkg/cassandra/config/empty_test.go @@ -13,3 +13,13 @@ // limitations under the License. package config + +import ( + "testing" + + "go.uber.org/goleak" +) + +func TestMain(m *testing.M) { + goleak.VerifyTestMain(m) +} diff --git a/pkg/cassandra/empty_test.go b/pkg/cassandra/empty_test.go index c29238952d6..e7757976a81 100644 --- a/pkg/cassandra/empty_test.go +++ b/pkg/cassandra/empty_test.go @@ -13,3 +13,13 @@ // limitations under the License. package cassandra + +import ( + "testing" + + "go.uber.org/goleak" +) + +func TestMain(m *testing.M) { + goleak.VerifyTestMain(m) +} diff --git a/pkg/cassandra/gocql/empty_test.go b/pkg/cassandra/gocql/empty_test.go index 1f4faa1d96d..e2de4bfff26 100644 --- a/pkg/cassandra/gocql/empty_test.go +++ b/pkg/cassandra/gocql/empty_test.go @@ -13,3 +13,13 @@ // limitations under the License. package gocql + +import ( + "testing" + + "go.uber.org/goleak" +) + +func TestMain(m *testing.M) { + goleak.VerifyTestMain(m) +} diff --git a/pkg/distributedlock/empty_test.go b/pkg/distributedlock/empty_test.go index 452bf0bd1fa..b9cacc5a43f 100644 --- a/pkg/distributedlock/empty_test.go +++ b/pkg/distributedlock/empty_test.go @@ -13,3 +13,13 @@ // limitations under the License. package distributedlock + +import ( + "testing" + + "go.uber.org/goleak" +) + +func TestMain(m *testing.M) { + goleak.VerifyTestMain(m) +} diff --git a/pkg/es/empty_test.go b/pkg/es/empty_test.go index 70f862cd54e..319b337b7c7 100644 --- a/pkg/es/empty_test.go +++ b/pkg/es/empty_test.go @@ -13,3 +13,13 @@ // limitations under the License. package es + +import ( + "testing" + + "go.uber.org/goleak" +) + +func TestMain(m *testing.M) { + goleak.VerifyTestMain(m) +} diff --git a/pkg/es/wrapper/empty_test.go b/pkg/es/wrapper/empty_test.go index e7b24661b1c..41a096bf192 100644 --- a/pkg/es/wrapper/empty_test.go +++ b/pkg/es/wrapper/empty_test.go @@ -13,3 +13,13 @@ // limitations under the License. package eswrapper + +import ( + "testing" + + "go.uber.org/goleak" +) + +func TestMain(m *testing.M) { + goleak.VerifyTestMain(m) +} diff --git a/pkg/kafka/auth/empty_test.go b/pkg/kafka/auth/empty_test.go index 4a7417794ee..a3fda7a77f6 100644 --- a/pkg/kafka/auth/empty_test.go +++ b/pkg/kafka/auth/empty_test.go @@ -13,3 +13,13 @@ // limitations under the License. package auth + +import ( + "testing" + + "go.uber.org/goleak" +) + +func TestMain(m *testing.M) { + goleak.VerifyTestMain(m) +} diff --git a/pkg/kafka/consumer/empty_test.go b/pkg/kafka/consumer/empty_test.go index 6e8c25455dc..287cb02e5b4 100644 --- a/pkg/kafka/consumer/empty_test.go +++ b/pkg/kafka/consumer/empty_test.go @@ -13,3 +13,13 @@ // limitations under the License. package consumer + +import ( + "testing" + + "go.uber.org/goleak" +) + +func TestMain(m *testing.M) { + goleak.VerifyTestMain(m) +} diff --git a/pkg/kafka/producer/empty_test.go b/pkg/kafka/producer/empty_test.go index b61ac0b47b0..3d8cc532bc7 100644 --- a/pkg/kafka/producer/empty_test.go +++ b/pkg/kafka/producer/empty_test.go @@ -13,3 +13,13 @@ // limitations under the License. package producer + +import ( + "testing" + + "go.uber.org/goleak" +) + +func TestMain(m *testing.M) { + goleak.VerifyTestMain(m) +} diff --git a/pkg/memory/config/empty_test.go b/pkg/memory/config/empty_test.go index 148b9665df1..f47f8fd6777 100644 --- a/pkg/memory/config/empty_test.go +++ b/pkg/memory/config/empty_test.go @@ -13,3 +13,13 @@ // limitations under the License. package config + +import ( + "testing" + + "go.uber.org/goleak" +) + +func TestMain(m *testing.M) { + goleak.VerifyTestMain(m) +} diff --git a/pkg/prometheus/config/empty_test.go b/pkg/prometheus/config/empty_test.go index e32b13101a4..b5e40db469a 100644 --- a/pkg/prometheus/config/empty_test.go +++ b/pkg/prometheus/config/empty_test.go @@ -13,3 +13,13 @@ // limitations under the License. package config + +import ( + "testing" + + "go.uber.org/goleak" +) + +func TestMain(m *testing.M) { + goleak.VerifyTestMain(m) +} diff --git a/plugin/empty_test.go b/plugin/empty_test.go index 2a36dfd8985..684aedffb30 100644 --- a/plugin/empty_test.go +++ b/plugin/empty_test.go @@ -13,3 +13,13 @@ // limitations under the License. package plugin + +import ( + "testing" + + "go.uber.org/goleak" +) + +func TestMain(m *testing.M) { + goleak.VerifyTestMain(m) +} diff --git a/plugin/storage/grpc/config/empty_test.go b/plugin/storage/grpc/config/empty_test.go index be1f5fecf95..f2f65cd0f1d 100644 --- a/plugin/storage/grpc/config/empty_test.go +++ b/plugin/storage/grpc/config/empty_test.go @@ -13,3 +13,13 @@ // limitations under the License. package config + +import ( + "testing" + + "go.uber.org/goleak" +) + +func TestMain(m *testing.M) { + goleak.VerifyTestMain(m) +} diff --git a/ports/ports_test.go b/ports/ports_test.go index a57b375e28d..ae6de139fd5 100644 --- a/ports/ports_test.go +++ b/ports/ports_test.go @@ -19,6 +19,7 @@ import ( "testing" "github.com/stretchr/testify/assert" + "go.uber.org/goleak" ) func TestPortToHostPort(t *testing.T) { @@ -51,3 +52,7 @@ func TestFormatHostPort(t *testing.T) { assert.Equal(t, "", FormatHostPort("")) assert.Equal(t, "localhost:42", FormatHostPort("localhost:42")) } + +func TestMain(m *testing.M) { + goleak.VerifyTestMain(m) +} diff --git a/storage/dependencystore/empty_test.go b/storage/dependencystore/empty_test.go index 3f0c2a1a1fd..44acb5c044f 100644 --- a/storage/dependencystore/empty_test.go +++ b/storage/dependencystore/empty_test.go @@ -13,3 +13,13 @@ // limitations under the License. package dependencystore + +import ( + "testing" + + "go.uber.org/goleak" +) + +func TestMain(m *testing.M) { + goleak.VerifyTestMain(m) +} diff --git a/storage/empty_test.go b/storage/empty_test.go index 241676d44eb..bf1bf3dd5e4 100644 --- a/storage/empty_test.go +++ b/storage/empty_test.go @@ -13,3 +13,13 @@ // limitations under the License. package storage + +import ( + "testing" + + "go.uber.org/goleak" +) + +func TestMain(m *testing.M) { + goleak.VerifyTestMain(m) +} diff --git a/storage/metricsstore/empty_test.go b/storage/metricsstore/empty_test.go index 61eaa0a9cdf..fa2f0f56d15 100644 --- a/storage/metricsstore/empty_test.go +++ b/storage/metricsstore/empty_test.go @@ -13,3 +13,13 @@ // limitations under the License. package metricsstore + +import ( + "testing" + + "go.uber.org/goleak" +) + +func TestMain(m *testing.M) { + goleak.VerifyTestMain(m) +} diff --git a/storage/metricsstore/metrics/decorator_test.go b/storage/metricsstore/metrics/decorator_test.go index 9cb4faaf4ab..1b16ee23e2c 100644 --- a/storage/metricsstore/metrics/decorator_test.go +++ b/storage/metricsstore/metrics/decorator_test.go @@ -21,6 +21,7 @@ import ( "time" "github.com/stretchr/testify/assert" + "go.uber.org/goleak" "github.com/jaegertracing/jaeger/internal/metricstest" protometrics "github.com/jaegertracing/jaeger/proto-gen/api_v2/metrics" @@ -152,3 +153,7 @@ func TestFailingUnderlyingCalls(t *testing.T) { checkExpectedExistingAndNonExistentCounters(t, counters, wantCounts, gauges, wantExistingKeys, wantNonExistentKeys) } + +func TestMain(m *testing.M) { + goleak.VerifyTestMain(m) +} diff --git a/storage/samplingstore/empty_test.go b/storage/samplingstore/empty_test.go index 5e467077442..00ed682e1fa 100644 --- a/storage/samplingstore/empty_test.go +++ b/storage/samplingstore/empty_test.go @@ -13,3 +13,13 @@ // limitations under the License. package samplingstore + +import ( + "testing" + + "go.uber.org/goleak" +) + +func TestMain(m *testing.M) { + goleak.VerifyTestMain(m) +} diff --git a/storage/spanstore/interface_test.go b/storage/spanstore/interface_test.go new file mode 100644 index 00000000000..6212c985ef1 --- /dev/null +++ b/storage/spanstore/interface_test.go @@ -0,0 +1,25 @@ +// Copyright (c) 2023 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 spanstore + +import ( + "testing" + + "go.uber.org/goleak" +) + +func TestMain(m *testing.M) { + goleak.VerifyTestMain(m) +} diff --git a/storage/spanstore/metrics/package_test.go b/storage/spanstore/metrics/package_test.go new file mode 100644 index 00000000000..e98f5bce5e9 --- /dev/null +++ b/storage/spanstore/metrics/package_test.go @@ -0,0 +1,25 @@ +// Copyright (c) 2023 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 metrics + +import ( + "testing" + + "go.uber.org/goleak" +) + +func TestMain(m *testing.M) { + goleak.VerifyTestMain(m) +}