Skip to content

Commit 5caa803

Browse files
author
Alex Boten
authored
[chore] address linting issues in generated tests (#30452)
This addresses the following lint failure: ``` var-naming: don't use underscores in Go names; func Test_ComponentLifecycle should be TestComponentLifecycle (revive) func Test_ComponentLifecycle(t *testing.T) { ``` Signed-off-by: Alex Boten <[email protected]>
1 parent bd83a2c commit 5caa803

File tree

104 files changed

+109
-109
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+109
-109
lines changed

cmd/mdatagen/lint_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
"github.com/stretchr/testify/require"
1010
)
1111

12-
func Test_formatIdentifier(t *testing.T) {
12+
func TestFormatIdentifier(t *testing.T) {
1313
var tests = []struct {
1414
input string
1515
want string

cmd/mdatagen/loader_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
"go.opentelemetry.io/collector/pdata/pmetric"
1212
)
1313

14-
func Test_loadMetadata(t *testing.T) {
14+
func TestLoadMetadata(t *testing.T) {
1515
tests := []struct {
1616
name string
1717
want metadata

cmd/mdatagen/main_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import (
1616
md "github.com/open-telemetry/opentelemetry-collector-contrib/cmd/mdatagen/internal/metadata"
1717
)
1818

19-
func Test_runContents(t *testing.T) {
19+
func TestRunContents(t *testing.T) {
2020
tests := []struct {
2121
yml string
2222
wantMetricsGenerated bool
@@ -96,7 +96,7 @@ foo
9696
}
9797
}
9898

99-
func Test_run(t *testing.T) {
99+
func TestRun(t *testing.T) {
100100
type args struct {
101101
ymlPath string
102102
}
@@ -125,7 +125,7 @@ func Test_run(t *testing.T) {
125125
}
126126
}
127127

128-
func Test_inlineReplace(t *testing.T) {
128+
func TestInlineReplace(t *testing.T) {
129129
tests := []struct {
130130
name string
131131
markdown string

cmd/mdatagen/templates/component_test.go.tmpl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ func (aneh *assertNoErrorHost) ReportFatalError(err error) {
5555

5656

5757
{{ if isExporter }}
58-
func Test_ComponentLifecycle(t *testing.T) {
58+
func TestComponentLifecycle(t *testing.T) {
5959
factory := NewFactory()
6060

6161
tests := []struct{
@@ -146,7 +146,7 @@ func Test_ComponentLifecycle(t *testing.T) {
146146
{{ end }}
147147

148148
{{ if isProcessor }}
149-
func Test_ComponentLifecycle(t *testing.T) {
149+
func TestComponentLifecycle(t *testing.T) {
150150
factory := NewFactory()
151151

152152
tests := []struct{
@@ -235,7 +235,7 @@ func Test_ComponentLifecycle(t *testing.T) {
235235
{{ end }}
236236

237237
{{ if isReceiver }}
238-
func Test_ComponentLifecycle(t *testing.T) {
238+
func TestComponentLifecycle(t *testing.T) {
239239
factory := NewFactory()
240240

241241
tests := []struct{
@@ -304,7 +304,7 @@ func Test_ComponentLifecycle(t *testing.T) {
304304
{{ end }}
305305

306306
{{ if isExtension }}
307-
func Test_ComponentLifecycle(t *testing.T) {
307+
func TestComponentLifecycle(t *testing.T) {
308308
factory := NewFactory()
309309

310310
cm, err := confmaptest.LoadConf("metadata.yaml")

exporter/alertmanagerexporter/generated_component_test.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

exporter/alibabacloudlogserviceexporter/generated_component_test.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

exporter/awss3exporter/generated_component_test.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

exporter/signalfxexporter/generated_component_test.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

exporter/splunkhecexporter/generated_component_test.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

extension/bearertokenauthextension/generated_component_test.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)