From e4d7f34c10b14b8f0598223dd7c776dfdb9429de Mon Sep 17 00:00:00 2001 From: Pushkar Mishra <pushkarmishra029@gmail.com> Date: Thu, 4 Jan 2024 23:34:15 +0530 Subject: [PATCH] Added Empty Tests for Examples (#5076) ## Which problem is this PR solving? - Part of #5068 ## Description of the changes - Added Empty Tests for `./examples` to reduce noise in `make nocover`. ## How was this change tested? - go test ## Checklist - [x] I have read https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md - [x] I have signed all commits - [x] I have added unit tests for the new functionality - [x] I have run lint and test steps successfully - for `jaeger`: `make lint test` - for `jaeger-ui`: `yarn lint` and `yarn test` --------- Signed-off-by: Pushkar Mishra <pushkarmishra029@gmail.com> --- .codecov.yml | 1 + examples/hotrod/cmd/.nocover | 1 - examples/hotrod/cmd/empty_test.go | 25 +++++++++++++++++++ examples/hotrod/pkg/delay/.nocover | 1 - examples/hotrod/pkg/delay/empty_test.go | 25 +++++++++++++++++++ examples/hotrod/pkg/httperr/.nocover | 1 - examples/hotrod/pkg/httperr/empty_test.go | 25 +++++++++++++++++++ examples/hotrod/pkg/log/.nocover | 1 - examples/hotrod/pkg/log/empty_test.go | 25 +++++++++++++++++++ examples/hotrod/pkg/pool/.nocover | 1 - examples/hotrod/pkg/pool/empty_test.go | 25 +++++++++++++++++++ examples/hotrod/pkg/tracing/.nocover | 1 - examples/hotrod/pkg/tracing/empty_test.go | 25 +++++++++++++++++++ examples/hotrod/services/config/.nocover | 1 - examples/hotrod/services/config/empty_test.go | 25 +++++++++++++++++++ examples/hotrod/services/customer/.nocover | 1 - .../hotrod/services/customer/empty_test.go | 25 +++++++++++++++++++ examples/hotrod/services/driver/.nocover | 1 - examples/hotrod/services/driver/empty_test.go | 25 +++++++++++++++++++ examples/hotrod/services/frontend/.nocover | 1 - .../hotrod/services/frontend/empty_test.go | 25 +++++++++++++++++++ examples/hotrod/services/route/.nocover | 1 - examples/hotrod/services/route/empty_test.go | 25 +++++++++++++++++++ 23 files changed, 276 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/.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/.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..e81a798d0c3 --- /dev/null +++ b/examples/hotrod/cmd/empty_test.go @@ -0,0 +1,25 @@ +// 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" + + "go.uber.org/goleak" +) + +func TestMain(m *testing.M) { + goleak.VerifyTestMain(m) +} 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..75c6d1e8a8d --- /dev/null +++ b/examples/hotrod/pkg/delay/empty_test.go @@ -0,0 +1,25 @@ +// 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" + + "go.uber.org/goleak" +) + +func TestMain(m *testing.M) { + goleak.VerifyTestMain(m) +} 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..73a7986c991 --- /dev/null +++ b/examples/hotrod/pkg/httperr/empty_test.go @@ -0,0 +1,25 @@ +// 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" + + "go.uber.org/goleak" +) + +func TestMain(m *testing.M) { + goleak.VerifyTestMain(m) +} 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..313bc0b5a92 --- /dev/null +++ b/examples/hotrod/pkg/log/empty_test.go @@ -0,0 +1,25 @@ +// 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" + + "go.uber.org/goleak" +) + +func TestMain(m *testing.M) { + goleak.VerifyTestMain(m) +} 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..fc9263f8115 --- /dev/null +++ b/examples/hotrod/pkg/pool/empty_test.go @@ -0,0 +1,25 @@ +// 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" + + "go.uber.org/goleak" +) + +func TestMain(m *testing.M) { + goleak.VerifyTestMain(m) +} 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..8f76b53ef73 --- /dev/null +++ b/examples/hotrod/pkg/tracing/empty_test.go @@ -0,0 +1,25 @@ +// 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" + + "go.uber.org/goleak" +) + +func TestMain(m *testing.M) { + goleak.VerifyTestMain(m) +} 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..7b868ab9b52 --- /dev/null +++ b/examples/hotrod/services/config/empty_test.go @@ -0,0 +1,25 @@ +// 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" + + "go.uber.org/goleak" +) + +func TestMain(m *testing.M) { + goleak.VerifyTestMain(m) +} 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..5df12a80314 --- /dev/null +++ b/examples/hotrod/services/customer/empty_test.go @@ -0,0 +1,25 @@ +// 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" + + "go.uber.org/goleak" +) + +func TestMain(m *testing.M) { + goleak.VerifyTestMain(m) +} 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..cf898e03edb --- /dev/null +++ b/examples/hotrod/services/driver/empty_test.go @@ -0,0 +1,25 @@ +// 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" + + "go.uber.org/goleak" +) + +func TestMain(m *testing.M) { + goleak.VerifyTestMain(m) +} 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..30dd9391ab3 --- /dev/null +++ b/examples/hotrod/services/frontend/empty_test.go @@ -0,0 +1,25 @@ +// 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" + + "go.uber.org/goleak" +) + +func TestMain(m *testing.M) { + goleak.VerifyTestMain(m) +} 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..bc61c746ce9 --- /dev/null +++ b/examples/hotrod/services/route/empty_test.go @@ -0,0 +1,25 @@ +// 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" + + "go.uber.org/goleak" +) + +func TestMain(m *testing.M) { + goleak.VerifyTestMain(m) +}