From 6522a3c50c1aafde70d216f457eea735c0fcf5a4 Mon Sep 17 00:00:00 2001 From: Dmitrii Anoshin Date: Fri, 12 Apr 2024 12:04:59 -0700 Subject: [PATCH] [chore] Remove components_test.go (#32357) These files are not generated by the builder anymore and replaced by the tests generated by mdatagen for each component independently, see https://github.com/open-telemetry/opentelemetry-collector/pull/9940 --- cmd/otelcontribcol/components_test.go | 40 --------------------------- cmd/oteltestbedcol/components_test.go | 40 --------------------------- cmd/oteltestbedcol/go.mod | 2 -- 3 files changed, 82 deletions(-) delete mode 100644 cmd/otelcontribcol/components_test.go delete mode 100644 cmd/oteltestbedcol/components_test.go diff --git a/cmd/otelcontribcol/components_test.go b/cmd/otelcontribcol/components_test.go deleted file mode 100644 index 89859a065f24..000000000000 --- a/cmd/otelcontribcol/components_test.go +++ /dev/null @@ -1,40 +0,0 @@ -// Code generated by "go.opentelemetry.io/collector/cmd/builder". DO NOT EDIT. - -package main - -import ( - "testing" - - "github.com/stretchr/testify/assert" - "go.opentelemetry.io/collector/component/componenttest" -) - -func TestValidateConfigs(t *testing.T) { - factories, err := components() - assert.NoError(t, err) - - for k, factory := range factories.Receivers { - assert.Equal(t, k, factory.Type()) - assert.NoError(t, componenttest.CheckConfigStruct(factory.CreateDefaultConfig())) - } - - for k, factory := range factories.Processors { - assert.Equal(t, k, factory.Type()) - assert.NoError(t, componenttest.CheckConfigStruct(factory.CreateDefaultConfig())) - } - - for k, factory := range factories.Exporters { - assert.Equal(t, k, factory.Type()) - assert.NoError(t, componenttest.CheckConfigStruct(factory.CreateDefaultConfig())) - } - - for k, factory := range factories.Connectors { - assert.Equal(t, k, factory.Type()) - assert.NoError(t, componenttest.CheckConfigStruct(factory.CreateDefaultConfig())) - } - - for k, factory := range factories.Extensions { - assert.Equal(t, k, factory.Type()) - assert.NoError(t, componenttest.CheckConfigStruct(factory.CreateDefaultConfig())) - } -} diff --git a/cmd/oteltestbedcol/components_test.go b/cmd/oteltestbedcol/components_test.go deleted file mode 100644 index 89859a065f24..000000000000 --- a/cmd/oteltestbedcol/components_test.go +++ /dev/null @@ -1,40 +0,0 @@ -// Code generated by "go.opentelemetry.io/collector/cmd/builder". DO NOT EDIT. - -package main - -import ( - "testing" - - "github.com/stretchr/testify/assert" - "go.opentelemetry.io/collector/component/componenttest" -) - -func TestValidateConfigs(t *testing.T) { - factories, err := components() - assert.NoError(t, err) - - for k, factory := range factories.Receivers { - assert.Equal(t, k, factory.Type()) - assert.NoError(t, componenttest.CheckConfigStruct(factory.CreateDefaultConfig())) - } - - for k, factory := range factories.Processors { - assert.Equal(t, k, factory.Type()) - assert.NoError(t, componenttest.CheckConfigStruct(factory.CreateDefaultConfig())) - } - - for k, factory := range factories.Exporters { - assert.Equal(t, k, factory.Type()) - assert.NoError(t, componenttest.CheckConfigStruct(factory.CreateDefaultConfig())) - } - - for k, factory := range factories.Connectors { - assert.Equal(t, k, factory.Type()) - assert.NoError(t, componenttest.CheckConfigStruct(factory.CreateDefaultConfig())) - } - - for k, factory := range factories.Extensions { - assert.Equal(t, k, factory.Type()) - assert.NoError(t, componenttest.CheckConfigStruct(factory.CreateDefaultConfig())) - } -} diff --git a/cmd/oteltestbedcol/go.mod b/cmd/oteltestbedcol/go.mod index 5862c26e15c0..85ea40a6573b 100644 --- a/cmd/oteltestbedcol/go.mod +++ b/cmd/oteltestbedcol/go.mod @@ -31,7 +31,6 @@ require ( github.com/open-telemetry/opentelemetry-collector-contrib/receiver/tcplogreceiver v0.98.0 github.com/open-telemetry/opentelemetry-collector-contrib/receiver/udplogreceiver v0.98.0 github.com/open-telemetry/opentelemetry-collector-contrib/receiver/zipkinreceiver v0.98.0 - github.com/stretchr/testify v1.9.0 go.opentelemetry.io/collector/component v0.98.1-0.20240412014414-62f589864e3d go.opentelemetry.io/collector/connector v0.98.1-0.20240412014414-62f589864e3d go.opentelemetry.io/collector/exporter v0.98.1-0.20240412014414-62f589864e3d @@ -191,7 +190,6 @@ require ( github.com/philhofer/fwd v1.1.2 // indirect github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect github.com/pkg/errors v0.9.1 // indirect - github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect github.com/prometheus/client_golang v1.19.0 // indirect github.com/prometheus/client_model v0.6.1 // indirect