diff --git a/.chloggen/mdata-gen-generate-lifecycle-tests-by-default.yaml b/.chloggen/mdata-gen-generate-lifecycle-tests-by-default.yaml new file mode 100755 index 000000000000..325895a4b208 --- /dev/null +++ b/.chloggen/mdata-gen-generate-lifecycle-tests-by-default.yaml @@ -0,0 +1,22 @@ +# Use this changelog template to create an entry for release notes. + +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: 'enhancement' + +# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver) +component: 'cmd/mdatagen' + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Make lifecycle tests generated by default + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [31532] + +# If your change doesn't affect end users or the exported elements of any package, +# you should instead start your pull request title with [chore] or use the "Skip Changelog" label. +# Optional: The change log or logs in which this entry should be included. +# e.g. '[user]' or '[user, api]' +# Include 'user' if the change is relevant to end users. +# Include 'api' if there is a change to a library API. +# Default: '[user]' +change_logs: [user] diff --git a/cmd/mdatagen/internal/samplereceiver/generated_component_test.go b/cmd/mdatagen/internal/samplereceiver/generated_component_test.go index 847a0a04353d..e6a844c113bf 100644 --- a/cmd/mdatagen/internal/samplereceiver/generated_component_test.go +++ b/cmd/mdatagen/internal/samplereceiver/generated_component_test.go @@ -9,12 +9,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) func TestComponentLifecycle(t *testing.T) { @@ -61,9 +59,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/cmd/mdatagen/loader.go b/cmd/mdatagen/loader.go index ab558aecb2e8..0521a58386de 100644 --- a/cmd/mdatagen/loader.go +++ b/cmd/mdatagen/loader.go @@ -202,6 +202,7 @@ func (a attribute) TestValue() string { type tests struct { Config any `mapstructure:"config"` SkipLifecycle bool `mapstructure:"skip_lifecycle"` + SkipShutdown bool `mapstructure:"skip_shutdown"` ExpectConsumerError bool `mapstructure:"expect_consumer_error"` } @@ -225,7 +226,7 @@ type metadata struct { // ShortFolderName is the shortened folder name of the component, removing class if present ShortFolderName string `mapstructure:"-"` - Tests *tests `mapstructure:"tests"` + Tests tests `mapstructure:"tests"` } func setAttributesFullName(attrs map[attributeName]attribute) { diff --git a/cmd/mdatagen/loader_test.go b/cmd/mdatagen/loader_test.go index 3947eceb7db3..8997dbc04747 100644 --- a/cmd/mdatagen/loader_test.go +++ b/cmd/mdatagen/loader_test.go @@ -219,7 +219,6 @@ func TestLoadMetadata(t *testing.T) { }, ScopeName: "otelcol/samplereceiver", ShortFolderName: "sample", - Tests: &tests{}, }, }, { diff --git a/cmd/mdatagen/main.go b/cmd/mdatagen/main.go index 7cead063eb58..96b04d210535 100644 --- a/cmd/mdatagen/main.go +++ b/cmd/mdatagen/main.go @@ -62,6 +62,12 @@ func run(ymlPath string) error { filepath.Join(codeDir, "generated_status.go"), md, "metadata"); err != nil { return err } + if !md.Tests.SkipLifecycle || !md.Tests.SkipShutdown { + if err = generateFile(filepath.Join(tmplDir, "component_test.go.tmpl"), + filepath.Join(ymlDir, "generated_component_test.go"), md, packageName); err != nil { + return err + } + } } if _, err = os.Stat(filepath.Join(ymlDir, "README.md")); err == nil { @@ -74,13 +80,6 @@ func run(ymlPath string) error { } } - if md.Tests != nil { - if err = generateFile(filepath.Join(tmplDir, "component_test.go.tmpl"), - filepath.Join(ymlDir, "generated_component_test.go"), md, packageName); err != nil { - return err - } - } - if len(md.Metrics) == 0 && len(md.ResourceAttributes) == 0 { return nil } @@ -195,9 +194,6 @@ func templatize(tmplFile string, md metadata) *template.Template { "isConnector": func() bool { return md.Status.Class == "connector" }, - "skipLifecycle": func() bool { - return md.Tests.SkipLifecycle - }, "supportsLogs": func() bool { for _, signals := range md.Status.Stability { for _, s := range signals { diff --git a/cmd/mdatagen/metadata-schema.yaml b/cmd/mdatagen/metadata-schema.yaml index 879307fdd3da..2a42a7191e8f 100644 --- a/cmd/mdatagen/metadata-schema.yaml +++ b/cmd/mdatagen/metadata-schema.yaml @@ -109,5 +109,9 @@ metrics: # Lifecycle tests generated for this component. tests: config: # {} by default, specific testing configuration for lifecycle tests. + # Skip lifecycle tests for this component. Not recommended for components that are not in development. skip_lifecycle: false # false by default + # Skip shutdown tests for this component. Not recommended for components that are not in development. + skip_shutdown: false # false by default + # Whether it's expected that the Consume[Logs|Metrics|Traces] method will return an error with the given configuration. expect_consumer_error: true # false by default diff --git a/cmd/mdatagen/templates/component_test.go.tmpl b/cmd/mdatagen/templates/component_test.go.tmpl index 16c3f7cecbb6..3a8fd72dd3ca 100644 --- a/cmd/mdatagen/templates/component_test.go.tmpl +++ b/cmd/mdatagen/templates/component_test.go.tmpl @@ -1,6 +1,6 @@ // Code generated by mdatagen. DO NOT EDIT. -{{ if len .Status.UnsupportedPlatforms -}} +{{- if len .Status.UnsupportedPlatforms }} //go:build {{ range $i, $v := .Status.UnsupportedPlatforms }}{{ if $i }} && {{ end }}!{{ . }}{{ end }} {{- end }} @@ -9,45 +9,47 @@ package {{ .Package }} import ( "context" "testing" -{{- if or isExporter isProcessor }} - "time" -{{- end }} + {{- if or isExporter isProcessor }} + "time" + {{- end }} "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" + {{- if not .Tests.SkipLifecycle }} "go.opentelemetry.io/collector/component/componenttest" -{{ if isExporter }} + {{- end }} + {{- if isExporter }} "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exportertest" -{{ end }} -{{ if isProcessor }} + {{- end }} + {{- if isProcessor }} "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/processor" "go.opentelemetry.io/collector/processor/processortest" -{{ end }} -{{ if isReceiver }} + {{- end }} + {{- if isReceiver }} "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" -{{ end }} -{{ if isExtension }} + {{- end }} + {{- if isExtension }} "go.opentelemetry.io/collector/extension/extensiontest" -{{ end }} -{{ if isConnector }} + {{- end }} + {{- if isConnector }} "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/connector" "go.opentelemetry.io/collector/connector/connectortest" -{{ end }} + {{- end }} "go.opentelemetry.io/collector/confmap/confmaptest" -{{- if or isExporter isProcessor }} + {{- if or isExporter isProcessor }} "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/plog" "go.opentelemetry.io/collector/pdata/pmetric" "go.opentelemetry.io/collector/pdata/ptrace" -{{- end }} + {{- end }} ) -{{ if isExporter }} +{{ if isExporter -}} func TestComponentLifecycle(t *testing.T) { factory := NewFactory() @@ -89,18 +91,17 @@ func TestComponentLifecycle(t *testing.T) { require.NoError(t, component.UnmarshalConfig(sub, cfg)) for _, test := range tests { + {{- if not .Tests.SkipShutdown }} t.Run(test.name + "-shutdown", func(t *testing.T) { c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) require.NoError(t, err) err = c.Shutdown(context.Background()) require.NoError(t, err) }) + {{- end }} + {{- if not .Tests.SkipLifecycle }} t.Run(test.name + "-lifecycle", func(t *testing.T) { - {{ if skipLifecycle }} - // TODO support lifecycle - t.SkipNow() - {{ end }} c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() @@ -134,6 +135,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) + {{- end }} } } {{ end }} @@ -180,18 +182,17 @@ func TestComponentLifecycle(t *testing.T) { require.NoError(t, component.UnmarshalConfig(sub, cfg)) for _, test := range tests { + {{- if not .Tests.SkipShutdown }} t.Run(test.name + "-shutdown", func(t *testing.T) { c, err := test.createFn(context.Background(), processortest.NewNopCreateSettings(), cfg) require.NoError(t, err) err = c.Shutdown(context.Background()) require.NoError(t, err) }) + {{- end }} + {{- if not .Tests.SkipLifecycle }} t.Run(test.name + "-lifecycle", func(t *testing.T) { - {{ if skipLifecycle }} - // TODO support lifecycle - t.SkipNow() - {{ end }} c, err := test.createFn(context.Background(), processortest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() @@ -223,6 +224,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) + {{- end }} } } {{ end }} @@ -269,18 +271,17 @@ func TestComponentLifecycle(t *testing.T) { require.NoError(t, component.UnmarshalConfig(sub, cfg)) for _, test := range tests { + {{- if not .Tests.SkipShutdown }} t.Run(test.name + "-shutdown", func(t *testing.T) { c, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) err = c.Shutdown(context.Background()) require.NoError(t, err) }) + {{- end }} + {{- if not .Tests.SkipLifecycle }} t.Run(test.name + "-lifecycle", func(t *testing.T) { - {{ if skipLifecycle }} - // TODO support lifecycle - t.SkipNow() - {{ end }} firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() @@ -292,6 +293,7 @@ func TestComponentLifecycle(t *testing.T) { require.NoError(t, secondRcvr.Start(context.Background(), host)) require.NoError(t, secondRcvr.Shutdown(context.Background())) }) + {{- end }} } } {{ end }} @@ -307,18 +309,17 @@ func TestComponentLifecycle(t *testing.T) { require.NoError(t, err) require.NoError(t, component.UnmarshalConfig(sub, cfg)) + {{- if not .Tests.SkipShutdown }} t.Run("shutdown", func(t *testing.T) { e, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) require.NoError(t, err) err = e.Shutdown(context.Background()) require.NoError(t, err) }) + {{- end }} + {{- if not .Tests.SkipLifecycle }} t.Run("lifecycle", func(t *testing.T) { - {{ if skipLifecycle }} - // TODO support lifecycle - t.SkipNow() - {{ end }} firstExt, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) require.NoError(t, err) require.NoError(t, firstExt.Start(context.Background(), componenttest.NewNopHost())) @@ -329,6 +330,7 @@ func TestComponentLifecycle(t *testing.T) { require.NoError(t, secondExt.Start(context.Background(), componenttest.NewNopHost())) require.NoError(t, secondExt.Shutdown(context.Background())) }) + {{- end }} } {{ end }} @@ -422,18 +424,17 @@ func TestComponentLifecycle(t *testing.T) { require.NoError(t, component.UnmarshalConfig(sub, cfg)) for _, test := range tests { + {{- if not .Tests.SkipShutdown }} t.Run(test.name + "-shutdown", func(t *testing.T) { c, err := test.createFn(context.Background(), connectortest.NewNopCreateSettings(), cfg) require.NoError(t, err) err = c.Shutdown(context.Background()) require.NoError(t, err) }) + {{- end }} + {{- if not .Tests.SkipLifecycle }} t.Run(test.name + "-lifecycle", func(t *testing.T) { - {{ if skipLifecycle }} - // TODO support lifecycle - t.SkipNow() - {{ end }} firstConnector, err := test.createFn(context.Background(), connectortest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() @@ -445,6 +446,7 @@ func TestComponentLifecycle(t *testing.T) { require.NoError(t, secondConnector.Start(context.Background(), host)) require.NoError(t, secondConnector.Shutdown(context.Background())) }) + {{- end }} } } {{ end }} diff --git a/cmd/mdatagen/templates/status.go.tmpl b/cmd/mdatagen/templates/status.go.tmpl index c881b9c50c8b..12730e31db78 100644 --- a/cmd/mdatagen/templates/status.go.tmpl +++ b/cmd/mdatagen/templates/status.go.tmpl @@ -3,12 +3,12 @@ package {{ .Package }} import ( - "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/component" "go.opentelemetry.io/otel/metric" "go.opentelemetry.io/otel/trace" ) -{{ if eq .Parent "" }} +{{ if eq .Parent "" -}} var ( Type = component.MustNewType("{{ .Type }}") ) diff --git a/cmd/mdatagen/testdata/metrics_and_type.yaml b/cmd/mdatagen/testdata/metrics_and_type.yaml index 81d66bde9c13..2306a08b35ee 100644 --- a/cmd/mdatagen/testdata/metrics_and_type.yaml +++ b/cmd/mdatagen/testdata/metrics_and_type.yaml @@ -17,3 +17,7 @@ metrics: unit: s gauge: value_type: double + +tests: + skip_lifecycle: true + skip_shutdown: true diff --git a/cmd/mdatagen/testdata/resource_attributes_only.yaml b/cmd/mdatagen/testdata/resource_attributes_only.yaml index 05e031bcf455..a6fe611fe866 100644 --- a/cmd/mdatagen/testdata/resource_attributes_only.yaml +++ b/cmd/mdatagen/testdata/resource_attributes_only.yaml @@ -15,3 +15,7 @@ resource_attributes: description: Resource attribute 1. type: string enabled: true + +tests: + skip_lifecycle: true + skip_shutdown: true diff --git a/cmd/mdatagen/testdata/status_only.yaml b/cmd/mdatagen/testdata/status_only.yaml index 2365b43f1d95..d66977249dd0 100644 --- a/cmd/mdatagen/testdata/status_only.yaml +++ b/cmd/mdatagen/testdata/status_only.yaml @@ -4,3 +4,7 @@ status: stability: beta: [traces, metrics, logs] distributions: [contrib] + +tests: + skip_lifecycle: true + skip_shutdown: true diff --git a/connector/countconnector/generated_component_test.go b/connector/countconnector/generated_component_test.go index 9018150fae77..cab0dfd4d829 100644 --- a/connector/countconnector/generated_component_test.go +++ b/connector/countconnector/generated_component_test.go @@ -9,12 +9,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/connector" "go.opentelemetry.io/collector/connector/connectortest" "go.opentelemetry.io/collector/consumer/consumertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) func TestComponentLifecycle(t *testing.T) { @@ -61,9 +59,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstConnector, err := test.createFn(context.Background(), connectortest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/connector/datadogconnector/metadata.yaml b/connector/datadogconnector/metadata.yaml index 907ef0b3c104..537fd8ea5336 100644 --- a/connector/datadogconnector/metadata.yaml +++ b/connector/datadogconnector/metadata.yaml @@ -8,3 +8,7 @@ status: codeowners: active: [mx-psi, dineshg13] emeritus: [gbbr] + +tests: + skip_lifecycle: true + skip_shutdown: true diff --git a/connector/exceptionsconnector/generated_component_test.go b/connector/exceptionsconnector/generated_component_test.go index cfbd7e4a1088..5e7ce302158c 100644 --- a/connector/exceptionsconnector/generated_component_test.go +++ b/connector/exceptionsconnector/generated_component_test.go @@ -9,12 +9,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/connector" "go.opentelemetry.io/collector/connector/connectortest" "go.opentelemetry.io/collector/consumer/consumertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) func TestComponentLifecycle(t *testing.T) { @@ -54,9 +52,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstConnector, err := test.createFn(context.Background(), connectortest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/connector/failoverconnector/metadata.yaml b/connector/failoverconnector/metadata.yaml index ba84bb8be32c..5dbf922136ff 100644 --- a/connector/failoverconnector/metadata.yaml +++ b/connector/failoverconnector/metadata.yaml @@ -7,3 +7,7 @@ status: distributions: [] codeowners: active: [akats7, djaglowski, fatsheep9146] + +tests: + skip_lifecycle: true + skip_shutdown: true diff --git a/connector/routingconnector/metadata.yaml b/connector/routingconnector/metadata.yaml index b65774a79be5..25fbfbde06a2 100644 --- a/connector/routingconnector/metadata.yaml +++ b/connector/routingconnector/metadata.yaml @@ -7,3 +7,7 @@ status: distributions: [contrib] codeowners: active: [jpkrohling, mwear] + +tests: + skip_lifecycle: true + skip_shutdown: true diff --git a/connector/servicegraphconnector/generated_component_test.go b/connector/servicegraphconnector/generated_component_test.go index 81216cf39249..773a46625861 100644 --- a/connector/servicegraphconnector/generated_component_test.go +++ b/connector/servicegraphconnector/generated_component_test.go @@ -9,12 +9,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/connector" "go.opentelemetry.io/collector/connector/connectortest" "go.opentelemetry.io/collector/consumer/consumertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) func TestComponentLifecycle(t *testing.T) { @@ -47,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstConnector, err := test.createFn(context.Background(), connectortest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/connector/spanmetricsconnector/generated_component_test.go b/connector/spanmetricsconnector/generated_component_test.go index 8cc27489004a..81cf90b69a7e 100644 --- a/connector/spanmetricsconnector/generated_component_test.go +++ b/connector/spanmetricsconnector/generated_component_test.go @@ -9,12 +9,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/connector" "go.opentelemetry.io/collector/connector/connectortest" "go.opentelemetry.io/collector/consumer/consumertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) func TestComponentLifecycle(t *testing.T) { @@ -47,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstConnector, err := test.createFn(context.Background(), connectortest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/exporter/alertmanagerexporter/generated_component_test.go b/exporter/alertmanagerexporter/generated_component_test.go index 0e85834e1100..c4f131b980fd 100644 --- a/exporter/alertmanagerexporter/generated_component_test.go +++ b/exporter/alertmanagerexporter/generated_component_test.go @@ -10,11 +10,9 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exportertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/plog" "go.opentelemetry.io/collector/pdata/pmetric" @@ -51,9 +49,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/exporter/alibabacloudlogserviceexporter/generated_component_test.go b/exporter/alibabacloudlogserviceexporter/generated_component_test.go index bbab775772bb..e0e39450530a 100644 --- a/exporter/alibabacloudlogserviceexporter/generated_component_test.go +++ b/exporter/alibabacloudlogserviceexporter/generated_component_test.go @@ -10,11 +10,9 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exportertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/plog" "go.opentelemetry.io/collector/pdata/pmetric" @@ -65,9 +63,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/exporter/awscloudwatchlogsexporter/generated_component_test.go b/exporter/awscloudwatchlogsexporter/generated_component_test.go index 8770501c433c..6a0daa99272d 100644 --- a/exporter/awscloudwatchlogsexporter/generated_component_test.go +++ b/exporter/awscloudwatchlogsexporter/generated_component_test.go @@ -10,11 +10,9 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exportertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/plog" "go.opentelemetry.io/collector/pdata/pmetric" @@ -51,9 +49,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/exporter/awsemfexporter/generated_component_test.go b/exporter/awsemfexporter/generated_component_test.go index e06f55fb66eb..38476727c15b 100644 --- a/exporter/awsemfexporter/generated_component_test.go +++ b/exporter/awsemfexporter/generated_component_test.go @@ -10,11 +10,9 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exportertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/plog" "go.opentelemetry.io/collector/pdata/pmetric" @@ -51,9 +49,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/exporter/awskinesisexporter/generated_component_test.go b/exporter/awskinesisexporter/generated_component_test.go index 829b0d7d2b64..597a3eb9754f 100644 --- a/exporter/awskinesisexporter/generated_component_test.go +++ b/exporter/awskinesisexporter/generated_component_test.go @@ -9,12 +9,9 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exportertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/plog" "go.opentelemetry.io/collector/pdata/pmetric" @@ -65,45 +62,6 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - - t.Run(test.name+"-lifecycle", func(t *testing.T) { - - // TODO support lifecycle - t.SkipNow() - - c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) - require.NoError(t, err) - host := componenttest.NewNopHost() - err = c.Start(context.Background(), host) - require.NoError(t, err) - require.NotPanics(t, func() { - switch e := c.(type) { - case exporter.Logs: - logs := generateLifecycleTestLogs() - if !e.Capabilities().MutatesData { - logs.MarkReadOnly() - } - err = e.ConsumeLogs(context.Background(), logs) - case exporter.Metrics: - metrics := generateLifecycleTestMetrics() - if !e.Capabilities().MutatesData { - metrics.MarkReadOnly() - } - err = e.ConsumeMetrics(context.Background(), metrics) - case exporter.Traces: - traces := generateLifecycleTestTraces() - if !e.Capabilities().MutatesData { - traces.MarkReadOnly() - } - err = e.ConsumeTraces(context.Background(), traces) - } - }) - - require.NoError(t, err) - - err = c.Shutdown(context.Background()) - require.NoError(t, err) - }) } } diff --git a/exporter/awskinesisexporter/metadata.yaml b/exporter/awskinesisexporter/metadata.yaml index f8ebdf31063a..a487740f3777 100644 --- a/exporter/awskinesisexporter/metadata.yaml +++ b/exporter/awskinesisexporter/metadata.yaml @@ -8,7 +8,7 @@ status: codeowners: active: [Aneurysm9, MovieStoreGuy] +# TODO: Update the exporter to pass the tests tests: - config: skip_lifecycle: true diff --git a/exporter/awss3exporter/generated_component_test.go b/exporter/awss3exporter/generated_component_test.go index b26e0c49aa99..c9b8a9eff686 100644 --- a/exporter/awss3exporter/generated_component_test.go +++ b/exporter/awss3exporter/generated_component_test.go @@ -10,11 +10,9 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exportertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/plog" "go.opentelemetry.io/collector/pdata/pmetric" @@ -65,9 +63,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/exporter/awss3exporter/metadata.yaml b/exporter/awss3exporter/metadata.yaml index 6e419a23de2b..ec044eb76393 100644 --- a/exporter/awss3exporter/metadata.yaml +++ b/exporter/awss3exporter/metadata.yaml @@ -7,6 +7,6 @@ status: distributions: [contrib, observiq, sumo, splunk] codeowners: active: [atoulme, pdelewski] + tests: - config: expect_consumer_error: true diff --git a/exporter/awsxrayexporter/generated_component_test.go b/exporter/awsxrayexporter/generated_component_test.go index a628d7765e3d..692caacf546c 100644 --- a/exporter/awsxrayexporter/generated_component_test.go +++ b/exporter/awsxrayexporter/generated_component_test.go @@ -10,11 +10,9 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exportertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/plog" "go.opentelemetry.io/collector/pdata/pmetric" @@ -51,9 +49,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/exporter/azuredataexplorerexporter/generated_component_test.go b/exporter/azuredataexplorerexporter/generated_component_test.go index 98a1fa932eec..dff9e46e372b 100644 --- a/exporter/azuredataexplorerexporter/generated_component_test.go +++ b/exporter/azuredataexplorerexporter/generated_component_test.go @@ -9,12 +9,9 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exportertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/plog" "go.opentelemetry.io/collector/pdata/pmetric" @@ -65,45 +62,6 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - - t.Run(test.name+"-lifecycle", func(t *testing.T) { - - // TODO support lifecycle - t.SkipNow() - - c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) - require.NoError(t, err) - host := componenttest.NewNopHost() - err = c.Start(context.Background(), host) - require.NoError(t, err) - require.NotPanics(t, func() { - switch e := c.(type) { - case exporter.Logs: - logs := generateLifecycleTestLogs() - if !e.Capabilities().MutatesData { - logs.MarkReadOnly() - } - err = e.ConsumeLogs(context.Background(), logs) - case exporter.Metrics: - metrics := generateLifecycleTestMetrics() - if !e.Capabilities().MutatesData { - metrics.MarkReadOnly() - } - err = e.ConsumeMetrics(context.Background(), metrics) - case exporter.Traces: - traces := generateLifecycleTestTraces() - if !e.Capabilities().MutatesData { - traces.MarkReadOnly() - } - err = e.ConsumeTraces(context.Background(), traces) - } - }) - - require.NoError(t, err) - - err = c.Shutdown(context.Background()) - require.NoError(t, err) - }) } } diff --git a/exporter/azuredataexplorerexporter/metadata.yaml b/exporter/azuredataexplorerexporter/metadata.yaml index 942b3c6ffae6..34120f187a6c 100644 --- a/exporter/azuredataexplorerexporter/metadata.yaml +++ b/exporter/azuredataexplorerexporter/metadata.yaml @@ -8,6 +8,7 @@ status: codeowners: active: [asaharn, ag-ramachandran] +# TODO: Update the exporter to pass the tests tests: config: cluster_uri: "https://CLUSTER.kusto.windows.net" diff --git a/exporter/azuremonitorexporter/generated_component_test.go b/exporter/azuremonitorexporter/generated_component_test.go index cb643247026f..9e9048a6f007 100644 --- a/exporter/azuremonitorexporter/generated_component_test.go +++ b/exporter/azuremonitorexporter/generated_component_test.go @@ -10,11 +10,9 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exportertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/plog" "go.opentelemetry.io/collector/pdata/pmetric" @@ -65,9 +63,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/exporter/carbonexporter/generated_component_test.go b/exporter/carbonexporter/generated_component_test.go index 2c8cc789f51e..b4234639f099 100644 --- a/exporter/carbonexporter/generated_component_test.go +++ b/exporter/carbonexporter/generated_component_test.go @@ -10,11 +10,9 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exportertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/plog" "go.opentelemetry.io/collector/pdata/pmetric" @@ -51,9 +49,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/exporter/carbonexporter/metadata.yaml b/exporter/carbonexporter/metadata.yaml index bb5b5245e2a8..68fcd20084aa 100644 --- a/exporter/carbonexporter/metadata.yaml +++ b/exporter/carbonexporter/metadata.yaml @@ -9,5 +9,4 @@ status: active: [aboguszewski-sumo] tests: - config: expect_consumer_error: true \ No newline at end of file diff --git a/exporter/cassandraexporter/generated_component_test.go b/exporter/cassandraexporter/generated_component_test.go index 15eac09d729e..3dcb72b4763c 100644 --- a/exporter/cassandraexporter/generated_component_test.go +++ b/exporter/cassandraexporter/generated_component_test.go @@ -9,12 +9,9 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exportertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/plog" "go.opentelemetry.io/collector/pdata/pmetric" @@ -58,45 +55,6 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - - t.Run(test.name+"-lifecycle", func(t *testing.T) { - - // TODO support lifecycle - t.SkipNow() - - c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) - require.NoError(t, err) - host := componenttest.NewNopHost() - err = c.Start(context.Background(), host) - require.NoError(t, err) - require.NotPanics(t, func() { - switch e := c.(type) { - case exporter.Logs: - logs := generateLifecycleTestLogs() - if !e.Capabilities().MutatesData { - logs.MarkReadOnly() - } - err = e.ConsumeLogs(context.Background(), logs) - case exporter.Metrics: - metrics := generateLifecycleTestMetrics() - if !e.Capabilities().MutatesData { - metrics.MarkReadOnly() - } - err = e.ConsumeMetrics(context.Background(), metrics) - case exporter.Traces: - traces := generateLifecycleTestTraces() - if !e.Capabilities().MutatesData { - traces.MarkReadOnly() - } - err = e.ConsumeTraces(context.Background(), traces) - } - }) - - require.NoError(t, err) - - err = c.Shutdown(context.Background()) - require.NoError(t, err) - }) } } diff --git a/exporter/cassandraexporter/metadata.yaml b/exporter/cassandraexporter/metadata.yaml index 65880b11f1aa..fe1aadab9901 100644 --- a/exporter/cassandraexporter/metadata.yaml +++ b/exporter/cassandraexporter/metadata.yaml @@ -8,6 +8,6 @@ status: codeowners: active: [atoulme, emreyalvac] +# TODO: Update the exporter to pass the tests tests: - config: skip_lifecycle: true \ No newline at end of file diff --git a/exporter/clickhouseexporter/generated_component_test.go b/exporter/clickhouseexporter/generated_component_test.go index 55a49b69e617..f251d2cf9264 100644 --- a/exporter/clickhouseexporter/generated_component_test.go +++ b/exporter/clickhouseexporter/generated_component_test.go @@ -9,12 +9,9 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exportertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/plog" "go.opentelemetry.io/collector/pdata/pmetric" @@ -65,45 +62,6 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - - t.Run(test.name+"-lifecycle", func(t *testing.T) { - - // TODO support lifecycle - t.SkipNow() - - c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) - require.NoError(t, err) - host := componenttest.NewNopHost() - err = c.Start(context.Background(), host) - require.NoError(t, err) - require.NotPanics(t, func() { - switch e := c.(type) { - case exporter.Logs: - logs := generateLifecycleTestLogs() - if !e.Capabilities().MutatesData { - logs.MarkReadOnly() - } - err = e.ConsumeLogs(context.Background(), logs) - case exporter.Metrics: - metrics := generateLifecycleTestMetrics() - if !e.Capabilities().MutatesData { - metrics.MarkReadOnly() - } - err = e.ConsumeMetrics(context.Background(), metrics) - case exporter.Traces: - traces := generateLifecycleTestTraces() - if !e.Capabilities().MutatesData { - traces.MarkReadOnly() - } - err = e.ConsumeTraces(context.Background(), traces) - } - }) - - require.NoError(t, err) - - err = c.Shutdown(context.Background()) - require.NoError(t, err) - }) } } diff --git a/exporter/clickhouseexporter/metadata.yaml b/exporter/clickhouseexporter/metadata.yaml index 7942f3775ca8..842ec148a226 100644 --- a/exporter/clickhouseexporter/metadata.yaml +++ b/exporter/clickhouseexporter/metadata.yaml @@ -8,6 +8,6 @@ status: codeowners: active: [hanjm, dmitryax, Frapschen] +# TODO: Update the exporter to pass the tests tests: - config: skip_lifecycle: true diff --git a/exporter/coralogixexporter/generated_component_test.go b/exporter/coralogixexporter/generated_component_test.go index 2781a82b67b9..229c40148100 100644 --- a/exporter/coralogixexporter/generated_component_test.go +++ b/exporter/coralogixexporter/generated_component_test.go @@ -10,11 +10,9 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exportertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/plog" "go.opentelemetry.io/collector/pdata/pmetric" @@ -65,9 +63,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/exporter/datadogexporter/generated_component_test.go b/exporter/datadogexporter/generated_component_test.go index fb5d5631179a..0938f49b1bec 100644 --- a/exporter/datadogexporter/generated_component_test.go +++ b/exporter/datadogexporter/generated_component_test.go @@ -10,11 +10,9 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exportertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/plog" "go.opentelemetry.io/collector/pdata/pmetric" @@ -65,9 +63,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/exporter/datasetexporter/generated_component_test.go b/exporter/datasetexporter/generated_component_test.go index 06d9792f1e43..e80c4b9f3f51 100644 --- a/exporter/datasetexporter/generated_component_test.go +++ b/exporter/datasetexporter/generated_component_test.go @@ -9,12 +9,9 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exportertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/plog" "go.opentelemetry.io/collector/pdata/pmetric" @@ -58,45 +55,6 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - - t.Run(test.name+"-lifecycle", func(t *testing.T) { - - // TODO support lifecycle - t.SkipNow() - - c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) - require.NoError(t, err) - host := componenttest.NewNopHost() - err = c.Start(context.Background(), host) - require.NoError(t, err) - require.NotPanics(t, func() { - switch e := c.(type) { - case exporter.Logs: - logs := generateLifecycleTestLogs() - if !e.Capabilities().MutatesData { - logs.MarkReadOnly() - } - err = e.ConsumeLogs(context.Background(), logs) - case exporter.Metrics: - metrics := generateLifecycleTestMetrics() - if !e.Capabilities().MutatesData { - metrics.MarkReadOnly() - } - err = e.ConsumeMetrics(context.Background(), metrics) - case exporter.Traces: - traces := generateLifecycleTestTraces() - if !e.Capabilities().MutatesData { - traces.MarkReadOnly() - } - err = e.ConsumeTraces(context.Background(), traces) - } - }) - - require.NoError(t, err) - - err = c.Shutdown(context.Background()) - require.NoError(t, err) - }) } } diff --git a/exporter/datasetexporter/metadata.yaml b/exporter/datasetexporter/metadata.yaml index fcccb0b99902..0ef95c31fac8 100644 --- a/exporter/datasetexporter/metadata.yaml +++ b/exporter/datasetexporter/metadata.yaml @@ -8,6 +8,7 @@ status: codeowners: active: [atoulme, martin-majlis-s1, zdaratom-s1, tomaz-s1] +# TODO: Update the exporter to pass the tests tests: config: dataset_url: https://app.scalyr.com diff --git a/exporter/dynatraceexporter/generated_component_test.go b/exporter/dynatraceexporter/generated_component_test.go index d44bd3ab607f..b31a9a2ae4d9 100644 --- a/exporter/dynatraceexporter/generated_component_test.go +++ b/exporter/dynatraceexporter/generated_component_test.go @@ -10,11 +10,9 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exportertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/plog" "go.opentelemetry.io/collector/pdata/pmetric" @@ -51,9 +49,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/exporter/dynatraceexporter/metadata.yaml b/exporter/dynatraceexporter/metadata.yaml index fb8810840fff..a648860a74ea 100644 --- a/exporter/dynatraceexporter/metadata.yaml +++ b/exporter/dynatraceexporter/metadata.yaml @@ -9,5 +9,4 @@ status: active: [dyladan, arminru, evan-bradley] tests: - config: expect_consumer_error: true diff --git a/exporter/elasticsearchexporter/generated_component_test.go b/exporter/elasticsearchexporter/generated_component_test.go index 1beb243c2110..8f123f42726f 100644 --- a/exporter/elasticsearchexporter/generated_component_test.go +++ b/exporter/elasticsearchexporter/generated_component_test.go @@ -10,11 +10,9 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exportertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/plog" "go.opentelemetry.io/collector/pdata/pmetric" @@ -58,9 +56,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/exporter/fileexporter/generated_component_test.go b/exporter/fileexporter/generated_component_test.go index 9d434de8c48a..01de9d0396be 100644 --- a/exporter/fileexporter/generated_component_test.go +++ b/exporter/fileexporter/generated_component_test.go @@ -10,11 +10,9 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exportertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/plog" "go.opentelemetry.io/collector/pdata/pmetric" @@ -65,9 +63,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/exporter/googlecloudexporter/metadata.yaml b/exporter/googlecloudexporter/metadata.yaml index 5b551dc0f188..a96a028478c4 100644 --- a/exporter/googlecloudexporter/metadata.yaml +++ b/exporter/googlecloudexporter/metadata.yaml @@ -7,3 +7,8 @@ status: distributions: [contrib, observiq] codeowners: active: [aabmass, dashpole, jsuereth, punya, damemi, psx95] + +# TODO: Update the exporter to pass the tests +tests: + skip_lifecycle: true + skip_shutdown: true diff --git a/exporter/googlecloudpubsubexporter/generated_component_test.go b/exporter/googlecloudpubsubexporter/generated_component_test.go new file mode 100644 index 000000000000..bbe9f0c7a3be --- /dev/null +++ b/exporter/googlecloudpubsubexporter/generated_component_test.go @@ -0,0 +1,101 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package googlecloudpubsubexporter + +import ( + "context" + "testing" + "time" + + "github.com/stretchr/testify/require" + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/exporter" + "go.opentelemetry.io/collector/exporter/exportertest" + "go.opentelemetry.io/collector/pdata/pcommon" + "go.opentelemetry.io/collector/pdata/plog" + "go.opentelemetry.io/collector/pdata/pmetric" + "go.opentelemetry.io/collector/pdata/ptrace" +) + +func TestComponentLifecycle(t *testing.T) { + factory := NewFactory() + + tests := []struct { + name string + createFn func(ctx context.Context, set exporter.CreateSettings, cfg component.Config) (component.Component, error) + }{ + + { + name: "logs", + createFn: func(ctx context.Context, set exporter.CreateSettings, cfg component.Config) (component.Component, error) { + return factory.CreateLogsExporter(ctx, set, cfg) + }, + }, + + { + name: "metrics", + createFn: func(ctx context.Context, set exporter.CreateSettings, cfg component.Config) (component.Component, error) { + return factory.CreateMetricsExporter(ctx, set, cfg) + }, + }, + + { + name: "traces", + createFn: func(ctx context.Context, set exporter.CreateSettings, cfg component.Config) (component.Component, error) { + return factory.CreateTracesExporter(ctx, set, cfg) + }, + }, + } + + cm, err := confmaptest.LoadConf("metadata.yaml") + require.NoError(t, err) + cfg := factory.CreateDefaultConfig() + sub, err := cm.Sub("tests::config") + require.NoError(t, err) + require.NoError(t, component.UnmarshalConfig(sub, cfg)) + + for _, test := range tests { + t.Run(test.name+"-shutdown", func(t *testing.T) { + c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + err = c.Shutdown(context.Background()) + require.NoError(t, err) + }) + } +} + +func generateLifecycleTestLogs() plog.Logs { + logs := plog.NewLogs() + rl := logs.ResourceLogs().AppendEmpty() + rl.Resource().Attributes().PutStr("resource", "R1") + l := rl.ScopeLogs().AppendEmpty().LogRecords().AppendEmpty() + l.Body().SetStr("test log message") + l.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return logs +} + +func generateLifecycleTestMetrics() pmetric.Metrics { + metrics := pmetric.NewMetrics() + rm := metrics.ResourceMetrics().AppendEmpty() + rm.Resource().Attributes().PutStr("resource", "R1") + m := rm.ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() + m.SetName("test_metric") + dp := m.SetEmptyGauge().DataPoints().AppendEmpty() + dp.Attributes().PutStr("test_attr", "value_1") + dp.SetIntValue(123) + dp.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return metrics +} + +func generateLifecycleTestTraces() ptrace.Traces { + traces := ptrace.NewTraces() + rs := traces.ResourceSpans().AppendEmpty() + rs.Resource().Attributes().PutStr("resource", "R1") + span := rs.ScopeSpans().AppendEmpty().Spans().AppendEmpty() + span.Attributes().PutStr("test_attr", "value_1") + span.SetName("test_span") + span.SetStartTimestamp(pcommon.NewTimestampFromTime(time.Now().Add(-1 * time.Second))) + span.SetEndTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return traces +} diff --git a/exporter/googlecloudpubsubexporter/metadata.yaml b/exporter/googlecloudpubsubexporter/metadata.yaml index f38f9ae8a2ad..cafd83185532 100644 --- a/exporter/googlecloudpubsubexporter/metadata.yaml +++ b/exporter/googlecloudpubsubexporter/metadata.yaml @@ -7,3 +7,7 @@ status: distributions: [contrib, observiq] codeowners: active: [alexvanboxel] + +# TODO: Update the exporter to pass the tests +tests: + skip_lifecycle: true diff --git a/exporter/googlemanagedprometheusexporter/metadata.yaml b/exporter/googlemanagedprometheusexporter/metadata.yaml index 6b3d0c326f7e..c5123fed2726 100644 --- a/exporter/googlemanagedprometheusexporter/metadata.yaml +++ b/exporter/googlemanagedprometheusexporter/metadata.yaml @@ -7,3 +7,8 @@ status: distributions: [contrib, observiq] codeowners: active: [aabmass, dashpole, jsuereth, punya, damemi, psx95] + +# TODO: Update the exporter to pass the tests +tests: + skip_lifecycle: true + skip_shutdown: true diff --git a/exporter/honeycombmarkerexporter/generated_component_test.go b/exporter/honeycombmarkerexporter/generated_component_test.go index e3410088aa7b..f1d77f7a1ee8 100644 --- a/exporter/honeycombmarkerexporter/generated_component_test.go +++ b/exporter/honeycombmarkerexporter/generated_component_test.go @@ -10,11 +10,9 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exportertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/plog" "go.opentelemetry.io/collector/pdata/pmetric" @@ -51,9 +49,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/exporter/honeycombmarkerexporter/metadata.yaml b/exporter/honeycombmarkerexporter/metadata.yaml index 950deb987572..956f924f3e5b 100644 --- a/exporter/honeycombmarkerexporter/metadata.yaml +++ b/exporter/honeycombmarkerexporter/metadata.yaml @@ -9,5 +9,4 @@ status: active: [TylerHelmuth, fchikwekwe] tests: - config: expect_consumer_error: true \ No newline at end of file diff --git a/exporter/influxdbexporter/generated_component_test.go b/exporter/influxdbexporter/generated_component_test.go index 4a49f8aab68e..68d79ff2a0d4 100644 --- a/exporter/influxdbexporter/generated_component_test.go +++ b/exporter/influxdbexporter/generated_component_test.go @@ -10,11 +10,9 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exportertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/plog" "go.opentelemetry.io/collector/pdata/pmetric" @@ -65,9 +63,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/exporter/influxdbexporter/metadata.yaml b/exporter/influxdbexporter/metadata.yaml index c8d1a1cae3f3..14176efcf877 100644 --- a/exporter/influxdbexporter/metadata.yaml +++ b/exporter/influxdbexporter/metadata.yaml @@ -9,5 +9,4 @@ status: active: [jacobmarble] tests: - config: expect_consumer_error: true \ No newline at end of file diff --git a/exporter/instanaexporter/generated_component_test.go b/exporter/instanaexporter/generated_component_test.go index 1106985e89e7..bbb5b6fab6c3 100644 --- a/exporter/instanaexporter/generated_component_test.go +++ b/exporter/instanaexporter/generated_component_test.go @@ -10,11 +10,9 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exportertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/plog" "go.opentelemetry.io/collector/pdata/pmetric" @@ -51,9 +49,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/exporter/instanaexporter/metadata.yaml b/exporter/instanaexporter/metadata.yaml index aca77294d82a..c057cac93ff8 100644 --- a/exporter/instanaexporter/metadata.yaml +++ b/exporter/instanaexporter/metadata.yaml @@ -9,5 +9,4 @@ status: active: [jpkrohling, hickeyma] tests: - config: expect_consumer_error: true \ No newline at end of file diff --git a/exporter/kafkaexporter/metadata.yaml b/exporter/kafkaexporter/metadata.yaml index 349b91659be1..f6215e889405 100644 --- a/exporter/kafkaexporter/metadata.yaml +++ b/exporter/kafkaexporter/metadata.yaml @@ -7,3 +7,8 @@ status: distributions: [core, contrib, observiq, splunk, sumo, aws] codeowners: active: [pavolloffay, MovieStoreGuy] + +# TODO: Update the exporter to pass the tests +tests: + skip_lifecycle: true + skip_shutdown: true diff --git a/exporter/kineticaexporter/generated_component_test.go b/exporter/kineticaexporter/generated_component_test.go index 4d50b4de1d18..b2ce8ed923d7 100644 --- a/exporter/kineticaexporter/generated_component_test.go +++ b/exporter/kineticaexporter/generated_component_test.go @@ -9,12 +9,9 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exportertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/plog" "go.opentelemetry.io/collector/pdata/pmetric" @@ -65,45 +62,6 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - - t.Run(test.name+"-lifecycle", func(t *testing.T) { - - // TODO support lifecycle - t.SkipNow() - - c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) - require.NoError(t, err) - host := componenttest.NewNopHost() - err = c.Start(context.Background(), host) - require.NoError(t, err) - require.NotPanics(t, func() { - switch e := c.(type) { - case exporter.Logs: - logs := generateLifecycleTestLogs() - if !e.Capabilities().MutatesData { - logs.MarkReadOnly() - } - err = e.ConsumeLogs(context.Background(), logs) - case exporter.Metrics: - metrics := generateLifecycleTestMetrics() - if !e.Capabilities().MutatesData { - metrics.MarkReadOnly() - } - err = e.ConsumeMetrics(context.Background(), metrics) - case exporter.Traces: - traces := generateLifecycleTestTraces() - if !e.Capabilities().MutatesData { - traces.MarkReadOnly() - } - err = e.ConsumeTraces(context.Background(), traces) - } - }) - - require.NoError(t, err) - - err = c.Shutdown(context.Background()) - require.NoError(t, err) - }) } } diff --git a/exporter/kineticaexporter/metadata.yaml b/exporter/kineticaexporter/metadata.yaml index 7c07aa7625b5..23fe9da02f1d 100644 --- a/exporter/kineticaexporter/metadata.yaml +++ b/exporter/kineticaexporter/metadata.yaml @@ -8,6 +8,7 @@ status: codeowners: active: [am-kinetica, TylerHelmuth] + +# TODO: Update the exporter to pass the tests tests: - config: skip_lifecycle: true \ No newline at end of file diff --git a/exporter/loadbalancingexporter/generated_component_test.go b/exporter/loadbalancingexporter/generated_component_test.go index 88034315d812..89d139bd0614 100644 --- a/exporter/loadbalancingexporter/generated_component_test.go +++ b/exporter/loadbalancingexporter/generated_component_test.go @@ -10,11 +10,9 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exportertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/plog" "go.opentelemetry.io/collector/pdata/pmetric" @@ -65,9 +63,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/exporter/logicmonitorexporter/generated_component_test.go b/exporter/logicmonitorexporter/generated_component_test.go index 191e5b09a32c..e1a8f14804c2 100644 --- a/exporter/logicmonitorexporter/generated_component_test.go +++ b/exporter/logicmonitorexporter/generated_component_test.go @@ -10,11 +10,9 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exportertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/plog" "go.opentelemetry.io/collector/pdata/pmetric" @@ -58,9 +56,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/exporter/logzioexporter/generated_component_test.go b/exporter/logzioexporter/generated_component_test.go index 7c7f8fd02702..2e975d99def4 100644 --- a/exporter/logzioexporter/generated_component_test.go +++ b/exporter/logzioexporter/generated_component_test.go @@ -10,11 +10,9 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exportertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/plog" "go.opentelemetry.io/collector/pdata/pmetric" @@ -58,9 +56,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/exporter/lokiexporter/generated_component_test.go b/exporter/lokiexporter/generated_component_test.go index 6aa43beed91b..2b3aa25c5205 100644 --- a/exporter/lokiexporter/generated_component_test.go +++ b/exporter/lokiexporter/generated_component_test.go @@ -10,11 +10,9 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exportertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/plog" "go.opentelemetry.io/collector/pdata/pmetric" @@ -51,9 +49,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/exporter/lokiexporter/metadata.yaml b/exporter/lokiexporter/metadata.yaml index 28573ef226a2..c2485b102572 100644 --- a/exporter/lokiexporter/metadata.yaml +++ b/exporter/lokiexporter/metadata.yaml @@ -11,5 +11,4 @@ status: active: [gramidt, gouthamve, jpkrohling, mar4uk] tests: - config: expect_consumer_error: true \ No newline at end of file diff --git a/exporter/mezmoexporter/generated_component_test.go b/exporter/mezmoexporter/generated_component_test.go index 224b7bc119cc..b075ef51e2da 100644 --- a/exporter/mezmoexporter/generated_component_test.go +++ b/exporter/mezmoexporter/generated_component_test.go @@ -10,11 +10,9 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exportertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/plog" "go.opentelemetry.io/collector/pdata/pmetric" @@ -51,9 +49,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/exporter/opencensusexporter/generated_component_test.go b/exporter/opencensusexporter/generated_component_test.go index d5a9c14e56a5..c9356009d0f1 100644 --- a/exporter/opencensusexporter/generated_component_test.go +++ b/exporter/opencensusexporter/generated_component_test.go @@ -10,11 +10,9 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exportertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/plog" "go.opentelemetry.io/collector/pdata/pmetric" @@ -58,9 +56,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/exporter/opensearchexporter/generated_component_test.go b/exporter/opensearchexporter/generated_component_test.go index 62ee916c6100..e40a2952d28b 100644 --- a/exporter/opensearchexporter/generated_component_test.go +++ b/exporter/opensearchexporter/generated_component_test.go @@ -10,11 +10,9 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exportertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/plog" "go.opentelemetry.io/collector/pdata/pmetric" @@ -58,9 +56,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/exporter/otelarrowexporter/metadata.yaml b/exporter/otelarrowexporter/metadata.yaml index be5725f9ad4b..0f3c7c23e26e 100644 --- a/exporter/otelarrowexporter/metadata.yaml +++ b/exporter/otelarrowexporter/metadata.yaml @@ -7,3 +7,8 @@ status: distributions: [] codeowners: active: [jmacd, moh-osman3] + +# TODO: Update the exporter to pass the tests +tests: + skip_lifecycle: true + skip_shutdown: true diff --git a/exporter/prometheusexporter/generated_component_test.go b/exporter/prometheusexporter/generated_component_test.go index 51fd633c1afe..9fdc955b8305 100644 --- a/exporter/prometheusexporter/generated_component_test.go +++ b/exporter/prometheusexporter/generated_component_test.go @@ -10,11 +10,9 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exportertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/plog" "go.opentelemetry.io/collector/pdata/pmetric" @@ -51,9 +49,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/exporter/prometheusremotewriteexporter/generated_component_test.go b/exporter/prometheusremotewriteexporter/generated_component_test.go index f038cea70eaf..feee79c38994 100644 --- a/exporter/prometheusremotewriteexporter/generated_component_test.go +++ b/exporter/prometheusremotewriteexporter/generated_component_test.go @@ -10,11 +10,9 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exportertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/plog" "go.opentelemetry.io/collector/pdata/pmetric" @@ -51,9 +49,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/exporter/prometheusremotewriteexporter/metadata.yaml b/exporter/prometheusremotewriteexporter/metadata.yaml index d30ec5eb99dc..cdd124b22b9c 100644 --- a/exporter/prometheusremotewriteexporter/metadata.yaml +++ b/exporter/prometheusremotewriteexporter/metadata.yaml @@ -9,5 +9,4 @@ status: active: [Aneurysm9, rapphil] tests: - config: expect_consumer_error: true \ No newline at end of file diff --git a/exporter/pulsarexporter/generated_component_test.go b/exporter/pulsarexporter/generated_component_test.go index 61fb5932b02a..4979e6a6d81b 100644 --- a/exporter/pulsarexporter/generated_component_test.go +++ b/exporter/pulsarexporter/generated_component_test.go @@ -9,12 +9,9 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exportertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/plog" "go.opentelemetry.io/collector/pdata/pmetric" @@ -65,45 +62,6 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - - t.Run(test.name+"-lifecycle", func(t *testing.T) { - - // TODO support lifecycle - t.SkipNow() - - c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) - require.NoError(t, err) - host := componenttest.NewNopHost() - err = c.Start(context.Background(), host) - require.NoError(t, err) - require.NotPanics(t, func() { - switch e := c.(type) { - case exporter.Logs: - logs := generateLifecycleTestLogs() - if !e.Capabilities().MutatesData { - logs.MarkReadOnly() - } - err = e.ConsumeLogs(context.Background(), logs) - case exporter.Metrics: - metrics := generateLifecycleTestMetrics() - if !e.Capabilities().MutatesData { - metrics.MarkReadOnly() - } - err = e.ConsumeMetrics(context.Background(), metrics) - case exporter.Traces: - traces := generateLifecycleTestTraces() - if !e.Capabilities().MutatesData { - traces.MarkReadOnly() - } - err = e.ConsumeTraces(context.Background(), traces) - } - }) - - require.NoError(t, err) - - err = c.Shutdown(context.Background()) - require.NoError(t, err) - }) } } diff --git a/exporter/pulsarexporter/metadata.yaml b/exporter/pulsarexporter/metadata.yaml index ce2d5868b7cb..bf156dfd0ed2 100644 --- a/exporter/pulsarexporter/metadata.yaml +++ b/exporter/pulsarexporter/metadata.yaml @@ -8,6 +8,6 @@ status: codeowners: active: [dmitryax, dao-jun] +# Update the exporter to pass the tests tests: - config: skip_lifecycle: true \ No newline at end of file diff --git a/exporter/sapmexporter/generated_component_test.go b/exporter/sapmexporter/generated_component_test.go index 32db78b5efd2..8007975490d4 100644 --- a/exporter/sapmexporter/generated_component_test.go +++ b/exporter/sapmexporter/generated_component_test.go @@ -10,11 +10,9 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exportertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/plog" "go.opentelemetry.io/collector/pdata/pmetric" @@ -51,9 +49,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/exporter/sapmexporter/metadata.yaml b/exporter/sapmexporter/metadata.yaml index ef71db8313d1..08393e6cb403 100644 --- a/exporter/sapmexporter/metadata.yaml +++ b/exporter/sapmexporter/metadata.yaml @@ -10,5 +10,4 @@ status: tests: - config: expect_consumer_error: true \ No newline at end of file diff --git a/exporter/sentryexporter/generated_component_test.go b/exporter/sentryexporter/generated_component_test.go index f4cfe5824e41..28e5fe7698ab 100644 --- a/exporter/sentryexporter/generated_component_test.go +++ b/exporter/sentryexporter/generated_component_test.go @@ -10,11 +10,9 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exportertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/plog" "go.opentelemetry.io/collector/pdata/pmetric" @@ -51,9 +49,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/exporter/sentryexporter/metadata.yaml b/exporter/sentryexporter/metadata.yaml index ea049b5c20f0..c9cfb5d63e59 100644 --- a/exporter/sentryexporter/metadata.yaml +++ b/exporter/sentryexporter/metadata.yaml @@ -10,5 +10,4 @@ status: tests: - config: expect_consumer_error: true \ No newline at end of file diff --git a/exporter/signalfxexporter/generated_component_test.go b/exporter/signalfxexporter/generated_component_test.go index 336ab976fc53..189d9cc9d455 100644 --- a/exporter/signalfxexporter/generated_component_test.go +++ b/exporter/signalfxexporter/generated_component_test.go @@ -10,11 +10,9 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exportertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/plog" "go.opentelemetry.io/collector/pdata/pmetric" @@ -65,9 +63,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/exporter/skywalkingexporter/generated_component_test.go b/exporter/skywalkingexporter/generated_component_test.go index 3f1c7a22b147..1827d9cf9e4f 100644 --- a/exporter/skywalkingexporter/generated_component_test.go +++ b/exporter/skywalkingexporter/generated_component_test.go @@ -9,12 +9,9 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exportertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/plog" "go.opentelemetry.io/collector/pdata/pmetric" @@ -58,45 +55,6 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - - t.Run(test.name+"-lifecycle", func(t *testing.T) { - - // TODO support lifecycle - t.SkipNow() - - c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) - require.NoError(t, err) - host := componenttest.NewNopHost() - err = c.Start(context.Background(), host) - require.NoError(t, err) - require.NotPanics(t, func() { - switch e := c.(type) { - case exporter.Logs: - logs := generateLifecycleTestLogs() - if !e.Capabilities().MutatesData { - logs.MarkReadOnly() - } - err = e.ConsumeLogs(context.Background(), logs) - case exporter.Metrics: - metrics := generateLifecycleTestMetrics() - if !e.Capabilities().MutatesData { - metrics.MarkReadOnly() - } - err = e.ConsumeMetrics(context.Background(), metrics) - case exporter.Traces: - traces := generateLifecycleTestTraces() - if !e.Capabilities().MutatesData { - traces.MarkReadOnly() - } - err = e.ConsumeTraces(context.Background(), traces) - } - }) - - require.NoError(t, err) - - err = c.Shutdown(context.Background()) - require.NoError(t, err) - }) } } diff --git a/exporter/skywalkingexporter/metadata.yaml b/exporter/skywalkingexporter/metadata.yaml index 8ee4d617a205..817d539be1d5 100644 --- a/exporter/skywalkingexporter/metadata.yaml +++ b/exporter/skywalkingexporter/metadata.yaml @@ -10,5 +10,4 @@ status: emeritus: [liqiangz] tests: - config: skip_lifecycle: true diff --git a/exporter/splunkhecexporter/generated_component_test.go b/exporter/splunkhecexporter/generated_component_test.go index af5d1c88c657..4f617c1b3d48 100644 --- a/exporter/splunkhecexporter/generated_component_test.go +++ b/exporter/splunkhecexporter/generated_component_test.go @@ -10,11 +10,9 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exportertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/plog" "go.opentelemetry.io/collector/pdata/pmetric" @@ -65,9 +63,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/exporter/sumologicexporter/generated_component_test.go b/exporter/sumologicexporter/generated_component_test.go index 6e2c96f27a0e..9dc51201a441 100644 --- a/exporter/sumologicexporter/generated_component_test.go +++ b/exporter/sumologicexporter/generated_component_test.go @@ -9,12 +9,9 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exportertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/plog" "go.opentelemetry.io/collector/pdata/pmetric" @@ -58,45 +55,6 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - - t.Run(test.name+"-lifecycle", func(t *testing.T) { - - // TODO support lifecycle - t.SkipNow() - - c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) - require.NoError(t, err) - host := componenttest.NewNopHost() - err = c.Start(context.Background(), host) - require.NoError(t, err) - require.NotPanics(t, func() { - switch e := c.(type) { - case exporter.Logs: - logs := generateLifecycleTestLogs() - if !e.Capabilities().MutatesData { - logs.MarkReadOnly() - } - err = e.ConsumeLogs(context.Background(), logs) - case exporter.Metrics: - metrics := generateLifecycleTestMetrics() - if !e.Capabilities().MutatesData { - metrics.MarkReadOnly() - } - err = e.ConsumeMetrics(context.Background(), metrics) - case exporter.Traces: - traces := generateLifecycleTestTraces() - if !e.Capabilities().MutatesData { - traces.MarkReadOnly() - } - err = e.ConsumeTraces(context.Background(), traces) - } - }) - - require.NoError(t, err) - - err = c.Shutdown(context.Background()) - require.NoError(t, err) - }) } } diff --git a/exporter/sumologicexporter/metadata.yaml b/exporter/sumologicexporter/metadata.yaml index 13c2c248ac91..8675ce025cb0 100644 --- a/exporter/sumologicexporter/metadata.yaml +++ b/exporter/sumologicexporter/metadata.yaml @@ -8,6 +8,6 @@ status: codeowners: active: [sumo-drosiek] +# TODO: Update the exporter to pass the tests tests: - config: skip_lifecycle: true diff --git a/exporter/syslogexporter/generated_component_test.go b/exporter/syslogexporter/generated_component_test.go index 7fd40a462458..4acdd30f1a29 100644 --- a/exporter/syslogexporter/generated_component_test.go +++ b/exporter/syslogexporter/generated_component_test.go @@ -9,12 +9,9 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exportertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/plog" "go.opentelemetry.io/collector/pdata/pmetric" @@ -51,45 +48,6 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - - t.Run(test.name+"-lifecycle", func(t *testing.T) { - - // TODO support lifecycle - t.SkipNow() - - c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) - require.NoError(t, err) - host := componenttest.NewNopHost() - err = c.Start(context.Background(), host) - require.NoError(t, err) - require.NotPanics(t, func() { - switch e := c.(type) { - case exporter.Logs: - logs := generateLifecycleTestLogs() - if !e.Capabilities().MutatesData { - logs.MarkReadOnly() - } - err = e.ConsumeLogs(context.Background(), logs) - case exporter.Metrics: - metrics := generateLifecycleTestMetrics() - if !e.Capabilities().MutatesData { - metrics.MarkReadOnly() - } - err = e.ConsumeMetrics(context.Background(), metrics) - case exporter.Traces: - traces := generateLifecycleTestTraces() - if !e.Capabilities().MutatesData { - traces.MarkReadOnly() - } - err = e.ConsumeTraces(context.Background(), traces) - } - }) - - require.NoError(t, err) - - err = c.Shutdown(context.Background()) - require.NoError(t, err) - }) } } diff --git a/exporter/syslogexporter/metadata.yaml b/exporter/syslogexporter/metadata.yaml index 4566dbad9278..f0c4679af848 100644 --- a/exporter/syslogexporter/metadata.yaml +++ b/exporter/syslogexporter/metadata.yaml @@ -8,6 +8,6 @@ status: codeowners: active: [kkujawa-sumo, rnishtala-sumo, astencel-sumo] +# TODO: Update the exporter to pass the tests tests: - config: skip_lifecycle: true diff --git a/exporter/tencentcloudlogserviceexporter/generated_component_test.go b/exporter/tencentcloudlogserviceexporter/generated_component_test.go index 3dcffff91e21..d8ca76aee854 100644 --- a/exporter/tencentcloudlogserviceexporter/generated_component_test.go +++ b/exporter/tencentcloudlogserviceexporter/generated_component_test.go @@ -9,12 +9,9 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exportertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/plog" "go.opentelemetry.io/collector/pdata/pmetric" @@ -51,45 +48,6 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - - t.Run(test.name+"-lifecycle", func(t *testing.T) { - - // TODO support lifecycle - t.SkipNow() - - c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) - require.NoError(t, err) - host := componenttest.NewNopHost() - err = c.Start(context.Background(), host) - require.NoError(t, err) - require.NotPanics(t, func() { - switch e := c.(type) { - case exporter.Logs: - logs := generateLifecycleTestLogs() - if !e.Capabilities().MutatesData { - logs.MarkReadOnly() - } - err = e.ConsumeLogs(context.Background(), logs) - case exporter.Metrics: - metrics := generateLifecycleTestMetrics() - if !e.Capabilities().MutatesData { - metrics.MarkReadOnly() - } - err = e.ConsumeMetrics(context.Background(), metrics) - case exporter.Traces: - traces := generateLifecycleTestTraces() - if !e.Capabilities().MutatesData { - traces.MarkReadOnly() - } - err = e.ConsumeTraces(context.Background(), traces) - } - }) - - require.NoError(t, err) - - err = c.Shutdown(context.Background()) - require.NoError(t, err) - }) } } diff --git a/exporter/tencentcloudlogserviceexporter/metadata.yaml b/exporter/tencentcloudlogserviceexporter/metadata.yaml index 59b84df9c5f5..3d2f9bd64893 100644 --- a/exporter/tencentcloudlogserviceexporter/metadata.yaml +++ b/exporter/tencentcloudlogserviceexporter/metadata.yaml @@ -8,6 +8,6 @@ status: codeowners: active: [wgliang, yiyang5055] +# TODO: Update the exporter to pass the tests tests: - config: skip_lifecycle: true diff --git a/exporter/zipkinexporter/generated_component_test.go b/exporter/zipkinexporter/generated_component_test.go index 625a58f5509b..c223b5d0bc5c 100644 --- a/exporter/zipkinexporter/generated_component_test.go +++ b/exporter/zipkinexporter/generated_component_test.go @@ -10,11 +10,9 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exportertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/plog" "go.opentelemetry.io/collector/pdata/pmetric" @@ -51,9 +49,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/exporter/zipkinexporter/metadata.yaml b/exporter/zipkinexporter/metadata.yaml index e61ffff77ef5..6890a6ff9095 100644 --- a/exporter/zipkinexporter/metadata.yaml +++ b/exporter/zipkinexporter/metadata.yaml @@ -7,6 +7,3 @@ status: distributions: [core, contrib, observiq, liatrio] codeowners: active: [MovieStoreGuy, astencel-sumo, crobert-1] - -tests: - config: diff --git a/extension/ackextension/metadata.yaml b/extension/ackextension/metadata.yaml index f039614458e0..b9212a9c8fda 100644 --- a/extension/ackextension/metadata.yaml +++ b/extension/ackextension/metadata.yaml @@ -7,3 +7,7 @@ status: distributions: [contrib, splunk] codeowners: active: [zpzhuSplunk, splunkericl] + +tests: + skip_lifecycle: true + skip_shutdown: true diff --git a/extension/asapauthextension/metadata.yaml b/extension/asapauthextension/metadata.yaml index e513253ee2af..f8e943196f43 100644 --- a/extension/asapauthextension/metadata.yaml +++ b/extension/asapauthextension/metadata.yaml @@ -7,3 +7,8 @@ status: distributions: [contrib, sumo] codeowners: active: [jamesmoessis, MovieStoreGuy] + +# TODO: Update the extension to make the tests pass +tests: + skip_lifecycle: true + skip_shutdown: true diff --git a/extension/awsproxy/metadata.yaml b/extension/awsproxy/metadata.yaml index a2987a86d0fa..2d717611011f 100644 --- a/extension/awsproxy/metadata.yaml +++ b/extension/awsproxy/metadata.yaml @@ -7,3 +7,8 @@ status: distributions: [contrib, aws, sumo] codeowners: active: [Aneurysm9, mxiamxia] + +# TODO: Update the extension to make the tests pass +tests: + skip_lifecycle: true + skip_shutdown: true diff --git a/extension/basicauthextension/generated_component_test.go b/extension/basicauthextension/generated_component_test.go index 01acec28ff69..c507fb7186ee 100644 --- a/extension/basicauthextension/generated_component_test.go +++ b/extension/basicauthextension/generated_component_test.go @@ -9,10 +9,8 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - - "go.opentelemetry.io/collector/extension/extensiontest" - "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/extension/extensiontest" ) func TestComponentLifecycle(t *testing.T) { @@ -24,16 +22,13 @@ func TestComponentLifecycle(t *testing.T) { sub, err := cm.Sub("tests::config") require.NoError(t, err) require.NoError(t, component.UnmarshalConfig(sub, cfg)) - t.Run("shutdown", func(t *testing.T) { e, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) require.NoError(t, err) err = e.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run("lifecycle", func(t *testing.T) { - firstExt, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) require.NoError(t, err) require.NoError(t, firstExt.Start(context.Background(), componenttest.NewNopHost())) diff --git a/extension/bearertokenauthextension/generated_component_test.go b/extension/bearertokenauthextension/generated_component_test.go index f3002cbd36f9..e4c98d4bbfa0 100644 --- a/extension/bearertokenauthextension/generated_component_test.go +++ b/extension/bearertokenauthextension/generated_component_test.go @@ -9,10 +9,8 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - - "go.opentelemetry.io/collector/extension/extensiontest" - "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/extension/extensiontest" ) func TestComponentLifecycle(t *testing.T) { @@ -24,16 +22,13 @@ func TestComponentLifecycle(t *testing.T) { sub, err := cm.Sub("tests::config") require.NoError(t, err) require.NoError(t, component.UnmarshalConfig(sub, cfg)) - t.Run("shutdown", func(t *testing.T) { e, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) require.NoError(t, err) err = e.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run("lifecycle", func(t *testing.T) { - firstExt, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) require.NoError(t, err) require.NoError(t, firstExt.Start(context.Background(), componenttest.NewNopHost())) diff --git a/extension/encoding/jaegerencodingextension/generated_component_test.go b/extension/encoding/jaegerencodingextension/generated_component_test.go index 1cdc90e8b68e..25002d065f4f 100644 --- a/extension/encoding/jaegerencodingextension/generated_component_test.go +++ b/extension/encoding/jaegerencodingextension/generated_component_test.go @@ -9,10 +9,8 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - - "go.opentelemetry.io/collector/extension/extensiontest" - "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/extension/extensiontest" ) func TestComponentLifecycle(t *testing.T) { @@ -24,16 +22,13 @@ func TestComponentLifecycle(t *testing.T) { sub, err := cm.Sub("tests::config") require.NoError(t, err) require.NoError(t, component.UnmarshalConfig(sub, cfg)) - t.Run("shutdown", func(t *testing.T) { e, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) require.NoError(t, err) err = e.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run("lifecycle", func(t *testing.T) { - firstExt, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) require.NoError(t, err) require.NoError(t, firstExt.Start(context.Background(), componenttest.NewNopHost())) diff --git a/extension/encoding/jsonlogencodingextension/generated_component_test.go b/extension/encoding/jsonlogencodingextension/generated_component_test.go index 61e4cd82cce6..06031169f8a6 100644 --- a/extension/encoding/jsonlogencodingextension/generated_component_test.go +++ b/extension/encoding/jsonlogencodingextension/generated_component_test.go @@ -9,10 +9,8 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - - "go.opentelemetry.io/collector/extension/extensiontest" - "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/extension/extensiontest" ) func TestComponentLifecycle(t *testing.T) { @@ -24,16 +22,13 @@ func TestComponentLifecycle(t *testing.T) { sub, err := cm.Sub("tests::config") require.NoError(t, err) require.NoError(t, component.UnmarshalConfig(sub, cfg)) - t.Run("shutdown", func(t *testing.T) { e, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) require.NoError(t, err) err = e.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run("lifecycle", func(t *testing.T) { - firstExt, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) require.NoError(t, err) require.NoError(t, firstExt.Start(context.Background(), componenttest.NewNopHost())) diff --git a/extension/encoding/otlpencodingextension/generated_component_test.go b/extension/encoding/otlpencodingextension/generated_component_test.go index 419d2c46d9c4..0d8dcf68c223 100644 --- a/extension/encoding/otlpencodingextension/generated_component_test.go +++ b/extension/encoding/otlpencodingextension/generated_component_test.go @@ -9,10 +9,8 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - - "go.opentelemetry.io/collector/extension/extensiontest" - "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/extension/extensiontest" ) func TestComponentLifecycle(t *testing.T) { @@ -24,16 +22,13 @@ func TestComponentLifecycle(t *testing.T) { sub, err := cm.Sub("tests::config") require.NoError(t, err) require.NoError(t, component.UnmarshalConfig(sub, cfg)) - t.Run("shutdown", func(t *testing.T) { e, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) require.NoError(t, err) err = e.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run("lifecycle", func(t *testing.T) { - firstExt, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) require.NoError(t, err) require.NoError(t, firstExt.Start(context.Background(), componenttest.NewNopHost())) diff --git a/extension/encoding/textencodingextension/generated_component_test.go b/extension/encoding/textencodingextension/generated_component_test.go index b5ec6d21398a..24c3489a465f 100644 --- a/extension/encoding/textencodingextension/generated_component_test.go +++ b/extension/encoding/textencodingextension/generated_component_test.go @@ -9,10 +9,8 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - - "go.opentelemetry.io/collector/extension/extensiontest" - "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/extension/extensiontest" ) func TestComponentLifecycle(t *testing.T) { @@ -24,16 +22,13 @@ func TestComponentLifecycle(t *testing.T) { sub, err := cm.Sub("tests::config") require.NoError(t, err) require.NoError(t, component.UnmarshalConfig(sub, cfg)) - t.Run("shutdown", func(t *testing.T) { e, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) require.NoError(t, err) err = e.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run("lifecycle", func(t *testing.T) { - firstExt, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) require.NoError(t, err) require.NoError(t, firstExt.Start(context.Background(), componenttest.NewNopHost())) diff --git a/extension/encoding/zipkinencodingextension/generated_component_test.go b/extension/encoding/zipkinencodingextension/generated_component_test.go index 4be7dd0f8ed3..88fba0d4d201 100644 --- a/extension/encoding/zipkinencodingextension/generated_component_test.go +++ b/extension/encoding/zipkinencodingextension/generated_component_test.go @@ -9,10 +9,8 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - - "go.opentelemetry.io/collector/extension/extensiontest" - "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/extension/extensiontest" ) func TestComponentLifecycle(t *testing.T) { @@ -24,16 +22,13 @@ func TestComponentLifecycle(t *testing.T) { sub, err := cm.Sub("tests::config") require.NoError(t, err) require.NoError(t, component.UnmarshalConfig(sub, cfg)) - t.Run("shutdown", func(t *testing.T) { e, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) require.NoError(t, err) err = e.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run("lifecycle", func(t *testing.T) { - firstExt, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) require.NoError(t, err) require.NoError(t, firstExt.Start(context.Background(), componenttest.NewNopHost())) diff --git a/extension/headerssetterextension/generated_component_test.go b/extension/headerssetterextension/generated_component_test.go index fde6fd32d818..6bfc0c1c3413 100644 --- a/extension/headerssetterextension/generated_component_test.go +++ b/extension/headerssetterextension/generated_component_test.go @@ -9,10 +9,8 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - - "go.opentelemetry.io/collector/extension/extensiontest" - "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/extension/extensiontest" ) func TestComponentLifecycle(t *testing.T) { @@ -24,16 +22,13 @@ func TestComponentLifecycle(t *testing.T) { sub, err := cm.Sub("tests::config") require.NoError(t, err) require.NoError(t, component.UnmarshalConfig(sub, cfg)) - t.Run("shutdown", func(t *testing.T) { e, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) require.NoError(t, err) err = e.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run("lifecycle", func(t *testing.T) { - firstExt, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) require.NoError(t, err) require.NoError(t, firstExt.Start(context.Background(), componenttest.NewNopHost())) diff --git a/extension/healthcheckextension/generated_component_test.go b/extension/healthcheckextension/generated_component_test.go index f69a58e4180b..977fe6e5a838 100644 --- a/extension/healthcheckextension/generated_component_test.go +++ b/extension/healthcheckextension/generated_component_test.go @@ -9,10 +9,8 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - - "go.opentelemetry.io/collector/extension/extensiontest" - "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/extension/extensiontest" ) func TestComponentLifecycle(t *testing.T) { @@ -24,16 +22,13 @@ func TestComponentLifecycle(t *testing.T) { sub, err := cm.Sub("tests::config") require.NoError(t, err) require.NoError(t, component.UnmarshalConfig(sub, cfg)) - t.Run("shutdown", func(t *testing.T) { e, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) require.NoError(t, err) err = e.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run("lifecycle", func(t *testing.T) { - firstExt, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) require.NoError(t, err) require.NoError(t, firstExt.Start(context.Background(), componenttest.NewNopHost())) diff --git a/extension/httpforwarderextension/metadata.yaml b/extension/httpforwarderextension/metadata.yaml index d41a2ea7e4d9..ed07ffb3aa8d 100644 --- a/extension/httpforwarderextension/metadata.yaml +++ b/extension/httpforwarderextension/metadata.yaml @@ -7,3 +7,8 @@ status: distributions: [] codeowners: active: [atoulme, rmfitzpatrick] + +# TODO: Update the extension to make the tests pass +tests: + skip_lifecycle: true + skip_shutdown: true diff --git a/extension/jaegerremotesampling/generated_component_test.go b/extension/jaegerremotesampling/generated_component_test.go new file mode 100644 index 000000000000..33dedb1680c5 --- /dev/null +++ b/extension/jaegerremotesampling/generated_component_test.go @@ -0,0 +1,30 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package jaegerremotesampling + +import ( + "context" + "testing" + + "github.com/stretchr/testify/require" + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/extension/extensiontest" +) + +func TestComponentLifecycle(t *testing.T) { + factory := NewFactory() + + cm, err := confmaptest.LoadConf("metadata.yaml") + require.NoError(t, err) + cfg := factory.CreateDefaultConfig() + sub, err := cm.Sub("tests::config") + require.NoError(t, err) + require.NoError(t, component.UnmarshalConfig(sub, cfg)) + t.Run("shutdown", func(t *testing.T) { + e, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + err = e.Shutdown(context.Background()) + require.NoError(t, err) + }) +} diff --git a/extension/jaegerremotesampling/metadata.yaml b/extension/jaegerremotesampling/metadata.yaml index 46b400bd352d..ea0e7ef23537 100644 --- a/extension/jaegerremotesampling/metadata.yaml +++ b/extension/jaegerremotesampling/metadata.yaml @@ -11,3 +11,7 @@ status: - sumo codeowners: active: [yurishkuro, frzifus] + +# TODO: Update the extension to make the tests pass +tests: + skip_lifecycle: true diff --git a/extension/oauth2clientauthextension/generated_component_test.go b/extension/oauth2clientauthextension/generated_component_test.go index 01a0fdf0cb14..b3941a495e84 100644 --- a/extension/oauth2clientauthextension/generated_component_test.go +++ b/extension/oauth2clientauthextension/generated_component_test.go @@ -9,10 +9,8 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - - "go.opentelemetry.io/collector/extension/extensiontest" - "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/extension/extensiontest" ) func TestComponentLifecycle(t *testing.T) { @@ -24,16 +22,13 @@ func TestComponentLifecycle(t *testing.T) { sub, err := cm.Sub("tests::config") require.NoError(t, err) require.NoError(t, component.UnmarshalConfig(sub, cfg)) - t.Run("shutdown", func(t *testing.T) { e, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) require.NoError(t, err) err = e.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run("lifecycle", func(t *testing.T) { - firstExt, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) require.NoError(t, err) require.NoError(t, firstExt.Start(context.Background(), componenttest.NewNopHost())) diff --git a/extension/observer/dockerobserver/generated_component_test.go b/extension/observer/dockerobserver/generated_component_test.go new file mode 100644 index 000000000000..11f7c8cc06a7 --- /dev/null +++ b/extension/observer/dockerobserver/generated_component_test.go @@ -0,0 +1,42 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package dockerobserver + +import ( + "context" + "testing" + + "github.com/stretchr/testify/require" + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/component/componenttest" + "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/extension/extensiontest" +) + +func TestComponentLifecycle(t *testing.T) { + factory := NewFactory() + + cm, err := confmaptest.LoadConf("metadata.yaml") + require.NoError(t, err) + cfg := factory.CreateDefaultConfig() + sub, err := cm.Sub("tests::config") + require.NoError(t, err) + require.NoError(t, component.UnmarshalConfig(sub, cfg)) + t.Run("shutdown", func(t *testing.T) { + e, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + err = e.Shutdown(context.Background()) + require.NoError(t, err) + }) + t.Run("lifecycle", func(t *testing.T) { + firstExt, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + require.NoError(t, firstExt.Start(context.Background(), componenttest.NewNopHost())) + require.NoError(t, firstExt.Shutdown(context.Background())) + + secondExt, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + require.NoError(t, secondExt.Start(context.Background(), componenttest.NewNopHost())) + require.NoError(t, secondExt.Shutdown(context.Background())) + }) +} diff --git a/extension/observer/ecsobserver/metadata.yaml b/extension/observer/ecsobserver/metadata.yaml index 9f1e59fb8419..9787f88c0d9c 100644 --- a/extension/observer/ecsobserver/metadata.yaml +++ b/extension/observer/ecsobserver/metadata.yaml @@ -7,3 +7,8 @@ status: distributions: [contrib, aws, splunk, sumo] codeowners: active: [dmitryax, rmfitzpatrick] + +# TODO: Update the extension to make the tests pass +tests: + skip_lifecycle: true + skip_shutdown: true diff --git a/extension/observer/ecstaskobserver/metadata.yaml b/extension/observer/ecstaskobserver/metadata.yaml index 21882823f67f..64df54ada926 100644 --- a/extension/observer/ecstaskobserver/metadata.yaml +++ b/extension/observer/ecstaskobserver/metadata.yaml @@ -7,3 +7,8 @@ status: distributions: [contrib, splunk, sumo] codeowners: active: [rmfitzpatrick] + +# TODO: Update the extension to make the tests pass +tests: + skip_lifecycle: true + skip_shutdown: true diff --git a/extension/observer/hostobserver/generated_component_test.go b/extension/observer/hostobserver/generated_component_test.go new file mode 100644 index 000000000000..fc8046c1668d --- /dev/null +++ b/extension/observer/hostobserver/generated_component_test.go @@ -0,0 +1,42 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package hostobserver + +import ( + "context" + "testing" + + "github.com/stretchr/testify/require" + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/component/componenttest" + "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/extension/extensiontest" +) + +func TestComponentLifecycle(t *testing.T) { + factory := NewFactory() + + cm, err := confmaptest.LoadConf("metadata.yaml") + require.NoError(t, err) + cfg := factory.CreateDefaultConfig() + sub, err := cm.Sub("tests::config") + require.NoError(t, err) + require.NoError(t, component.UnmarshalConfig(sub, cfg)) + t.Run("shutdown", func(t *testing.T) { + e, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + err = e.Shutdown(context.Background()) + require.NoError(t, err) + }) + t.Run("lifecycle", func(t *testing.T) { + firstExt, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + require.NoError(t, firstExt.Start(context.Background(), componenttest.NewNopHost())) + require.NoError(t, firstExt.Shutdown(context.Background())) + + secondExt, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + require.NoError(t, secondExt.Start(context.Background(), componenttest.NewNopHost())) + require.NoError(t, secondExt.Shutdown(context.Background())) + }) +} diff --git a/extension/observer/k8sobserver/metadata.yaml b/extension/observer/k8sobserver/metadata.yaml index db0065725397..2d51dae899f9 100644 --- a/extension/observer/k8sobserver/metadata.yaml +++ b/extension/observer/k8sobserver/metadata.yaml @@ -7,3 +7,8 @@ status: distributions: [contrib, splunk, sumo] codeowners: active: [rmfitzpatrick, dmitryax] + +# TODO: Update the extension to make the tests pass +tests: + skip_lifecycle: true + skip_shutdown: true diff --git a/extension/oidcauthextension/generated_component_test.go b/extension/oidcauthextension/generated_component_test.go index e562822260ec..9ea4072ff751 100644 --- a/extension/oidcauthextension/generated_component_test.go +++ b/extension/oidcauthextension/generated_component_test.go @@ -8,11 +8,8 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/component/componenttest" - - "go.opentelemetry.io/collector/extension/extensiontest" - "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/extension/extensiontest" ) func TestComponentLifecycle(t *testing.T) { @@ -24,27 +21,10 @@ func TestComponentLifecycle(t *testing.T) { sub, err := cm.Sub("tests::config") require.NoError(t, err) require.NoError(t, component.UnmarshalConfig(sub, cfg)) - t.Run("shutdown", func(t *testing.T) { e, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) require.NoError(t, err) err = e.Shutdown(context.Background()) require.NoError(t, err) }) - - t.Run("lifecycle", func(t *testing.T) { - - // TODO support lifecycle - t.SkipNow() - - firstExt, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) - require.NoError(t, err) - require.NoError(t, firstExt.Start(context.Background(), componenttest.NewNopHost())) - require.NoError(t, firstExt.Shutdown(context.Background())) - - secondExt, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) - require.NoError(t, err) - require.NoError(t, secondExt.Start(context.Background(), componenttest.NewNopHost())) - require.NoError(t, secondExt.Shutdown(context.Background())) - }) } diff --git a/extension/opampextension/generated_component_test.go b/extension/opampextension/generated_component_test.go index f6ef4500b3e4..9f981c640967 100644 --- a/extension/opampextension/generated_component_test.go +++ b/extension/opampextension/generated_component_test.go @@ -9,10 +9,8 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - - "go.opentelemetry.io/collector/extension/extensiontest" - "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/extension/extensiontest" ) func TestComponentLifecycle(t *testing.T) { @@ -24,16 +22,13 @@ func TestComponentLifecycle(t *testing.T) { sub, err := cm.Sub("tests::config") require.NoError(t, err) require.NoError(t, component.UnmarshalConfig(sub, cfg)) - t.Run("shutdown", func(t *testing.T) { e, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) require.NoError(t, err) err = e.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run("lifecycle", func(t *testing.T) { - firstExt, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) require.NoError(t, err) require.NoError(t, firstExt.Start(context.Background(), componenttest.NewNopHost())) diff --git a/extension/pprofextension/generated_component_test.go b/extension/pprofextension/generated_component_test.go index 81e64aa7426f..60fd77ba6b37 100644 --- a/extension/pprofextension/generated_component_test.go +++ b/extension/pprofextension/generated_component_test.go @@ -9,10 +9,8 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - - "go.opentelemetry.io/collector/extension/extensiontest" - "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/extension/extensiontest" ) func TestComponentLifecycle(t *testing.T) { @@ -24,16 +22,13 @@ func TestComponentLifecycle(t *testing.T) { sub, err := cm.Sub("tests::config") require.NoError(t, err) require.NoError(t, component.UnmarshalConfig(sub, cfg)) - t.Run("shutdown", func(t *testing.T) { e, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) require.NoError(t, err) err = e.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run("lifecycle", func(t *testing.T) { - firstExt, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) require.NoError(t, err) require.NoError(t, firstExt.Start(context.Background(), componenttest.NewNopHost())) diff --git a/extension/remotetapextension/generated_component_test.go b/extension/remotetapextension/generated_component_test.go index a53db44c6455..2252f12ca8d4 100644 --- a/extension/remotetapextension/generated_component_test.go +++ b/extension/remotetapextension/generated_component_test.go @@ -9,10 +9,8 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - - "go.opentelemetry.io/collector/extension/extensiontest" - "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/extension/extensiontest" ) func TestComponentLifecycle(t *testing.T) { @@ -24,16 +22,13 @@ func TestComponentLifecycle(t *testing.T) { sub, err := cm.Sub("tests::config") require.NoError(t, err) require.NoError(t, component.UnmarshalConfig(sub, cfg)) - t.Run("shutdown", func(t *testing.T) { e, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) require.NoError(t, err) err = e.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run("lifecycle", func(t *testing.T) { - firstExt, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) require.NoError(t, err) require.NoError(t, firstExt.Start(context.Background(), componenttest.NewNopHost())) diff --git a/extension/sigv4authextension/generated_component_test.go b/extension/sigv4authextension/generated_component_test.go index 266a8d925ba4..d21f1d87dcc7 100644 --- a/extension/sigv4authextension/generated_component_test.go +++ b/extension/sigv4authextension/generated_component_test.go @@ -9,10 +9,8 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - - "go.opentelemetry.io/collector/extension/extensiontest" - "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/extension/extensiontest" ) func TestComponentLifecycle(t *testing.T) { @@ -24,16 +22,13 @@ func TestComponentLifecycle(t *testing.T) { sub, err := cm.Sub("tests::config") require.NoError(t, err) require.NoError(t, component.UnmarshalConfig(sub, cfg)) - t.Run("shutdown", func(t *testing.T) { e, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) require.NoError(t, err) err = e.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run("lifecycle", func(t *testing.T) { - firstExt, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) require.NoError(t, err) require.NoError(t, firstExt.Start(context.Background(), componenttest.NewNopHost())) diff --git a/extension/solarwindsapmsettingsextension/generated_component_test.go b/extension/solarwindsapmsettingsextension/generated_component_test.go new file mode 100644 index 000000000000..afbaecbe570d --- /dev/null +++ b/extension/solarwindsapmsettingsextension/generated_component_test.go @@ -0,0 +1,42 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package solarwindsapmsettingsextension + +import ( + "context" + "testing" + + "github.com/stretchr/testify/require" + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/component/componenttest" + "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/extension/extensiontest" +) + +func TestComponentLifecycle(t *testing.T) { + factory := NewFactory() + + cm, err := confmaptest.LoadConf("metadata.yaml") + require.NoError(t, err) + cfg := factory.CreateDefaultConfig() + sub, err := cm.Sub("tests::config") + require.NoError(t, err) + require.NoError(t, component.UnmarshalConfig(sub, cfg)) + t.Run("shutdown", func(t *testing.T) { + e, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + err = e.Shutdown(context.Background()) + require.NoError(t, err) + }) + t.Run("lifecycle", func(t *testing.T) { + firstExt, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + require.NoError(t, firstExt.Start(context.Background(), componenttest.NewNopHost())) + require.NoError(t, firstExt.Shutdown(context.Background())) + + secondExt, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + require.NoError(t, secondExt.Start(context.Background(), componenttest.NewNopHost())) + require.NoError(t, secondExt.Shutdown(context.Background())) + }) +} diff --git a/extension/solarwindsapmsettingsextension/go.mod b/extension/solarwindsapmsettingsextension/go.mod index 91d7f6ce5c78..a98e16fab4ba 100644 --- a/extension/solarwindsapmsettingsextension/go.mod +++ b/extension/solarwindsapmsettingsextension/go.mod @@ -5,6 +5,7 @@ go 1.21 require ( github.com/stretchr/testify v1.8.4 go.opentelemetry.io/collector/component v0.95.0 + go.opentelemetry.io/collector/confmap v0.95.0 go.opentelemetry.io/collector/extension v0.95.0 go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 @@ -32,7 +33,6 @@ require ( github.com/prometheus/common v0.46.0 // indirect github.com/prometheus/procfs v0.12.0 // indirect go.opentelemetry.io/collector/config/configtelemetry v0.95.0 // indirect - go.opentelemetry.io/collector/confmap v0.95.0 // indirect go.opentelemetry.io/collector/pdata v1.2.0 // indirect go.opentelemetry.io/otel v1.23.1 // indirect go.opentelemetry.io/otel/exporters/prometheus v0.45.2 // indirect diff --git a/extension/storage/dbstorage/generated_component_test.go b/extension/storage/dbstorage/generated_component_test.go new file mode 100644 index 000000000000..65e7b5632143 --- /dev/null +++ b/extension/storage/dbstorage/generated_component_test.go @@ -0,0 +1,30 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package dbstorage + +import ( + "context" + "testing" + + "github.com/stretchr/testify/require" + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/extension/extensiontest" +) + +func TestComponentLifecycle(t *testing.T) { + factory := NewFactory() + + cm, err := confmaptest.LoadConf("metadata.yaml") + require.NoError(t, err) + cfg := factory.CreateDefaultConfig() + sub, err := cm.Sub("tests::config") + require.NoError(t, err) + require.NoError(t, component.UnmarshalConfig(sub, cfg)) + t.Run("shutdown", func(t *testing.T) { + e, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + err = e.Shutdown(context.Background()) + require.NoError(t, err) + }) +} diff --git a/extension/storage/dbstorage/go.mod b/extension/storage/dbstorage/go.mod index c91b684edf08..9427457893e6 100644 --- a/extension/storage/dbstorage/go.mod +++ b/extension/storage/dbstorage/go.mod @@ -7,6 +7,7 @@ require ( github.com/mattn/go-sqlite3 v1.14.22 github.com/stretchr/testify v1.8.4 go.opentelemetry.io/collector/component v0.95.0 + go.opentelemetry.io/collector/confmap v0.95.0 go.opentelemetry.io/collector/extension v0.95.0 go.opentelemetry.io/otel/metric v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 @@ -43,7 +44,6 @@ require ( github.com/prometheus/common v0.46.0 // indirect github.com/prometheus/procfs v0.12.0 // indirect go.opentelemetry.io/collector/config/configtelemetry v0.95.0 // indirect - go.opentelemetry.io/collector/confmap v0.95.0 // indirect go.opentelemetry.io/collector/pdata v1.2.0 // indirect go.opentelemetry.io/otel v1.23.1 // indirect go.opentelemetry.io/otel/exporters/prometheus v0.45.2 // indirect diff --git a/extension/storage/dbstorage/metadata.yaml b/extension/storage/dbstorage/metadata.yaml index 3142ebba4c29..7f714b17c6eb 100644 --- a/extension/storage/dbstorage/metadata.yaml +++ b/extension/storage/dbstorage/metadata.yaml @@ -7,3 +7,7 @@ status: distributions: [contrib, sumo] codeowners: active: [dmitryax, atoulme] + +# TODO: Update the extension to make the tests pass +tests: + skip_lifecycle: true diff --git a/extension/storage/filestorage/generated_component_test.go b/extension/storage/filestorage/generated_component_test.go new file mode 100644 index 000000000000..de532e008c6b --- /dev/null +++ b/extension/storage/filestorage/generated_component_test.go @@ -0,0 +1,42 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package filestorage + +import ( + "context" + "testing" + + "github.com/stretchr/testify/require" + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/component/componenttest" + "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/extension/extensiontest" +) + +func TestComponentLifecycle(t *testing.T) { + factory := NewFactory() + + cm, err := confmaptest.LoadConf("metadata.yaml") + require.NoError(t, err) + cfg := factory.CreateDefaultConfig() + sub, err := cm.Sub("tests::config") + require.NoError(t, err) + require.NoError(t, component.UnmarshalConfig(sub, cfg)) + t.Run("shutdown", func(t *testing.T) { + e, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + err = e.Shutdown(context.Background()) + require.NoError(t, err) + }) + t.Run("lifecycle", func(t *testing.T) { + firstExt, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + require.NoError(t, firstExt.Start(context.Background(), componenttest.NewNopHost())) + require.NoError(t, firstExt.Shutdown(context.Background())) + + secondExt, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + require.NoError(t, secondExt.Start(context.Background(), componenttest.NewNopHost())) + require.NoError(t, secondExt.Shutdown(context.Background())) + }) +} diff --git a/extension/sumologicextension/metadata.yaml b/extension/sumologicextension/metadata.yaml index 464a9643a751..21a84f421476 100644 --- a/extension/sumologicextension/metadata.yaml +++ b/extension/sumologicextension/metadata.yaml @@ -7,3 +7,8 @@ status: distributions: [sumo] codeowners: active: [astencel-sumo, sumo-drosiek, swiatekm-sumo] + +# TODO: Update the extension to make the tests pass +tests: + skip_lifecycle: true + skip_shutdown: true diff --git a/processor/attributesprocessor/generated_component_test.go b/processor/attributesprocessor/generated_component_test.go index c0e9076ac2d1..1bc1c863c777 100644 --- a/processor/attributesprocessor/generated_component_test.go +++ b/processor/attributesprocessor/generated_component_test.go @@ -10,16 +10,14 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - - "go.opentelemetry.io/collector/consumer/consumertest" - "go.opentelemetry.io/collector/processor" - "go.opentelemetry.io/collector/processor/processortest" - "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/plog" "go.opentelemetry.io/collector/pdata/pmetric" "go.opentelemetry.io/collector/pdata/ptrace" + "go.opentelemetry.io/collector/processor" + "go.opentelemetry.io/collector/processor/processortest" ) func TestComponentLifecycle(t *testing.T) { @@ -66,9 +64,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), processortest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/processor/cumulativetodeltaprocessor/generated_component_test.go b/processor/cumulativetodeltaprocessor/generated_component_test.go index 7233fd90cedf..b96b0fb5bc2c 100644 --- a/processor/cumulativetodeltaprocessor/generated_component_test.go +++ b/processor/cumulativetodeltaprocessor/generated_component_test.go @@ -10,16 +10,14 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - - "go.opentelemetry.io/collector/consumer/consumertest" - "go.opentelemetry.io/collector/processor" - "go.opentelemetry.io/collector/processor/processortest" - "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/plog" "go.opentelemetry.io/collector/pdata/pmetric" "go.opentelemetry.io/collector/pdata/ptrace" + "go.opentelemetry.io/collector/processor" + "go.opentelemetry.io/collector/processor/processortest" ) func TestComponentLifecycle(t *testing.T) { @@ -52,9 +50,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), processortest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/processor/deltatocumulativeprocessor/generated_component_test.go b/processor/deltatocumulativeprocessor/generated_component_test.go new file mode 100644 index 000000000000..a71882b6d0ca --- /dev/null +++ b/processor/deltatocumulativeprocessor/generated_component_test.go @@ -0,0 +1,121 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package deltatocumulativeprocessor + +import ( + "context" + "testing" + "time" + + "github.com/stretchr/testify/require" + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/component/componenttest" + "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/consumer/consumertest" + "go.opentelemetry.io/collector/pdata/pcommon" + "go.opentelemetry.io/collector/pdata/plog" + "go.opentelemetry.io/collector/pdata/pmetric" + "go.opentelemetry.io/collector/pdata/ptrace" + "go.opentelemetry.io/collector/processor" + "go.opentelemetry.io/collector/processor/processortest" +) + +func TestComponentLifecycle(t *testing.T) { + factory := NewFactory() + + tests := []struct { + name string + createFn func(ctx context.Context, set processor.CreateSettings, cfg component.Config) (component.Component, error) + }{ + + { + name: "metrics", + createFn: func(ctx context.Context, set processor.CreateSettings, cfg component.Config) (component.Component, error) { + return factory.CreateMetricsProcessor(ctx, set, cfg, consumertest.NewNop()) + }, + }, + } + + cm, err := confmaptest.LoadConf("metadata.yaml") + require.NoError(t, err) + cfg := factory.CreateDefaultConfig() + sub, err := cm.Sub("tests::config") + require.NoError(t, err) + require.NoError(t, component.UnmarshalConfig(sub, cfg)) + + for _, test := range tests { + t.Run(test.name+"-shutdown", func(t *testing.T) { + c, err := test.createFn(context.Background(), processortest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + err = c.Shutdown(context.Background()) + require.NoError(t, err) + }) + t.Run(test.name+"-lifecycle", func(t *testing.T) { + c, err := test.createFn(context.Background(), processortest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + host := componenttest.NewNopHost() + err = c.Start(context.Background(), host) + require.NoError(t, err) + require.NotPanics(t, func() { + switch e := c.(type) { + case processor.Logs: + logs := generateLifecycleTestLogs() + if !e.Capabilities().MutatesData { + logs.MarkReadOnly() + } + err = e.ConsumeLogs(context.Background(), logs) + case processor.Metrics: + metrics := generateLifecycleTestMetrics() + if !e.Capabilities().MutatesData { + metrics.MarkReadOnly() + } + err = e.ConsumeMetrics(context.Background(), metrics) + case processor.Traces: + traces := generateLifecycleTestTraces() + if !e.Capabilities().MutatesData { + traces.MarkReadOnly() + } + err = e.ConsumeTraces(context.Background(), traces) + } + }) + require.NoError(t, err) + err = c.Shutdown(context.Background()) + require.NoError(t, err) + }) + } +} + +func generateLifecycleTestLogs() plog.Logs { + logs := plog.NewLogs() + rl := logs.ResourceLogs().AppendEmpty() + rl.Resource().Attributes().PutStr("resource", "R1") + l := rl.ScopeLogs().AppendEmpty().LogRecords().AppendEmpty() + l.Body().SetStr("test log message") + l.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return logs +} + +func generateLifecycleTestMetrics() pmetric.Metrics { + metrics := pmetric.NewMetrics() + rm := metrics.ResourceMetrics().AppendEmpty() + rm.Resource().Attributes().PutStr("resource", "R1") + m := rm.ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() + m.SetName("test_metric") + dp := m.SetEmptyGauge().DataPoints().AppendEmpty() + dp.Attributes().PutStr("test_attr", "value_1") + dp.SetIntValue(123) + dp.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return metrics +} + +func generateLifecycleTestTraces() ptrace.Traces { + traces := ptrace.NewTraces() + rs := traces.ResourceSpans().AppendEmpty() + rs.Resource().Attributes().PutStr("resource", "R1") + span := rs.ScopeSpans().AppendEmpty().Spans().AppendEmpty() + span.Attributes().PutStr("test_attr", "value_1") + span.SetName("test_span") + span.SetStartTimestamp(pcommon.NewTimestampFromTime(time.Now().Add(-1 * time.Second))) + span.SetEndTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return traces +} diff --git a/processor/deltatocumulativeprocessor/go.mod b/processor/deltatocumulativeprocessor/go.mod index 3754118e713f..47927686a18f 100644 --- a/processor/deltatocumulativeprocessor/go.mod +++ b/processor/deltatocumulativeprocessor/go.mod @@ -6,6 +6,7 @@ require ( github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.95.0 github.com/stretchr/testify v1.8.4 go.opentelemetry.io/collector/component v0.95.0 + go.opentelemetry.io/collector/confmap v0.95.0 go.opentelemetry.io/collector/consumer v0.95.0 go.opentelemetry.io/collector/pdata v1.2.0 go.opentelemetry.io/collector/processor v0.95.0 @@ -15,8 +16,11 @@ require ( ) require ( + github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect + github.com/go-logr/logr v1.4.1 // indirect + github.com/go-logr/stdr v1.2.2 // indirect github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/protobuf v1.5.3 // indirect @@ -30,9 +34,16 @@ require ( github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/prometheus/client_golang v1.18.0 // indirect + github.com/prometheus/client_model v0.5.0 // indirect + github.com/prometheus/common v0.46.0 // indirect + github.com/prometheus/procfs v0.12.0 // indirect + go.opentelemetry.io/collector v0.95.0 // indirect go.opentelemetry.io/collector/config/configtelemetry v0.95.0 // indirect - go.opentelemetry.io/collector/confmap v0.95.0 // indirect go.opentelemetry.io/otel v1.23.1 // indirect + go.opentelemetry.io/otel/exporters/prometheus v0.45.2 // indirect + go.opentelemetry.io/otel/sdk v1.23.1 // indirect + go.opentelemetry.io/otel/sdk/metric v1.23.1 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.20.0 // indirect golang.org/x/sys v0.16.0 // indirect diff --git a/processor/deltatocumulativeprocessor/go.sum b/processor/deltatocumulativeprocessor/go.sum index 8057c23b7d76..8a803a1bf18b 100644 --- a/processor/deltatocumulativeprocessor/go.sum +++ b/processor/deltatocumulativeprocessor/go.sum @@ -5,6 +5,7 @@ github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XL github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= @@ -63,6 +64,8 @@ github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcU github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +go.opentelemetry.io/collector v0.95.0 h1:DFW0BkF2sOocpA3NUPrbMeuPSN3PWxFBrLqs/Cxn3vo= +go.opentelemetry.io/collector v0.95.0/go.mod h1:Lc+VkOkSBppKqR/cAevS5oPrbtUO3JUbYzo91niRkG0= go.opentelemetry.io/collector/component v0.95.0 h1:68tI7KVy1bfpaR83+LxUvjd9/hjDh78utklGl2t6eVM= go.opentelemetry.io/collector/component v0.95.0/go.mod h1:SMt7r9zm0OOEKJF/ZUy8agD92OAXq2Xhq1FaTcfIWHw= go.opentelemetry.io/collector/config/configtelemetry v0.95.0 h1:HabJZqbOAbNQ52L3v6usXoGXg1UKA1Ofs4Ytp5sGXEo= diff --git a/processor/deltatorateprocessor/generated_component_test.go b/processor/deltatorateprocessor/generated_component_test.go index 09366bcbaa5e..7ff3da5a92e9 100644 --- a/processor/deltatorateprocessor/generated_component_test.go +++ b/processor/deltatorateprocessor/generated_component_test.go @@ -10,16 +10,14 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - - "go.opentelemetry.io/collector/consumer/consumertest" - "go.opentelemetry.io/collector/processor" - "go.opentelemetry.io/collector/processor/processortest" - "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/plog" "go.opentelemetry.io/collector/pdata/pmetric" "go.opentelemetry.io/collector/pdata/ptrace" + "go.opentelemetry.io/collector/processor" + "go.opentelemetry.io/collector/processor/processortest" ) func TestComponentLifecycle(t *testing.T) { @@ -52,9 +50,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), processortest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/processor/filterprocessor/generated_component_test.go b/processor/filterprocessor/generated_component_test.go index 960bf5c4b395..3ac5aab6b0cb 100644 --- a/processor/filterprocessor/generated_component_test.go +++ b/processor/filterprocessor/generated_component_test.go @@ -10,16 +10,14 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - - "go.opentelemetry.io/collector/consumer/consumertest" - "go.opentelemetry.io/collector/processor" - "go.opentelemetry.io/collector/processor/processortest" - "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/plog" "go.opentelemetry.io/collector/pdata/pmetric" "go.opentelemetry.io/collector/pdata/ptrace" + "go.opentelemetry.io/collector/processor" + "go.opentelemetry.io/collector/processor/processortest" ) func TestComponentLifecycle(t *testing.T) { @@ -66,9 +64,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), processortest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/processor/groupbyattrsprocessor/generated_component_test.go b/processor/groupbyattrsprocessor/generated_component_test.go index d9dec213ca96..075254f73c76 100644 --- a/processor/groupbyattrsprocessor/generated_component_test.go +++ b/processor/groupbyattrsprocessor/generated_component_test.go @@ -10,16 +10,14 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - - "go.opentelemetry.io/collector/consumer/consumertest" - "go.opentelemetry.io/collector/processor" - "go.opentelemetry.io/collector/processor/processortest" - "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/plog" "go.opentelemetry.io/collector/pdata/pmetric" "go.opentelemetry.io/collector/pdata/ptrace" + "go.opentelemetry.io/collector/processor" + "go.opentelemetry.io/collector/processor/processortest" ) func TestComponentLifecycle(t *testing.T) { @@ -66,9 +64,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), processortest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/processor/groupbytraceprocessor/generated_component_test.go b/processor/groupbytraceprocessor/generated_component_test.go index 9b2901c5b309..a0503864b72d 100644 --- a/processor/groupbytraceprocessor/generated_component_test.go +++ b/processor/groupbytraceprocessor/generated_component_test.go @@ -10,16 +10,14 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - - "go.opentelemetry.io/collector/consumer/consumertest" - "go.opentelemetry.io/collector/processor" - "go.opentelemetry.io/collector/processor/processortest" - "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/plog" "go.opentelemetry.io/collector/pdata/pmetric" "go.opentelemetry.io/collector/pdata/ptrace" + "go.opentelemetry.io/collector/processor" + "go.opentelemetry.io/collector/processor/processortest" ) func TestComponentLifecycle(t *testing.T) { @@ -52,9 +50,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), processortest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/processor/intervalprocessor/generated_component_test.go b/processor/intervalprocessor/generated_component_test.go index ffd831d22242..1bef7864d369 100644 --- a/processor/intervalprocessor/generated_component_test.go +++ b/processor/intervalprocessor/generated_component_test.go @@ -10,16 +10,14 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - - "go.opentelemetry.io/collector/consumer/consumertest" - "go.opentelemetry.io/collector/processor" - "go.opentelemetry.io/collector/processor/processortest" - "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/plog" "go.opentelemetry.io/collector/pdata/pmetric" "go.opentelemetry.io/collector/pdata/ptrace" + "go.opentelemetry.io/collector/processor" + "go.opentelemetry.io/collector/processor/processortest" ) func TestComponentLifecycle(t *testing.T) { @@ -52,9 +50,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), processortest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/processor/k8sattributesprocessor/generated_component_test.go b/processor/k8sattributesprocessor/generated_component_test.go index 8011715af5ba..90bb8bf0b771 100644 --- a/processor/k8sattributesprocessor/generated_component_test.go +++ b/processor/k8sattributesprocessor/generated_component_test.go @@ -10,16 +10,14 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - - "go.opentelemetry.io/collector/consumer/consumertest" - "go.opentelemetry.io/collector/processor" - "go.opentelemetry.io/collector/processor/processortest" - "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/plog" "go.opentelemetry.io/collector/pdata/pmetric" "go.opentelemetry.io/collector/pdata/ptrace" + "go.opentelemetry.io/collector/processor" + "go.opentelemetry.io/collector/processor/processortest" ) func TestComponentLifecycle(t *testing.T) { @@ -66,9 +64,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), processortest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/processor/logstransformprocessor/generated_component_test.go b/processor/logstransformprocessor/generated_component_test.go index 768cbb57f26d..af4b38e3f40e 100644 --- a/processor/logstransformprocessor/generated_component_test.go +++ b/processor/logstransformprocessor/generated_component_test.go @@ -10,16 +10,14 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - - "go.opentelemetry.io/collector/consumer/consumertest" - "go.opentelemetry.io/collector/processor" - "go.opentelemetry.io/collector/processor/processortest" - "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/plog" "go.opentelemetry.io/collector/pdata/pmetric" "go.opentelemetry.io/collector/pdata/ptrace" + "go.opentelemetry.io/collector/processor" + "go.opentelemetry.io/collector/processor/processortest" ) func TestComponentLifecycle(t *testing.T) { @@ -52,9 +50,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), processortest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/processor/metricsgenerationprocessor/generated_component_test.go b/processor/metricsgenerationprocessor/generated_component_test.go index bd15cdea7021..bfea4e7ea1e5 100644 --- a/processor/metricsgenerationprocessor/generated_component_test.go +++ b/processor/metricsgenerationprocessor/generated_component_test.go @@ -10,16 +10,14 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - - "go.opentelemetry.io/collector/consumer/consumertest" - "go.opentelemetry.io/collector/processor" - "go.opentelemetry.io/collector/processor/processortest" - "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/plog" "go.opentelemetry.io/collector/pdata/pmetric" "go.opentelemetry.io/collector/pdata/ptrace" + "go.opentelemetry.io/collector/processor" + "go.opentelemetry.io/collector/processor/processortest" ) func TestComponentLifecycle(t *testing.T) { @@ -52,9 +50,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), processortest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/processor/metricstransformprocessor/generated_component_test.go b/processor/metricstransformprocessor/generated_component_test.go index bff2e68313a0..71fabc61ad2d 100644 --- a/processor/metricstransformprocessor/generated_component_test.go +++ b/processor/metricstransformprocessor/generated_component_test.go @@ -10,16 +10,14 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - - "go.opentelemetry.io/collector/consumer/consumertest" - "go.opentelemetry.io/collector/processor" - "go.opentelemetry.io/collector/processor/processortest" - "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/plog" "go.opentelemetry.io/collector/pdata/pmetric" "go.opentelemetry.io/collector/pdata/ptrace" + "go.opentelemetry.io/collector/processor" + "go.opentelemetry.io/collector/processor/processortest" ) func TestComponentLifecycle(t *testing.T) { @@ -52,9 +50,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), processortest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/processor/probabilisticsamplerprocessor/generated_component_test.go b/processor/probabilisticsamplerprocessor/generated_component_test.go index 61dcd49be054..fe172fcee1c5 100644 --- a/processor/probabilisticsamplerprocessor/generated_component_test.go +++ b/processor/probabilisticsamplerprocessor/generated_component_test.go @@ -10,16 +10,14 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - - "go.opentelemetry.io/collector/consumer/consumertest" - "go.opentelemetry.io/collector/processor" - "go.opentelemetry.io/collector/processor/processortest" - "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/plog" "go.opentelemetry.io/collector/pdata/pmetric" "go.opentelemetry.io/collector/pdata/ptrace" + "go.opentelemetry.io/collector/processor" + "go.opentelemetry.io/collector/processor/processortest" ) func TestComponentLifecycle(t *testing.T) { @@ -59,9 +57,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), processortest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/processor/redactionprocessor/generated_component_test.go b/processor/redactionprocessor/generated_component_test.go index 389dca2ce20f..11fd2369352c 100644 --- a/processor/redactionprocessor/generated_component_test.go +++ b/processor/redactionprocessor/generated_component_test.go @@ -10,16 +10,14 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - - "go.opentelemetry.io/collector/consumer/consumertest" - "go.opentelemetry.io/collector/processor" - "go.opentelemetry.io/collector/processor/processortest" - "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/plog" "go.opentelemetry.io/collector/pdata/pmetric" "go.opentelemetry.io/collector/pdata/ptrace" + "go.opentelemetry.io/collector/processor" + "go.opentelemetry.io/collector/processor/processortest" ) func TestComponentLifecycle(t *testing.T) { @@ -52,9 +50,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), processortest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/processor/remotetapprocessor/generated_component_test.go b/processor/remotetapprocessor/generated_component_test.go index 09f2bc21fcbf..bc3c329746b7 100644 --- a/processor/remotetapprocessor/generated_component_test.go +++ b/processor/remotetapprocessor/generated_component_test.go @@ -10,16 +10,14 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - - "go.opentelemetry.io/collector/consumer/consumertest" - "go.opentelemetry.io/collector/processor" - "go.opentelemetry.io/collector/processor/processortest" - "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/plog" "go.opentelemetry.io/collector/pdata/pmetric" "go.opentelemetry.io/collector/pdata/ptrace" + "go.opentelemetry.io/collector/processor" + "go.opentelemetry.io/collector/processor/processortest" ) func TestComponentLifecycle(t *testing.T) { @@ -66,9 +64,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), processortest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/processor/resourcedetectionprocessor/generated_component_test.go b/processor/resourcedetectionprocessor/generated_component_test.go index ac6b92d78524..197358575f43 100644 --- a/processor/resourcedetectionprocessor/generated_component_test.go +++ b/processor/resourcedetectionprocessor/generated_component_test.go @@ -10,16 +10,14 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - - "go.opentelemetry.io/collector/consumer/consumertest" - "go.opentelemetry.io/collector/processor" - "go.opentelemetry.io/collector/processor/processortest" - "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/plog" "go.opentelemetry.io/collector/pdata/pmetric" "go.opentelemetry.io/collector/pdata/ptrace" + "go.opentelemetry.io/collector/processor" + "go.opentelemetry.io/collector/processor/processortest" ) func TestComponentLifecycle(t *testing.T) { @@ -66,9 +64,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), processortest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/processor/resourcedetectionprocessor/internal/aws/ec2/metadata.yaml b/processor/resourcedetectionprocessor/internal/aws/ec2/metadata.yaml index ae31e6c3c3d6..d03e83b5a514 100644 --- a/processor/resourcedetectionprocessor/internal/aws/ec2/metadata.yaml +++ b/processor/resourcedetectionprocessor/internal/aws/ec2/metadata.yaml @@ -38,4 +38,8 @@ resource_attributes: host.type: description: The host id type: string - enabled: true \ No newline at end of file + enabled: true + +tests: + skip_lifecycle: true + skip_shutdown: true diff --git a/processor/resourcedetectionprocessor/internal/aws/ecs/metadata.yaml b/processor/resourcedetectionprocessor/internal/aws/ecs/metadata.yaml index 45f102dee7e0..69c73dc7d18f 100644 --- a/processor/resourcedetectionprocessor/internal/aws/ecs/metadata.yaml +++ b/processor/resourcedetectionprocessor/internal/aws/ecs/metadata.yaml @@ -62,4 +62,8 @@ resource_attributes: aws.log.stream.arns: description: The aws.log.stream.arns type: slice - enabled: true \ No newline at end of file + enabled: true + +tests: + skip_lifecycle: true + skip_shutdown: true diff --git a/processor/resourcedetectionprocessor/internal/aws/eks/metadata.yaml b/processor/resourcedetectionprocessor/internal/aws/eks/metadata.yaml index 9911e7164b53..168b658c9e5f 100644 --- a/processor/resourcedetectionprocessor/internal/aws/eks/metadata.yaml +++ b/processor/resourcedetectionprocessor/internal/aws/eks/metadata.yaml @@ -14,4 +14,8 @@ resource_attributes: k8s.cluster.name: description: The EKS cluster name. This attribute is currently only available when running on EC2 instances, and requires permission to run the EC2:DescribeInstances action. type: string - enabled: false \ No newline at end of file + enabled: false + +tests: + skip_lifecycle: true + skip_shutdown: true diff --git a/processor/resourcedetectionprocessor/internal/aws/elasticbeanstalk/metadata.yaml b/processor/resourcedetectionprocessor/internal/aws/elasticbeanstalk/metadata.yaml index 0414b1a65041..1c0b852403f7 100644 --- a/processor/resourcedetectionprocessor/internal/aws/elasticbeanstalk/metadata.yaml +++ b/processor/resourcedetectionprocessor/internal/aws/elasticbeanstalk/metadata.yaml @@ -22,4 +22,8 @@ resource_attributes: service.version: description: The service.version type: string - enabled: true \ No newline at end of file + enabled: true + +tests: + skip_lifecycle: true + skip_shutdown: true diff --git a/processor/resourcedetectionprocessor/internal/aws/lambda/metadata.yaml b/processor/resourcedetectionprocessor/internal/aws/lambda/metadata.yaml index b5d434962765..8e48faf6d3b5 100644 --- a/processor/resourcedetectionprocessor/internal/aws/lambda/metadata.yaml +++ b/processor/resourcedetectionprocessor/internal/aws/lambda/metadata.yaml @@ -38,4 +38,8 @@ resource_attributes: faas.max_memory: description: The faas.max_memory type: string - enabled: true \ No newline at end of file + enabled: true + +tests: + skip_lifecycle: true + skip_shutdown: true diff --git a/processor/resourcedetectionprocessor/internal/azure/internal/metadata/generated_status.go b/processor/resourcedetectionprocessor/internal/azure/internal/metadata/generated_status.go deleted file mode 100644 index 6a75a48cffd7..000000000000 --- a/processor/resourcedetectionprocessor/internal/azure/internal/metadata/generated_status.go +++ /dev/null @@ -1,19 +0,0 @@ -// Code generated by mdatagen. DO NOT EDIT. - -package metadata - -import ( - "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/otel/metric" - "go.opentelemetry.io/otel/trace" -) - -const () - -func Meter(settings component.TelemetrySettings) metric.Meter { - return settings.MeterProvider.Meter("otelcol/resourcedetection") -} - -func Tracer(settings component.TelemetrySettings) trace.Tracer { - return settings.TracerProvider.Tracer("otelcol/resourcedetection") -} diff --git a/processor/resourcedetectionprocessor/internal/azure/metadata.yaml b/processor/resourcedetectionprocessor/internal/azure/metadata.yaml index 3e896d9c3e44..fc72ff86e777 100644 --- a/processor/resourcedetectionprocessor/internal/azure/metadata.yaml +++ b/processor/resourcedetectionprocessor/internal/azure/metadata.yaml @@ -3,7 +3,7 @@ type: resourcedetectionprocessor/azure parent: resourcedetection status: - class: processor + class: pkg codeowners: active: [mx-psi] @@ -47,4 +47,4 @@ resource_attributes: azure.vm.size: description: The azure.vm.size enabled: true - type: string \ No newline at end of file + type: string diff --git a/processor/resourcedetectionprocessor/internal/docker/metadata.yaml b/processor/resourcedetectionprocessor/internal/docker/metadata.yaml index 7c8fd5a7f300..b9accae32395 100644 --- a/processor/resourcedetectionprocessor/internal/docker/metadata.yaml +++ b/processor/resourcedetectionprocessor/internal/docker/metadata.yaml @@ -10,4 +10,4 @@ resource_attributes: os.type: description: The os.type type: string - enabled: true \ No newline at end of file + enabled: true diff --git a/processor/resourcedetectionprocessor/internal/heroku/internal/metadata/generated_status.go b/processor/resourcedetectionprocessor/internal/heroku/internal/metadata/generated_status.go deleted file mode 100644 index 6a75a48cffd7..000000000000 --- a/processor/resourcedetectionprocessor/internal/heroku/internal/metadata/generated_status.go +++ /dev/null @@ -1,19 +0,0 @@ -// Code generated by mdatagen. DO NOT EDIT. - -package metadata - -import ( - "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/otel/metric" - "go.opentelemetry.io/otel/trace" -) - -const () - -func Meter(settings component.TelemetrySettings) metric.Meter { - return settings.MeterProvider.Meter("otelcol/resourcedetection") -} - -func Tracer(settings component.TelemetrySettings) trace.Tracer { - return settings.TracerProvider.Tracer("otelcol/resourcedetection") -} diff --git a/processor/resourcedetectionprocessor/internal/heroku/metadata.yaml b/processor/resourcedetectionprocessor/internal/heroku/metadata.yaml index 85f166703e9c..242686f1d8f5 100644 --- a/processor/resourcedetectionprocessor/internal/heroku/metadata.yaml +++ b/processor/resourcedetectionprocessor/internal/heroku/metadata.yaml @@ -3,7 +3,7 @@ type: resourcedetectionprocessor/heroku parent: resourcedetection status: - class: processor + class: pkg codeowners: active: [atoulme] diff --git a/processor/resourcedetectionprocessor/internal/k8snode/metadata.yaml b/processor/resourcedetectionprocessor/internal/k8snode/metadata.yaml index fdda964e952f..3aac54b505e4 100644 --- a/processor/resourcedetectionprocessor/internal/k8snode/metadata.yaml +++ b/processor/resourcedetectionprocessor/internal/k8snode/metadata.yaml @@ -10,4 +10,4 @@ resource_attributes: k8s.node.name: description: The Kubernetes node name type: string - enabled: true \ No newline at end of file + enabled: true diff --git a/processor/resourcedetectionprocessor/internal/openshift/internal/metadata/generated_status.go b/processor/resourcedetectionprocessor/internal/openshift/internal/metadata/generated_status.go deleted file mode 100644 index 6a75a48cffd7..000000000000 --- a/processor/resourcedetectionprocessor/internal/openshift/internal/metadata/generated_status.go +++ /dev/null @@ -1,19 +0,0 @@ -// Code generated by mdatagen. DO NOT EDIT. - -package metadata - -import ( - "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/otel/metric" - "go.opentelemetry.io/otel/trace" -) - -const () - -func Meter(settings component.TelemetrySettings) metric.Meter { - return settings.MeterProvider.Meter("otelcol/resourcedetection") -} - -func Tracer(settings component.TelemetrySettings) trace.Tracer { - return settings.TracerProvider.Tracer("otelcol/resourcedetection") -} diff --git a/processor/resourcedetectionprocessor/internal/openshift/metadata.yaml b/processor/resourcedetectionprocessor/internal/openshift/metadata.yaml index 499c2e571a76..bae3cf3b62cc 100644 --- a/processor/resourcedetectionprocessor/internal/openshift/metadata.yaml +++ b/processor/resourcedetectionprocessor/internal/openshift/metadata.yaml @@ -3,7 +3,7 @@ type: resourcedetectionprocessor/openshift parent: resourcedetection status: - class: processor + class: pkg codeowners: active: [frzifus] @@ -23,4 +23,4 @@ resource_attributes: k8s.cluster.name: description: The k8s.cluster.name type: string - enabled: true \ No newline at end of file + enabled: true diff --git a/processor/resourcedetectionprocessor/metadata.yaml b/processor/resourcedetectionprocessor/metadata.yaml index 3fa7ccdeaab8..1e7bc3ad54f1 100644 --- a/processor/resourcedetectionprocessor/metadata.yaml +++ b/processor/resourcedetectionprocessor/metadata.yaml @@ -7,6 +7,3 @@ status: distributions: [contrib, splunk, observiq, sumo, aws, redhat, liatrio, grafana] codeowners: active: [Aneurysm9, dashpole] - -tests: - config: diff --git a/processor/resourceprocessor/generated_component_test.go b/processor/resourceprocessor/generated_component_test.go index 905750429935..8f6f2aa60949 100644 --- a/processor/resourceprocessor/generated_component_test.go +++ b/processor/resourceprocessor/generated_component_test.go @@ -10,16 +10,14 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - - "go.opentelemetry.io/collector/consumer/consumertest" - "go.opentelemetry.io/collector/processor" - "go.opentelemetry.io/collector/processor/processortest" - "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/plog" "go.opentelemetry.io/collector/pdata/pmetric" "go.opentelemetry.io/collector/pdata/ptrace" + "go.opentelemetry.io/collector/processor" + "go.opentelemetry.io/collector/processor/processortest" ) func TestComponentLifecycle(t *testing.T) { @@ -66,9 +64,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), processortest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/processor/routingprocessor/generated_component_test.go b/processor/routingprocessor/generated_component_test.go index f2ea3385083d..88328c94844d 100644 --- a/processor/routingprocessor/generated_component_test.go +++ b/processor/routingprocessor/generated_component_test.go @@ -10,16 +10,14 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - - "go.opentelemetry.io/collector/consumer/consumertest" - "go.opentelemetry.io/collector/processor" - "go.opentelemetry.io/collector/processor/processortest" - "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/plog" "go.opentelemetry.io/collector/pdata/pmetric" "go.opentelemetry.io/collector/pdata/ptrace" + "go.opentelemetry.io/collector/processor" + "go.opentelemetry.io/collector/processor/processortest" ) func TestComponentLifecycle(t *testing.T) { @@ -66,9 +64,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), processortest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/processor/schemaprocessor/generated_component_test.go b/processor/schemaprocessor/generated_component_test.go index 8b3a8de7be23..fe8b6cbf66af 100644 --- a/processor/schemaprocessor/generated_component_test.go +++ b/processor/schemaprocessor/generated_component_test.go @@ -10,16 +10,14 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - - "go.opentelemetry.io/collector/consumer/consumertest" - "go.opentelemetry.io/collector/processor" - "go.opentelemetry.io/collector/processor/processortest" - "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/plog" "go.opentelemetry.io/collector/pdata/pmetric" "go.opentelemetry.io/collector/pdata/ptrace" + "go.opentelemetry.io/collector/processor" + "go.opentelemetry.io/collector/processor/processortest" ) func TestComponentLifecycle(t *testing.T) { @@ -66,9 +64,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), processortest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/processor/spanprocessor/generated_component_test.go b/processor/spanprocessor/generated_component_test.go index faa23ef56b82..9da09da9c53d 100644 --- a/processor/spanprocessor/generated_component_test.go +++ b/processor/spanprocessor/generated_component_test.go @@ -10,16 +10,14 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - - "go.opentelemetry.io/collector/consumer/consumertest" - "go.opentelemetry.io/collector/processor" - "go.opentelemetry.io/collector/processor/processortest" - "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/plog" "go.opentelemetry.io/collector/pdata/pmetric" "go.opentelemetry.io/collector/pdata/ptrace" + "go.opentelemetry.io/collector/processor" + "go.opentelemetry.io/collector/processor/processortest" ) func TestComponentLifecycle(t *testing.T) { @@ -52,9 +50,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), processortest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/processor/sumologicprocessor/generated_component_test.go b/processor/sumologicprocessor/generated_component_test.go index 16c506a94b37..b5c597d28d04 100644 --- a/processor/sumologicprocessor/generated_component_test.go +++ b/processor/sumologicprocessor/generated_component_test.go @@ -10,16 +10,14 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - - "go.opentelemetry.io/collector/consumer/consumertest" - "go.opentelemetry.io/collector/processor" - "go.opentelemetry.io/collector/processor/processortest" - "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/plog" "go.opentelemetry.io/collector/pdata/pmetric" "go.opentelemetry.io/collector/pdata/ptrace" + "go.opentelemetry.io/collector/processor" + "go.opentelemetry.io/collector/processor/processortest" ) func TestComponentLifecycle(t *testing.T) { @@ -66,9 +64,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), processortest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/processor/tailsamplingprocessor/generated_component_test.go b/processor/tailsamplingprocessor/generated_component_test.go index 958713a8d83a..6381259b3ffd 100644 --- a/processor/tailsamplingprocessor/generated_component_test.go +++ b/processor/tailsamplingprocessor/generated_component_test.go @@ -10,16 +10,14 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - - "go.opentelemetry.io/collector/consumer/consumertest" - "go.opentelemetry.io/collector/processor" - "go.opentelemetry.io/collector/processor/processortest" - "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/plog" "go.opentelemetry.io/collector/pdata/pmetric" "go.opentelemetry.io/collector/pdata/ptrace" + "go.opentelemetry.io/collector/processor" + "go.opentelemetry.io/collector/processor/processortest" ) func TestComponentLifecycle(t *testing.T) { @@ -52,9 +50,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), processortest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/processor/transformprocessor/generated_component_test.go b/processor/transformprocessor/generated_component_test.go index 7c2cc04dbf95..3a39289897ef 100644 --- a/processor/transformprocessor/generated_component_test.go +++ b/processor/transformprocessor/generated_component_test.go @@ -10,16 +10,14 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - - "go.opentelemetry.io/collector/consumer/consumertest" - "go.opentelemetry.io/collector/processor" - "go.opentelemetry.io/collector/processor/processortest" - "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/plog" "go.opentelemetry.io/collector/pdata/pmetric" "go.opentelemetry.io/collector/pdata/ptrace" + "go.opentelemetry.io/collector/processor" + "go.opentelemetry.io/collector/processor/processortest" ) func TestComponentLifecycle(t *testing.T) { @@ -66,9 +64,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), processortest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/activedirectorydsreceiver/metadata.yaml b/receiver/activedirectorydsreceiver/metadata.yaml index eda8ccd9e3e3..9459a4ee6fdd 100644 --- a/receiver/activedirectorydsreceiver/metadata.yaml +++ b/receiver/activedirectorydsreceiver/metadata.yaml @@ -210,3 +210,8 @@ metrics: aggregation_temporality: cumulative value_type: double enabled: true + +# TODO: Update the receiver to pass the tests +tests: + skip_lifecycle: true + skip_shutdown: true diff --git a/receiver/aerospikereceiver/generated_component_test.go b/receiver/aerospikereceiver/generated_component_test.go index ac2eae1e28b2..124e5f195923 100644 --- a/receiver/aerospikereceiver/generated_component_test.go +++ b/receiver/aerospikereceiver/generated_component_test.go @@ -9,12 +9,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) func TestComponentLifecycle(t *testing.T) { @@ -47,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/aerospikereceiver/metadata.yaml b/receiver/aerospikereceiver/metadata.yaml index 345be910b2a3..7249af1abfa6 100644 --- a/receiver/aerospikereceiver/metadata.yaml +++ b/receiver/aerospikereceiver/metadata.yaml @@ -249,6 +249,3 @@ metrics: input_type: string monotonic: true aggregation_temporality: cumulative - -tests: - config: diff --git a/receiver/apachereceiver/generated_component_test.go b/receiver/apachereceiver/generated_component_test.go index 9e0d621a41b4..6211b6eafbe7 100644 --- a/receiver/apachereceiver/generated_component_test.go +++ b/receiver/apachereceiver/generated_component_test.go @@ -9,12 +9,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) func TestComponentLifecycle(t *testing.T) { @@ -47,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/apachereceiver/metadata.yaml b/receiver/apachereceiver/metadata.yaml index 83d51a319898..a5bec812ed4a 100644 --- a/receiver/apachereceiver/metadata.yaml +++ b/receiver/apachereceiver/metadata.yaml @@ -173,6 +173,3 @@ metrics: monotonic: false aggregation_temporality: cumulative attributes: [scoreboard_state] - -tests: - config: diff --git a/receiver/apachesparkreceiver/generated_component_test.go b/receiver/apachesparkreceiver/generated_component_test.go index 2eee5991e35f..3fdd6702728a 100644 --- a/receiver/apachesparkreceiver/generated_component_test.go +++ b/receiver/apachesparkreceiver/generated_component_test.go @@ -9,12 +9,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) func TestComponentLifecycle(t *testing.T) { @@ -47,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/awscloudwatchmetricsreceiver/generated_component_test.go b/receiver/awscloudwatchmetricsreceiver/generated_component_test.go index 93e29e11b17b..1fd4d58323cb 100644 --- a/receiver/awscloudwatchmetricsreceiver/generated_component_test.go +++ b/receiver/awscloudwatchmetricsreceiver/generated_component_test.go @@ -9,12 +9,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) func TestComponentLifecycle(t *testing.T) { @@ -47,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/awscloudwatchreceiver/generated_component_test.go b/receiver/awscloudwatchreceiver/generated_component_test.go index aa8b32cbbbeb..271cdd14ee29 100644 --- a/receiver/awscloudwatchreceiver/generated_component_test.go +++ b/receiver/awscloudwatchreceiver/generated_component_test.go @@ -9,12 +9,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) func TestComponentLifecycle(t *testing.T) { @@ -47,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/awscontainerinsightreceiver/generated_component_test.go b/receiver/awscontainerinsightreceiver/generated_component_test.go index 7db77c90d017..143f89a86bdf 100644 --- a/receiver/awscontainerinsightreceiver/generated_component_test.go +++ b/receiver/awscontainerinsightreceiver/generated_component_test.go @@ -8,13 +8,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) func TestComponentLifecycle(t *testing.T) { @@ -47,22 +44,5 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - - t.Run(test.name+"-lifecycle", func(t *testing.T) { - - // TODO support lifecycle - t.SkipNow() - - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) - require.NoError(t, err) - host := componenttest.NewNopHost() - require.NoError(t, err) - require.NoError(t, firstRcvr.Start(context.Background(), host)) - require.NoError(t, firstRcvr.Shutdown(context.Background())) - secondRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) - require.NoError(t, err) - require.NoError(t, secondRcvr.Start(context.Background(), host)) - require.NoError(t, secondRcvr.Shutdown(context.Background())) - }) } } diff --git a/receiver/awscontainerinsightreceiver/metadata.yaml b/receiver/awscontainerinsightreceiver/metadata.yaml index ab16d85dbf6f..fb1e6797281b 100644 --- a/receiver/awscontainerinsightreceiver/metadata.yaml +++ b/receiver/awscontainerinsightreceiver/metadata.yaml @@ -9,6 +9,6 @@ status: codeowners: active: [Aneurysm9, pxaws] +# TODO: Update the receiver to pass the tests tests: - config: skip_lifecycle: true diff --git a/receiver/awsecscontainermetricsreceiver/metadata.yaml b/receiver/awsecscontainermetricsreceiver/metadata.yaml index d51d95cc9de9..bb64c684c61d 100644 --- a/receiver/awsecscontainermetricsreceiver/metadata.yaml +++ b/receiver/awsecscontainermetricsreceiver/metadata.yaml @@ -7,3 +7,8 @@ status: distributions: [contrib, aws, observiq, sumo] codeowners: active: [Aneurysm9] + +# TODO: Update the receiver to pass the tests +tests: + skip_lifecycle: true + skip_shutdown: true diff --git a/receiver/awsfirehosereceiver/generated_component_test.go b/receiver/awsfirehosereceiver/generated_component_test.go index b88bdb745a0d..433dd2fe85ca 100644 --- a/receiver/awsfirehosereceiver/generated_component_test.go +++ b/receiver/awsfirehosereceiver/generated_component_test.go @@ -9,12 +9,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) func TestComponentLifecycle(t *testing.T) { @@ -47,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/awsxrayreceiver/metadata.yaml b/receiver/awsxrayreceiver/metadata.yaml index a7b197099a08..fe3999c18a28 100644 --- a/receiver/awsxrayreceiver/metadata.yaml +++ b/receiver/awsxrayreceiver/metadata.yaml @@ -6,4 +6,9 @@ status: beta: [traces] distributions: [contrib, aws, observiq, sumo] codeowners: - active: [wangzlei, srprash] \ No newline at end of file + active: [wangzlei, srprash] + +# TODO: Update the receiver to make the tests pass +tests: + skip_lifecycle: true + skip_shutdown: true diff --git a/receiver/azureblobreceiver/generated_component_test.go b/receiver/azureblobreceiver/generated_component_test.go index 71cf8354bf84..f73afbe84fe4 100644 --- a/receiver/azureblobreceiver/generated_component_test.go +++ b/receiver/azureblobreceiver/generated_component_test.go @@ -8,13 +8,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) func TestComponentLifecycle(t *testing.T) { @@ -54,22 +51,5 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - - t.Run(test.name+"-lifecycle", func(t *testing.T) { - - // TODO support lifecycle - t.SkipNow() - - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) - require.NoError(t, err) - host := componenttest.NewNopHost() - require.NoError(t, err) - require.NoError(t, firstRcvr.Start(context.Background(), host)) - require.NoError(t, firstRcvr.Shutdown(context.Background())) - secondRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) - require.NoError(t, err) - require.NoError(t, secondRcvr.Start(context.Background(), host)) - require.NoError(t, secondRcvr.Shutdown(context.Background())) - }) } } diff --git a/receiver/azureblobreceiver/metadata.yaml b/receiver/azureblobreceiver/metadata.yaml index d9cbacf8e7d8..1543d785c020 100644 --- a/receiver/azureblobreceiver/metadata.yaml +++ b/receiver/azureblobreceiver/metadata.yaml @@ -8,6 +8,7 @@ status: codeowners: active: [eedorenko, mx-psi] +# TODO: Update the exporter to pass the tests tests: config: connection_string: DefaultEndpointsProtocol=https;AccountName=accountName;AccountKey=+idLkHYcL0MUWIKYHm2j4Q==;EndpointSuffix=core.windows.net diff --git a/receiver/azureeventhubreceiver/generated_component_test.go b/receiver/azureeventhubreceiver/generated_component_test.go index d98e6c81c588..668a50791266 100644 --- a/receiver/azureeventhubreceiver/generated_component_test.go +++ b/receiver/azureeventhubreceiver/generated_component_test.go @@ -8,13 +8,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) func TestComponentLifecycle(t *testing.T) { @@ -54,22 +51,5 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - - t.Run(test.name+"-lifecycle", func(t *testing.T) { - - // TODO support lifecycle - t.SkipNow() - - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) - require.NoError(t, err) - host := componenttest.NewNopHost() - require.NoError(t, err) - require.NoError(t, firstRcvr.Start(context.Background(), host)) - require.NoError(t, firstRcvr.Shutdown(context.Background())) - secondRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) - require.NoError(t, err) - require.NoError(t, secondRcvr.Start(context.Background(), host)) - require.NoError(t, secondRcvr.Shutdown(context.Background())) - }) } } diff --git a/receiver/azuremonitorreceiver/generated_component_test.go b/receiver/azuremonitorreceiver/generated_component_test.go index afc670d3d889..972607e3e4fb 100644 --- a/receiver/azuremonitorreceiver/generated_component_test.go +++ b/receiver/azuremonitorreceiver/generated_component_test.go @@ -9,12 +9,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) func TestComponentLifecycle(t *testing.T) { @@ -47,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/bigipreceiver/generated_component_test.go b/receiver/bigipreceiver/generated_component_test.go index e65b40c0af07..8dfc0bc1ea3b 100644 --- a/receiver/bigipreceiver/generated_component_test.go +++ b/receiver/bigipreceiver/generated_component_test.go @@ -9,12 +9,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) func TestComponentLifecycle(t *testing.T) { @@ -47,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/bigipreceiver/metadata.yaml b/receiver/bigipreceiver/metadata.yaml index f8abe255903f..9fc5c77984b5 100644 --- a/receiver/bigipreceiver/metadata.yaml +++ b/receiver/bigipreceiver/metadata.yaml @@ -287,6 +287,3 @@ metrics: value_type: int attributes: [enabled.status] enabled: true - -tests: - config: diff --git a/receiver/carbonreceiver/generated_component_test.go b/receiver/carbonreceiver/generated_component_test.go index f54dca99ee6d..00ba32db9799 100644 --- a/receiver/carbonreceiver/generated_component_test.go +++ b/receiver/carbonreceiver/generated_component_test.go @@ -8,13 +8,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) func TestComponentLifecycle(t *testing.T) { @@ -47,22 +44,5 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - - t.Run(test.name+"-lifecycle", func(t *testing.T) { - - // TODO support lifecycle - t.SkipNow() - - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) - require.NoError(t, err) - host := componenttest.NewNopHost() - require.NoError(t, err) - require.NoError(t, firstRcvr.Start(context.Background(), host)) - require.NoError(t, firstRcvr.Shutdown(context.Background())) - secondRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) - require.NoError(t, err) - require.NoError(t, secondRcvr.Start(context.Background(), host)) - require.NoError(t, secondRcvr.Shutdown(context.Background())) - }) } } diff --git a/receiver/carbonreceiver/metadata.yaml b/receiver/carbonreceiver/metadata.yaml index 194e14c46e45..e105b8390a46 100644 --- a/receiver/carbonreceiver/metadata.yaml +++ b/receiver/carbonreceiver/metadata.yaml @@ -8,6 +8,6 @@ status: codeowners: active: [aboguszewski-sumo] +# TODO: Update the exporter to pass the tests tests: - config: skip_lifecycle: true diff --git a/receiver/chronyreceiver/generated_component_test.go b/receiver/chronyreceiver/generated_component_test.go index 1cd0464e74db..d788aa646f15 100644 --- a/receiver/chronyreceiver/generated_component_test.go +++ b/receiver/chronyreceiver/generated_component_test.go @@ -8,13 +8,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) func TestComponentLifecycle(t *testing.T) { @@ -47,22 +44,5 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - - t.Run(test.name+"-lifecycle", func(t *testing.T) { - - // TODO support lifecycle - t.SkipNow() - - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) - require.NoError(t, err) - host := componenttest.NewNopHost() - require.NoError(t, err) - require.NoError(t, firstRcvr.Start(context.Background(), host)) - require.NoError(t, firstRcvr.Shutdown(context.Background())) - secondRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) - require.NoError(t, err) - require.NoError(t, secondRcvr.Start(context.Background(), host)) - require.NoError(t, secondRcvr.Shutdown(context.Background())) - }) } } diff --git a/receiver/chronyreceiver/metadata.yaml b/receiver/chronyreceiver/metadata.yaml index 6821151645e1..346f16a00bf0 100644 --- a/receiver/chronyreceiver/metadata.yaml +++ b/receiver/chronyreceiver/metadata.yaml @@ -75,6 +75,6 @@ metrics: attributes: - leap.status +# TODO: Update the exporter to pass the tests tests: - config: skip_lifecycle: true diff --git a/receiver/cloudflarereceiver/generated_component_test.go b/receiver/cloudflarereceiver/generated_component_test.go index cfe8e10d10d5..2a5f91af7e68 100644 --- a/receiver/cloudflarereceiver/generated_component_test.go +++ b/receiver/cloudflarereceiver/generated_component_test.go @@ -9,12 +9,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) func TestComponentLifecycle(t *testing.T) { @@ -47,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/cloudflarereceiver/metadata.yaml b/receiver/cloudflarereceiver/metadata.yaml index 938b098bd1f6..5e08524ff758 100644 --- a/receiver/cloudflarereceiver/metadata.yaml +++ b/receiver/cloudflarereceiver/metadata.yaml @@ -8,6 +8,3 @@ status: codeowners: active: [dehaansa, djaglowski] seeking_new: true - -tests: - config: diff --git a/receiver/cloudfoundryreceiver/generated_component_test.go b/receiver/cloudfoundryreceiver/generated_component_test.go index 4472167db899..7a3551cef00c 100644 --- a/receiver/cloudfoundryreceiver/generated_component_test.go +++ b/receiver/cloudfoundryreceiver/generated_component_test.go @@ -8,13 +8,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) func TestComponentLifecycle(t *testing.T) { @@ -47,22 +44,5 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - - t.Run(test.name+"-lifecycle", func(t *testing.T) { - - // TODO support lifecycle - t.SkipNow() - - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) - require.NoError(t, err) - host := componenttest.NewNopHost() - require.NoError(t, err) - require.NoError(t, firstRcvr.Start(context.Background(), host)) - require.NoError(t, firstRcvr.Shutdown(context.Background())) - secondRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) - require.NoError(t, err) - require.NoError(t, secondRcvr.Start(context.Background(), host)) - require.NoError(t, secondRcvr.Shutdown(context.Background())) - }) } } diff --git a/receiver/collectdreceiver/generated_component_test.go b/receiver/collectdreceiver/generated_component_test.go index 149140a3dee4..0be55502cca6 100644 --- a/receiver/collectdreceiver/generated_component_test.go +++ b/receiver/collectdreceiver/generated_component_test.go @@ -9,12 +9,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) func TestComponentLifecycle(t *testing.T) { @@ -47,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/collectdreceiver/metadata.yaml b/receiver/collectdreceiver/metadata.yaml index 3796acd9422a..04e7fb48825c 100644 --- a/receiver/collectdreceiver/metadata.yaml +++ b/receiver/collectdreceiver/metadata.yaml @@ -7,6 +7,3 @@ status: distributions: [contrib, splunk, observiq, sumo] codeowners: active: [atoulme] - -tests: - config: diff --git a/receiver/couchdbreceiver/generated_component_test.go b/receiver/couchdbreceiver/generated_component_test.go index 21ee0c0e8454..49e5b404c019 100644 --- a/receiver/couchdbreceiver/generated_component_test.go +++ b/receiver/couchdbreceiver/generated_component_test.go @@ -9,12 +9,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) func TestComponentLifecycle(t *testing.T) { @@ -47,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/couchdbreceiver/metadata.yaml b/receiver/couchdbreceiver/metadata.yaml index feeb677eb065..4e37f82371b9 100644 --- a/receiver/couchdbreceiver/metadata.yaml +++ b/receiver/couchdbreceiver/metadata.yaml @@ -99,5 +99,3 @@ metrics: monotonic: true aggregation_temporality: cumulative attributes: [ operation ] -tests: - config: \ No newline at end of file diff --git a/receiver/datadogreceiver/generated_component_test.go b/receiver/datadogreceiver/generated_component_test.go index 83f32eb9aba6..02675f4dd58e 100644 --- a/receiver/datadogreceiver/generated_component_test.go +++ b/receiver/datadogreceiver/generated_component_test.go @@ -9,12 +9,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) func TestComponentLifecycle(t *testing.T) { @@ -47,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/datadogreceiver/metadata.yaml b/receiver/datadogreceiver/metadata.yaml index 8df4d0c13877..f20a1db74158 100644 --- a/receiver/datadogreceiver/metadata.yaml +++ b/receiver/datadogreceiver/metadata.yaml @@ -7,6 +7,3 @@ status: distributions: [contrib, sumo] codeowners: active: [boostchicken, gouthamve, jpkrohling, MovieStoreGuy] - -tests: - config: diff --git a/receiver/dockerstatsreceiver/generated_component_test.go b/receiver/dockerstatsreceiver/generated_component_test.go index fcbe9a4031e4..535e9ed45fc2 100644 --- a/receiver/dockerstatsreceiver/generated_component_test.go +++ b/receiver/dockerstatsreceiver/generated_component_test.go @@ -1,5 +1,4 @@ // Code generated by mdatagen. DO NOT EDIT. - //go:build !darwin && !windows package dockerstatsreceiver @@ -11,12 +10,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) func TestComponentLifecycle(t *testing.T) { @@ -49,9 +46,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/dockerstatsreceiver/metadata.yaml b/receiver/dockerstatsreceiver/metadata.yaml index 76f94cd6d6a4..3c54921e49d7 100644 --- a/receiver/dockerstatsreceiver/metadata.yaml +++ b/receiver/dockerstatsreceiver/metadata.yaml @@ -695,6 +695,3 @@ metrics: value_type: int monotonic: true aggregation_temporality: cumulative - -tests: - config: diff --git a/receiver/elasticsearchreceiver/generated_component_test.go b/receiver/elasticsearchreceiver/generated_component_test.go index 3e314e207156..8cbe5223840e 100644 --- a/receiver/elasticsearchreceiver/generated_component_test.go +++ b/receiver/elasticsearchreceiver/generated_component_test.go @@ -9,12 +9,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) func TestComponentLifecycle(t *testing.T) { @@ -47,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/expvarreceiver/generated_component_test.go b/receiver/expvarreceiver/generated_component_test.go index 572de21dfa2d..2920748654fe 100644 --- a/receiver/expvarreceiver/generated_component_test.go +++ b/receiver/expvarreceiver/generated_component_test.go @@ -9,12 +9,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) func TestComponentLifecycle(t *testing.T) { @@ -47,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/expvarreceiver/metadata.yaml b/receiver/expvarreceiver/metadata.yaml index d45631c63959..7fad22e4fcd6 100644 --- a/receiver/expvarreceiver/metadata.yaml +++ b/receiver/expvarreceiver/metadata.yaml @@ -264,5 +264,3 @@ metrics: unit: 1 gauge: value_type: double -tests: - config: \ No newline at end of file diff --git a/receiver/filelogreceiver/generated_component_test.go b/receiver/filelogreceiver/generated_component_test.go index 945b33d3d6ad..4e27aa020248 100644 --- a/receiver/filelogreceiver/generated_component_test.go +++ b/receiver/filelogreceiver/generated_component_test.go @@ -9,12 +9,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) func TestComponentLifecycle(t *testing.T) { @@ -47,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/filestatsreceiver/generated_component_test.go b/receiver/filestatsreceiver/generated_component_test.go index f8cc7826512a..d3311760e131 100644 --- a/receiver/filestatsreceiver/generated_component_test.go +++ b/receiver/filestatsreceiver/generated_component_test.go @@ -9,12 +9,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) func TestComponentLifecycle(t *testing.T) { @@ -47,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/filestatsreceiver/metadata.yaml b/receiver/filestatsreceiver/metadata.yaml index eb24d6acae28..cea57fb58023 100644 --- a/receiver/filestatsreceiver/metadata.yaml +++ b/receiver/filestatsreceiver/metadata.yaml @@ -63,5 +63,3 @@ metrics: gauge: value_type: int unit: "{file}" -tests: - config: \ No newline at end of file diff --git a/receiver/flinkmetricsreceiver/generated_component_test.go b/receiver/flinkmetricsreceiver/generated_component_test.go index 43d5a9c35f1c..5880edfdfbad 100644 --- a/receiver/flinkmetricsreceiver/generated_component_test.go +++ b/receiver/flinkmetricsreceiver/generated_component_test.go @@ -9,12 +9,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) func TestComponentLifecycle(t *testing.T) { @@ -47,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/fluentforwardreceiver/generated_component_test.go b/receiver/fluentforwardreceiver/generated_component_test.go index 70be1870683d..5542a309e13b 100644 --- a/receiver/fluentforwardreceiver/generated_component_test.go +++ b/receiver/fluentforwardreceiver/generated_component_test.go @@ -9,12 +9,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) func TestComponentLifecycle(t *testing.T) { @@ -47,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/gitproviderreceiver/generated_component_test.go b/receiver/gitproviderreceiver/generated_component_test.go index 4e7ac30042c3..2dd6541ea179 100644 --- a/receiver/gitproviderreceiver/generated_component_test.go +++ b/receiver/gitproviderreceiver/generated_component_test.go @@ -9,12 +9,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) func TestComponentLifecycle(t *testing.T) { @@ -47,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/googlecloudpubsubreceiver/metadata.yaml b/receiver/googlecloudpubsubreceiver/metadata.yaml index ca8b4d5a503d..fbdeaa8b45b5 100644 --- a/receiver/googlecloudpubsubreceiver/metadata.yaml +++ b/receiver/googlecloudpubsubreceiver/metadata.yaml @@ -15,3 +15,5 @@ tests: timeout: 20s subscription: projects/my-project/subscriptions/otlp-subscription skip_lifecycle: true + skip_shutdown: true + diff --git a/receiver/googlecloudspannerreceiver/generated_component_test.go b/receiver/googlecloudspannerreceiver/generated_component_test.go index 6b065ef66ac6..ef66a685415f 100644 --- a/receiver/googlecloudspannerreceiver/generated_component_test.go +++ b/receiver/googlecloudspannerreceiver/generated_component_test.go @@ -9,12 +9,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) func TestComponentLifecycle(t *testing.T) { @@ -47,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/haproxyreceiver/generated_component_test.go b/receiver/haproxyreceiver/generated_component_test.go index 2369d9f0830b..69af3a3369cc 100644 --- a/receiver/haproxyreceiver/generated_component_test.go +++ b/receiver/haproxyreceiver/generated_component_test.go @@ -9,12 +9,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) func TestComponentLifecycle(t *testing.T) { @@ -47,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/haproxyreceiver/metadata.yaml b/receiver/haproxyreceiver/metadata.yaml index c949ccb0938b..260f045184f4 100644 --- a/receiver/haproxyreceiver/metadata.yaml +++ b/receiver/haproxyreceiver/metadata.yaml @@ -261,6 +261,3 @@ metrics: value_type: double input_type: string unit: "{sessions}" - -tests: - config: \ No newline at end of file diff --git a/receiver/hostmetricsreceiver/generated_component_test.go b/receiver/hostmetricsreceiver/generated_component_test.go index 4ea9f763e9c3..b0cc2ac45a86 100644 --- a/receiver/hostmetricsreceiver/generated_component_test.go +++ b/receiver/hostmetricsreceiver/generated_component_test.go @@ -9,12 +9,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) func TestComponentLifecycle(t *testing.T) { @@ -47,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/httpcheckreceiver/generated_component_test.go b/receiver/httpcheckreceiver/generated_component_test.go index 0a0174d1bd15..6414eaa6707d 100644 --- a/receiver/httpcheckreceiver/generated_component_test.go +++ b/receiver/httpcheckreceiver/generated_component_test.go @@ -9,12 +9,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) func TestComponentLifecycle(t *testing.T) { @@ -47,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/httpcheckreceiver/metadata.yaml b/receiver/httpcheckreceiver/metadata.yaml index 583e1d833e52..d828bc5ce7f7 100644 --- a/receiver/httpcheckreceiver/metadata.yaml +++ b/receiver/httpcheckreceiver/metadata.yaml @@ -54,6 +54,3 @@ metrics: monotonic: false unit: "{error}" attributes: [http.url, error.message] - -tests: - config: diff --git a/receiver/iisreceiver/generated_component_test.go b/receiver/iisreceiver/generated_component_test.go index ddbc2ebacb5b..4fb4c0108a06 100644 --- a/receiver/iisreceiver/generated_component_test.go +++ b/receiver/iisreceiver/generated_component_test.go @@ -1,5 +1,4 @@ // Code generated by mdatagen. DO NOT EDIT. - //go:build !linux && !darwin package iisreceiver @@ -11,12 +10,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) func TestComponentLifecycle(t *testing.T) { @@ -49,9 +46,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/iisreceiver/metadata.yaml b/receiver/iisreceiver/metadata.yaml index 1c9087cb124a..452d28bebae6 100644 --- a/receiver/iisreceiver/metadata.yaml +++ b/receiver/iisreceiver/metadata.yaml @@ -135,6 +135,3 @@ metrics: gauge: value_type: int enabled: true - -tests: - config: diff --git a/receiver/influxdbreceiver/generated_component_test.go b/receiver/influxdbreceiver/generated_component_test.go index a067aa14f339..9eb82c0c8937 100644 --- a/receiver/influxdbreceiver/generated_component_test.go +++ b/receiver/influxdbreceiver/generated_component_test.go @@ -9,12 +9,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) func TestComponentLifecycle(t *testing.T) { @@ -47,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/influxdbreceiver/metadata.yaml b/receiver/influxdbreceiver/metadata.yaml index 1004879a5549..1778488433ff 100644 --- a/receiver/influxdbreceiver/metadata.yaml +++ b/receiver/influxdbreceiver/metadata.yaml @@ -7,5 +7,3 @@ status: distributions: [contrib, observiq, sumo] codeowners: active: [jacobmarble] -tests: - config: diff --git a/receiver/jaegerreceiver/generated_component_test.go b/receiver/jaegerreceiver/generated_component_test.go index e16979da17ca..b062bbc3b321 100644 --- a/receiver/jaegerreceiver/generated_component_test.go +++ b/receiver/jaegerreceiver/generated_component_test.go @@ -9,12 +9,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) func TestComponentLifecycle(t *testing.T) { @@ -47,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/jmxreceiver/generated_component_test.go b/receiver/jmxreceiver/generated_component_test.go index bccaa866f71c..8883d147b45a 100644 --- a/receiver/jmxreceiver/generated_component_test.go +++ b/receiver/jmxreceiver/generated_component_test.go @@ -9,12 +9,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) func TestComponentLifecycle(t *testing.T) { @@ -47,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/journaldreceiver/metadata.yaml b/receiver/journaldreceiver/metadata.yaml index 87907040efa7..32c047296f0a 100644 --- a/receiver/journaldreceiver/metadata.yaml +++ b/receiver/journaldreceiver/metadata.yaml @@ -7,3 +7,8 @@ status: distributions: [contrib, splunk, observiq, sumo] codeowners: active: [sumo-drosiek, djaglowski] + +# TODO: Update the receiver to pass the tests +tests: + skip_lifecycle: true + skip_shutdown: true diff --git a/receiver/k8sclusterreceiver/generated_component_test.go b/receiver/k8sclusterreceiver/generated_component_test.go index 6ec093b3f954..da5dad3d67d3 100644 --- a/receiver/k8sclusterreceiver/generated_component_test.go +++ b/receiver/k8sclusterreceiver/generated_component_test.go @@ -8,13 +8,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) func TestComponentLifecycle(t *testing.T) { @@ -54,22 +51,5 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - - t.Run(test.name+"-lifecycle", func(t *testing.T) { - - // TODO support lifecycle - t.SkipNow() - - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) - require.NoError(t, err) - host := componenttest.NewNopHost() - require.NoError(t, err) - require.NoError(t, firstRcvr.Start(context.Background(), host)) - require.NoError(t, firstRcvr.Shutdown(context.Background())) - secondRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) - require.NoError(t, err) - require.NoError(t, secondRcvr.Start(context.Background(), host)) - require.NoError(t, secondRcvr.Shutdown(context.Background())) - }) } } diff --git a/receiver/k8seventsreceiver/generated_component_test.go b/receiver/k8seventsreceiver/generated_component_test.go index c03e8ecbf7c0..af79071367a4 100644 --- a/receiver/k8seventsreceiver/generated_component_test.go +++ b/receiver/k8seventsreceiver/generated_component_test.go @@ -8,13 +8,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) func TestComponentLifecycle(t *testing.T) { @@ -47,22 +44,5 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - - t.Run(test.name+"-lifecycle", func(t *testing.T) { - - // TODO support lifecycle - t.SkipNow() - - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) - require.NoError(t, err) - host := componenttest.NewNopHost() - require.NoError(t, err) - require.NoError(t, firstRcvr.Start(context.Background(), host)) - require.NoError(t, firstRcvr.Shutdown(context.Background())) - secondRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) - require.NoError(t, err) - require.NoError(t, secondRcvr.Start(context.Background(), host)) - require.NoError(t, secondRcvr.Shutdown(context.Background())) - }) } } diff --git a/receiver/k8seventsreceiver/metadata.yaml b/receiver/k8seventsreceiver/metadata.yaml index febae1aca702..241b92d25089 100644 --- a/receiver/k8seventsreceiver/metadata.yaml +++ b/receiver/k8seventsreceiver/metadata.yaml @@ -8,6 +8,6 @@ status: codeowners: active: [dmitryax, TylerHelmuth] +# TODO: Update the receiver to pass the tests tests: - config: skip_lifecycle: true diff --git a/receiver/k8sobjectsreceiver/generated_component_test.go b/receiver/k8sobjectsreceiver/generated_component_test.go index 6b59098e2d30..e55bd7d112cd 100644 --- a/receiver/k8sobjectsreceiver/generated_component_test.go +++ b/receiver/k8sobjectsreceiver/generated_component_test.go @@ -8,13 +8,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) func TestComponentLifecycle(t *testing.T) { @@ -47,22 +44,5 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - - t.Run(test.name+"-lifecycle", func(t *testing.T) { - - // TODO support lifecycle - t.SkipNow() - - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) - require.NoError(t, err) - host := componenttest.NewNopHost() - require.NoError(t, err) - require.NoError(t, firstRcvr.Start(context.Background(), host)) - require.NoError(t, firstRcvr.Shutdown(context.Background())) - secondRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) - require.NoError(t, err) - require.NoError(t, secondRcvr.Start(context.Background(), host)) - require.NoError(t, secondRcvr.Shutdown(context.Background())) - }) } } diff --git a/receiver/kafkametricsreceiver/generated_component_test.go b/receiver/kafkametricsreceiver/generated_component_test.go index bb29d335ca53..c1f0ddd8ccbb 100644 --- a/receiver/kafkametricsreceiver/generated_component_test.go +++ b/receiver/kafkametricsreceiver/generated_component_test.go @@ -9,12 +9,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) func TestComponentLifecycle(t *testing.T) { @@ -47,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/kafkareceiver/generated_component_test.go b/receiver/kafkareceiver/generated_component_test.go index 8a0e51e2bce3..5535405eb885 100644 --- a/receiver/kafkareceiver/generated_component_test.go +++ b/receiver/kafkareceiver/generated_component_test.go @@ -8,13 +8,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) func TestComponentLifecycle(t *testing.T) { @@ -61,22 +58,5 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - - t.Run(test.name+"-lifecycle", func(t *testing.T) { - - // TODO support lifecycle - t.SkipNow() - - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) - require.NoError(t, err) - host := componenttest.NewNopHost() - require.NoError(t, err) - require.NoError(t, firstRcvr.Start(context.Background(), host)) - require.NoError(t, firstRcvr.Shutdown(context.Background())) - secondRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) - require.NoError(t, err) - require.NoError(t, secondRcvr.Start(context.Background(), host)) - require.NoError(t, secondRcvr.Shutdown(context.Background())) - }) } } diff --git a/receiver/kafkareceiver/metadata.yaml b/receiver/kafkareceiver/metadata.yaml index 9c63977b4a8b..d0538c21cd75 100644 --- a/receiver/kafkareceiver/metadata.yaml +++ b/receiver/kafkareceiver/metadata.yaml @@ -15,6 +15,6 @@ status: codeowners: active: [pavolloffay, MovieStoreGuy] +# TODO: Update the receiver to pass the tests tests: - config: skip_lifecycle: true diff --git a/receiver/kubeletstatsreceiver/generated_component_test.go b/receiver/kubeletstatsreceiver/generated_component_test.go index c0feff109963..f14afe4bf861 100644 --- a/receiver/kubeletstatsreceiver/generated_component_test.go +++ b/receiver/kubeletstatsreceiver/generated_component_test.go @@ -9,12 +9,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) func TestComponentLifecycle(t *testing.T) { @@ -47,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/lokireceiver/generated_component_test.go b/receiver/lokireceiver/generated_component_test.go index 46ac52437c34..6479b4b06180 100644 --- a/receiver/lokireceiver/generated_component_test.go +++ b/receiver/lokireceiver/generated_component_test.go @@ -9,12 +9,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) func TestComponentLifecycle(t *testing.T) { @@ -47,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/lokireceiver/metadata.yaml b/receiver/lokireceiver/metadata.yaml index a3a0572731b5..edad5b935124 100644 --- a/receiver/lokireceiver/metadata.yaml +++ b/receiver/lokireceiver/metadata.yaml @@ -9,6 +9,3 @@ status: - sumo codeowners: active: [mar4uk, jpkrohling] - -tests: - config: diff --git a/receiver/memcachedreceiver/generated_component_test.go b/receiver/memcachedreceiver/generated_component_test.go index 8efd7c912516..88130d45a777 100644 --- a/receiver/memcachedreceiver/generated_component_test.go +++ b/receiver/memcachedreceiver/generated_component_test.go @@ -9,12 +9,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) func TestComponentLifecycle(t *testing.T) { @@ -47,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/memcachedreceiver/metadata.yaml b/receiver/memcachedreceiver/metadata.yaml index 4f893eb2cda9..fb18d7d8b9be 100644 --- a/receiver/memcachedreceiver/metadata.yaml +++ b/receiver/memcachedreceiver/metadata.yaml @@ -140,6 +140,3 @@ metrics: monotonic: false aggregation_temporality: cumulative attributes: [] - -tests: - config: diff --git a/receiver/mongodbatlasreceiver/generated_component_test.go b/receiver/mongodbatlasreceiver/generated_component_test.go index 49a690c52c97..d50d36c9b4a0 100644 --- a/receiver/mongodbatlasreceiver/generated_component_test.go +++ b/receiver/mongodbatlasreceiver/generated_component_test.go @@ -9,12 +9,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) func TestComponentLifecycle(t *testing.T) { @@ -54,9 +52,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/mongodbreceiver/generated_component_test.go b/receiver/mongodbreceiver/generated_component_test.go index 19e539fc8150..c1c01c227dfd 100644 --- a/receiver/mongodbreceiver/generated_component_test.go +++ b/receiver/mongodbreceiver/generated_component_test.go @@ -8,13 +8,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) func TestComponentLifecycle(t *testing.T) { @@ -47,22 +44,5 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - - t.Run(test.name+"-lifecycle", func(t *testing.T) { - - // TODO support lifecycle - t.SkipNow() - - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) - require.NoError(t, err) - host := componenttest.NewNopHost() - require.NoError(t, err) - require.NoError(t, firstRcvr.Start(context.Background(), host)) - require.NoError(t, firstRcvr.Shutdown(context.Background())) - secondRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) - require.NoError(t, err) - require.NoError(t, secondRcvr.Start(context.Background(), host)) - require.NoError(t, secondRcvr.Shutdown(context.Background())) - }) } } diff --git a/receiver/mongodbreceiver/metadata.yaml b/receiver/mongodbreceiver/metadata.yaml index 12c1e64c8573..76dd526542c5 100644 --- a/receiver/mongodbreceiver/metadata.yaml +++ b/receiver/mongodbreceiver/metadata.yaml @@ -351,6 +351,6 @@ metrics: aggregation_temporality: cumulative attributes: [ ] +# TODO: Update the receiver to pass the tests tests: - config: skip_lifecycle: true diff --git a/receiver/mysqlreceiver/generated_component_test.go b/receiver/mysqlreceiver/generated_component_test.go index ffa9b700cd25..b257f39c8402 100644 --- a/receiver/mysqlreceiver/generated_component_test.go +++ b/receiver/mysqlreceiver/generated_component_test.go @@ -9,12 +9,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) func TestComponentLifecycle(t *testing.T) { @@ -47,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/mysqlreceiver/metadata.yaml b/receiver/mysqlreceiver/metadata.yaml index 34349e7f69ac..a82e65fa7bfc 100644 --- a/receiver/mysqlreceiver/metadata.yaml +++ b/receiver/mysqlreceiver/metadata.yaml @@ -579,6 +579,3 @@ metrics: input_type: string monotonic: true aggregation_temporality: cumulative - -tests: - config: \ No newline at end of file diff --git a/receiver/namedpipereceiver/generated_component_test.go b/receiver/namedpipereceiver/generated_component_test.go index 41c3e6044143..15b61aa479e2 100644 --- a/receiver/namedpipereceiver/generated_component_test.go +++ b/receiver/namedpipereceiver/generated_component_test.go @@ -1,5 +1,4 @@ // Code generated by mdatagen. DO NOT EDIT. - //go:build !windows && !darwin package namedpipereceiver @@ -11,12 +10,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) func TestComponentLifecycle(t *testing.T) { @@ -49,9 +46,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/nginxreceiver/generated_component_test.go b/receiver/nginxreceiver/generated_component_test.go index 4bc551b96475..b26ff510de4e 100644 --- a/receiver/nginxreceiver/generated_component_test.go +++ b/receiver/nginxreceiver/generated_component_test.go @@ -9,12 +9,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) func TestComponentLifecycle(t *testing.T) { @@ -47,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/nginxreceiver/metadata.yaml b/receiver/nginxreceiver/metadata.yaml index 4303ff3b32a1..c5cd9aa4987f 100644 --- a/receiver/nginxreceiver/metadata.yaml +++ b/receiver/nginxreceiver/metadata.yaml @@ -55,6 +55,3 @@ metrics: monotonic: false aggregation_temporality: cumulative attributes: [state] - -tests: - config: diff --git a/receiver/nsxtreceiver/generated_component_test.go b/receiver/nsxtreceiver/generated_component_test.go index cdb0b539e009..1feff04ed41c 100644 --- a/receiver/nsxtreceiver/generated_component_test.go +++ b/receiver/nsxtreceiver/generated_component_test.go @@ -9,12 +9,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) func TestComponentLifecycle(t *testing.T) { @@ -47,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/nsxtreceiver/metadata.yaml b/receiver/nsxtreceiver/metadata.yaml index 6a6d357c289d..08ba878f6dff 100644 --- a/receiver/nsxtreceiver/metadata.yaml +++ b/receiver/nsxtreceiver/metadata.yaml @@ -112,5 +112,3 @@ metrics: value_type: int aggregation_temporality: cumulative enabled: true -tests: - config: \ No newline at end of file diff --git a/receiver/opencensusreceiver/generated_component_test.go b/receiver/opencensusreceiver/generated_component_test.go index ef79c96746b0..55f390324d6d 100644 --- a/receiver/opencensusreceiver/generated_component_test.go +++ b/receiver/opencensusreceiver/generated_component_test.go @@ -8,13 +8,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) func TestComponentLifecycle(t *testing.T) { @@ -54,22 +51,5 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - - t.Run(test.name+"-lifecycle", func(t *testing.T) { - - // TODO support lifecycle - t.SkipNow() - - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) - require.NoError(t, err) - host := componenttest.NewNopHost() - require.NoError(t, err) - require.NoError(t, firstRcvr.Start(context.Background(), host)) - require.NoError(t, firstRcvr.Shutdown(context.Background())) - secondRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) - require.NoError(t, err) - require.NoError(t, secondRcvr.Start(context.Background(), host)) - require.NoError(t, secondRcvr.Shutdown(context.Background())) - }) } } diff --git a/receiver/oracledbreceiver/generated_component_test.go b/receiver/oracledbreceiver/generated_component_test.go index ee44442afc4b..065e362f78b6 100644 --- a/receiver/oracledbreceiver/generated_component_test.go +++ b/receiver/oracledbreceiver/generated_component_test.go @@ -9,12 +9,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) func TestComponentLifecycle(t *testing.T) { @@ -47,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/oracledbreceiver/metadata.yaml b/receiver/oracledbreceiver/metadata.yaml index d4d0be3ac398..25d2fddc478e 100644 --- a/receiver/oracledbreceiver/metadata.yaml +++ b/receiver/oracledbreceiver/metadata.yaml @@ -252,6 +252,3 @@ metrics: value_type: int input_type: string unit: "{gets}" - -tests: - config: diff --git a/receiver/osqueryreceiver/metadata.yaml b/receiver/osqueryreceiver/metadata.yaml index 192c72af1d4b..c478b71c16a9 100644 --- a/receiver/osqueryreceiver/metadata.yaml +++ b/receiver/osqueryreceiver/metadata.yaml @@ -6,3 +6,8 @@ status: development: [logs] codeowners: active: [codeboten, nslaughter, smithclay] + +# TODO: Update the receiver to pass the tests +tests: + skip_lifecycle: true + skip_shutdown: true diff --git a/receiver/googlecloudpubsubreceiver/generated_component_test.go b/receiver/otelarrowreceiver/generated_component_test.go similarity index 96% rename from receiver/googlecloudpubsubreceiver/generated_component_test.go rename to receiver/otelarrowreceiver/generated_component_test.go index 3aba2c2b1b70..d1b9a1f016a3 100644 --- a/receiver/googlecloudpubsubreceiver/generated_component_test.go +++ b/receiver/otelarrowreceiver/generated_component_test.go @@ -1,6 +1,6 @@ // Code generated by mdatagen. DO NOT EDIT. -package googlecloudpubsubreceiver +package otelarrowreceiver import ( "context" @@ -9,12 +9,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) func TestComponentLifecycle(t *testing.T) { @@ -61,12 +59,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - - // TODO support lifecycle - t.SkipNow() - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/otlpjsonfilereceiver/generated_component_test.go b/receiver/otlpjsonfilereceiver/generated_component_test.go index 7fd765fce111..92eed6ad71ad 100644 --- a/receiver/otlpjsonfilereceiver/generated_component_test.go +++ b/receiver/otlpjsonfilereceiver/generated_component_test.go @@ -9,12 +9,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) func TestComponentLifecycle(t *testing.T) { @@ -61,9 +59,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/podmanreceiver/generated_component_test.go b/receiver/podmanreceiver/generated_component_test.go index 141e385f22c5..ccaca5212782 100644 --- a/receiver/podmanreceiver/generated_component_test.go +++ b/receiver/podmanreceiver/generated_component_test.go @@ -1,5 +1,4 @@ // Code generated by mdatagen. DO NOT EDIT. - //go:build !windows package podmanreceiver @@ -10,13 +9,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) func TestComponentLifecycle(t *testing.T) { @@ -49,22 +45,5 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - - t.Run(test.name+"-lifecycle", func(t *testing.T) { - - // TODO support lifecycle - t.SkipNow() - - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) - require.NoError(t, err) - host := componenttest.NewNopHost() - require.NoError(t, err) - require.NoError(t, firstRcvr.Start(context.Background(), host)) - require.NoError(t, firstRcvr.Shutdown(context.Background())) - secondRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) - require.NoError(t, err) - require.NoError(t, secondRcvr.Start(context.Background(), host)) - require.NoError(t, secondRcvr.Shutdown(context.Background())) - }) } } diff --git a/receiver/podmanreceiver/metadata.yaml b/receiver/podmanreceiver/metadata.yaml index 1cfb023e01b5..5f0f8c0fd979 100644 --- a/receiver/podmanreceiver/metadata.yaml +++ b/receiver/podmanreceiver/metadata.yaml @@ -9,6 +9,6 @@ status: active: [rogercoll] unsupported_platforms: [windows] +# TODO: Update the receiver to pass the tests tests: - config: skip_lifecycle: true diff --git a/receiver/postgresqlreceiver/generated_component_test.go b/receiver/postgresqlreceiver/generated_component_test.go index b44f0148f24e..4e02cbca32a9 100644 --- a/receiver/postgresqlreceiver/generated_component_test.go +++ b/receiver/postgresqlreceiver/generated_component_test.go @@ -9,12 +9,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) func TestComponentLifecycle(t *testing.T) { @@ -47,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/prometheusreceiver/generated_component_test.go b/receiver/prometheusreceiver/generated_component_test.go index fc79462f09a4..8cd217f54e7c 100644 --- a/receiver/prometheusreceiver/generated_component_test.go +++ b/receiver/prometheusreceiver/generated_component_test.go @@ -9,12 +9,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) func TestComponentLifecycle(t *testing.T) { @@ -47,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/pulsarreceiver/generated_component_test.go b/receiver/pulsarreceiver/generated_component_test.go index 6f9dbce0c53e..ee4d9dbb920b 100644 --- a/receiver/pulsarreceiver/generated_component_test.go +++ b/receiver/pulsarreceiver/generated_component_test.go @@ -8,13 +8,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) func TestComponentLifecycle(t *testing.T) { @@ -61,22 +58,5 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - - t.Run(test.name+"-lifecycle", func(t *testing.T) { - - // TODO support lifecycle - t.SkipNow() - - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) - require.NoError(t, err) - host := componenttest.NewNopHost() - require.NoError(t, err) - require.NoError(t, firstRcvr.Start(context.Background(), host)) - require.NoError(t, firstRcvr.Shutdown(context.Background())) - secondRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) - require.NoError(t, err) - require.NoError(t, secondRcvr.Start(context.Background(), host)) - require.NoError(t, secondRcvr.Shutdown(context.Background())) - }) } } diff --git a/receiver/pulsarreceiver/metadata.yaml b/receiver/pulsarreceiver/metadata.yaml index e90b33d89578..bfeda5351712 100644 --- a/receiver/pulsarreceiver/metadata.yaml +++ b/receiver/pulsarreceiver/metadata.yaml @@ -7,6 +7,7 @@ status: distributions: [contrib] codeowners: active: [dmitryax, dao-jun] + +# TODO: Update the receiver to pass the tests tests: - config: skip_lifecycle: true diff --git a/receiver/purefareceiver/generated_component_test.go b/receiver/purefareceiver/generated_component_test.go index ea27f6c9c6cc..d27f75d7a4e2 100644 --- a/receiver/purefareceiver/generated_component_test.go +++ b/receiver/purefareceiver/generated_component_test.go @@ -9,12 +9,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) func TestComponentLifecycle(t *testing.T) { @@ -47,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/purefareceiver/metadata.yaml b/receiver/purefareceiver/metadata.yaml index 18f1d6f5df2f..6d2f2f3fb08f 100644 --- a/receiver/purefareceiver/metadata.yaml +++ b/receiver/purefareceiver/metadata.yaml @@ -7,6 +7,3 @@ status: distributions: [contrib, sumo] codeowners: active: [jpkrohling, dgoscn, chrroberts-pure] - -tests: - config: diff --git a/receiver/purefbreceiver/generated_component_test.go b/receiver/purefbreceiver/generated_component_test.go index 5f6bc4582405..be9c8424035b 100644 --- a/receiver/purefbreceiver/generated_component_test.go +++ b/receiver/purefbreceiver/generated_component_test.go @@ -9,12 +9,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) func TestComponentLifecycle(t *testing.T) { @@ -47,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/purefbreceiver/metadata.yaml b/receiver/purefbreceiver/metadata.yaml index cf9a19b5fec7..5c4c52d2612f 100644 --- a/receiver/purefbreceiver/metadata.yaml +++ b/receiver/purefbreceiver/metadata.yaml @@ -7,6 +7,3 @@ status: distributions: [contrib, sumo] codeowners: active: [jpkrohling, dgoscn, chrroberts-pure] - -tests: - config: diff --git a/receiver/rabbitmqreceiver/generated_component_test.go b/receiver/rabbitmqreceiver/generated_component_test.go index d066df6b4700..f643003fe279 100644 --- a/receiver/rabbitmqreceiver/generated_component_test.go +++ b/receiver/rabbitmqreceiver/generated_component_test.go @@ -9,12 +9,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) func TestComponentLifecycle(t *testing.T) { @@ -47,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/rabbitmqreceiver/metadata.yaml b/receiver/rabbitmqreceiver/metadata.yaml index e9ce9f459542..9d6a0642f90b 100644 --- a/receiver/rabbitmqreceiver/metadata.yaml +++ b/receiver/rabbitmqreceiver/metadata.yaml @@ -81,6 +81,3 @@ metrics: value_type: int attributes: [message.state] enabled: true - -tests: - config: diff --git a/receiver/receivercreator/generated_component_test.go b/receiver/receivercreator/generated_component_test.go new file mode 100644 index 000000000000..a6a6efa9d0eb --- /dev/null +++ b/receiver/receivercreator/generated_component_test.go @@ -0,0 +1,75 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package receivercreator + +import ( + "context" + "testing" + + "github.com/stretchr/testify/require" + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/component/componenttest" + "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/consumer/consumertest" + "go.opentelemetry.io/collector/receiver" + "go.opentelemetry.io/collector/receiver/receivertest" +) + +func TestComponentLifecycle(t *testing.T) { + factory := NewFactory() + + tests := []struct { + name string + createFn func(ctx context.Context, set receiver.CreateSettings, cfg component.Config) (component.Component, error) + }{ + + { + name: "logs", + createFn: func(ctx context.Context, set receiver.CreateSettings, cfg component.Config) (component.Component, error) { + return factory.CreateLogsReceiver(ctx, set, cfg, consumertest.NewNop()) + }, + }, + + { + name: "metrics", + createFn: func(ctx context.Context, set receiver.CreateSettings, cfg component.Config) (component.Component, error) { + return factory.CreateMetricsReceiver(ctx, set, cfg, consumertest.NewNop()) + }, + }, + + { + name: "traces", + createFn: func(ctx context.Context, set receiver.CreateSettings, cfg component.Config) (component.Component, error) { + return factory.CreateTracesReceiver(ctx, set, cfg, consumertest.NewNop()) + }, + }, + } + + cm, err := confmaptest.LoadConf("metadata.yaml") + require.NoError(t, err) + cfg := factory.CreateDefaultConfig() + sub, err := cm.Sub("tests::config") + require.NoError(t, err) + require.NoError(t, component.UnmarshalConfig(sub, cfg)) + + for _, test := range tests { + t.Run(test.name+"-shutdown", func(t *testing.T) { + c, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + err = c.Shutdown(context.Background()) + require.NoError(t, err) + }) + t.Run(test.name+"-lifecycle", func(t *testing.T) { + firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + host := componenttest.NewNopHost() + require.NoError(t, err) + require.NoError(t, firstRcvr.Start(context.Background(), host)) + require.NoError(t, firstRcvr.Shutdown(context.Background())) + secondRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + require.NoError(t, secondRcvr.Start(context.Background(), host)) + require.NoError(t, secondRcvr.Shutdown(context.Background())) + }) + } +} diff --git a/receiver/redisreceiver/generated_component_test.go b/receiver/redisreceiver/generated_component_test.go index cc37277f59db..9933348adbab 100644 --- a/receiver/redisreceiver/generated_component_test.go +++ b/receiver/redisreceiver/generated_component_test.go @@ -9,12 +9,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) func TestComponentLifecycle(t *testing.T) { @@ -47,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/redisreceiver/metadata.yaml b/receiver/redisreceiver/metadata.yaml index 69153dbc4309..78afe847d9cf 100644 --- a/receiver/redisreceiver/metadata.yaml +++ b/receiver/redisreceiver/metadata.yaml @@ -351,6 +351,7 @@ metrics: unit: "By" gauge: value_type: int + tests: config: endpoint: localhost:6379 diff --git a/receiver/riakreceiver/generated_component_test.go b/receiver/riakreceiver/generated_component_test.go index 100093ffe72a..a4ad88bdfe48 100644 --- a/receiver/riakreceiver/generated_component_test.go +++ b/receiver/riakreceiver/generated_component_test.go @@ -9,12 +9,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) func TestComponentLifecycle(t *testing.T) { @@ -47,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/riakreceiver/metadata.yaml b/receiver/riakreceiver/metadata.yaml index 4df6e0f42b96..72c22bf52029 100644 --- a/receiver/riakreceiver/metadata.yaml +++ b/receiver/riakreceiver/metadata.yaml @@ -81,6 +81,3 @@ metrics: value_type: int attributes: [operation] enabled: true - -tests: - config: diff --git a/receiver/saphanareceiver/generated_component_test.go b/receiver/saphanareceiver/generated_component_test.go index f96ef007e8c0..6b19379f6d9f 100644 --- a/receiver/saphanareceiver/generated_component_test.go +++ b/receiver/saphanareceiver/generated_component_test.go @@ -9,12 +9,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) func TestComponentLifecycle(t *testing.T) { @@ -47,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/saphanareceiver/metadata.yaml b/receiver/saphanareceiver/metadata.yaml index b5cb97f93726..ae249d0b1454 100644 --- a/receiver/saphanareceiver/metadata.yaml +++ b/receiver/saphanareceiver/metadata.yaml @@ -644,6 +644,3 @@ metrics: input_type: string attributes: [] enabled: true - -tests: - config: diff --git a/receiver/sapmreceiver/generated_component_test.go b/receiver/sapmreceiver/generated_component_test.go index e8f36352ee89..ebbf6df2ab3b 100644 --- a/receiver/sapmreceiver/generated_component_test.go +++ b/receiver/sapmreceiver/generated_component_test.go @@ -9,12 +9,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) func TestComponentLifecycle(t *testing.T) { @@ -47,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/sapmreceiver/metadata.yaml b/receiver/sapmreceiver/metadata.yaml index d6ba89598d34..9466d25eed5a 100644 --- a/receiver/sapmreceiver/metadata.yaml +++ b/receiver/sapmreceiver/metadata.yaml @@ -7,6 +7,3 @@ status: distributions: [contrib, splunk, observiq, sumo] codeowners: active: [atoulme] - -tests: - config: diff --git a/receiver/signalfxreceiver/generated_component_test.go b/receiver/signalfxreceiver/generated_component_test.go index f01b24524d08..fcb1f6a8d892 100644 --- a/receiver/signalfxreceiver/generated_component_test.go +++ b/receiver/signalfxreceiver/generated_component_test.go @@ -9,12 +9,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) func TestComponentLifecycle(t *testing.T) { @@ -54,9 +52,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/signalfxreceiver/metadata.yaml b/receiver/signalfxreceiver/metadata.yaml index 598fa13bf08e..1ab2bb674571 100644 --- a/receiver/signalfxreceiver/metadata.yaml +++ b/receiver/signalfxreceiver/metadata.yaml @@ -8,6 +8,3 @@ status: codeowners: active: ["dmitryax"] emeritus: - -tests: - config: diff --git a/receiver/simpleprometheusreceiver/generated_component_test.go b/receiver/simpleprometheusreceiver/generated_component_test.go index 1e00e6dde512..0c3da740d801 100644 --- a/receiver/simpleprometheusreceiver/generated_component_test.go +++ b/receiver/simpleprometheusreceiver/generated_component_test.go @@ -9,12 +9,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) func TestComponentLifecycle(t *testing.T) { @@ -47,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/skywalkingreceiver/generated_component_test.go b/receiver/skywalkingreceiver/generated_component_test.go index a9e8ab109f86..4f594dea8bd1 100644 --- a/receiver/skywalkingreceiver/generated_component_test.go +++ b/receiver/skywalkingreceiver/generated_component_test.go @@ -9,12 +9,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) func TestComponentLifecycle(t *testing.T) { @@ -54,9 +52,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/snmpreceiver/generated_component_test.go b/receiver/snmpreceiver/generated_component_test.go index 245b2614fb4f..c3784c2e32c8 100644 --- a/receiver/snmpreceiver/generated_component_test.go +++ b/receiver/snmpreceiver/generated_component_test.go @@ -9,12 +9,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) func TestComponentLifecycle(t *testing.T) { @@ -47,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/snowflakereceiver/generated_component_test.go b/receiver/snowflakereceiver/generated_component_test.go index d3ef16bb42f2..9a1e04fccfbf 100644 --- a/receiver/snowflakereceiver/generated_component_test.go +++ b/receiver/snowflakereceiver/generated_component_test.go @@ -9,12 +9,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) func TestComponentLifecycle(t *testing.T) { @@ -47,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/solacereceiver/generated_component_test.go b/receiver/solacereceiver/generated_component_test.go index 093b5c35da3b..97e623799dca 100644 --- a/receiver/solacereceiver/generated_component_test.go +++ b/receiver/solacereceiver/generated_component_test.go @@ -8,13 +8,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) func TestComponentLifecycle(t *testing.T) { @@ -47,22 +44,5 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - - t.Run(test.name+"-lifecycle", func(t *testing.T) { - - // TODO support lifecycle - t.SkipNow() - - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) - require.NoError(t, err) - host := componenttest.NewNopHost() - require.NoError(t, err) - require.NoError(t, firstRcvr.Start(context.Background(), host)) - require.NoError(t, firstRcvr.Shutdown(context.Background())) - secondRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) - require.NoError(t, err) - require.NoError(t, secondRcvr.Start(context.Background(), host)) - require.NoError(t, secondRcvr.Shutdown(context.Background())) - }) } } diff --git a/receiver/solacereceiver/metadata.yaml b/receiver/solacereceiver/metadata.yaml index d724eacd2b06..ed96b3f2b5d0 100644 --- a/receiver/solacereceiver/metadata.yaml +++ b/receiver/solacereceiver/metadata.yaml @@ -8,6 +8,7 @@ status: codeowners: active: [djaglowski, mcardy] +# TODO: Update the receiver to pass the tests tests: config: auth: diff --git a/receiver/splunkenterprisereceiver/generated_component_test.go b/receiver/splunkenterprisereceiver/generated_component_test.go index 8bfbe510d251..8c27f93f0a17 100644 --- a/receiver/splunkenterprisereceiver/generated_component_test.go +++ b/receiver/splunkenterprisereceiver/generated_component_test.go @@ -9,12 +9,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) func TestComponentLifecycle(t *testing.T) { @@ -47,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/splunkhecreceiver/generated_component_test.go b/receiver/splunkhecreceiver/generated_component_test.go index ed4311a3675d..cde400895bf0 100644 --- a/receiver/splunkhecreceiver/generated_component_test.go +++ b/receiver/splunkhecreceiver/generated_component_test.go @@ -9,12 +9,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) func TestComponentLifecycle(t *testing.T) { @@ -54,9 +52,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/splunkhecreceiver/metadata.yaml b/receiver/splunkhecreceiver/metadata.yaml index c9196ae58e36..e38c35598960 100644 --- a/receiver/splunkhecreceiver/metadata.yaml +++ b/receiver/splunkhecreceiver/metadata.yaml @@ -8,5 +8,3 @@ status: codeowners: active: ["atoulme"] emeritus: -tests: - config: \ No newline at end of file diff --git a/receiver/sqlqueryreceiver/generated_component_test.go b/receiver/sqlqueryreceiver/generated_component_test.go index fd215a7da2e2..0b2ab7e685bb 100644 --- a/receiver/sqlqueryreceiver/generated_component_test.go +++ b/receiver/sqlqueryreceiver/generated_component_test.go @@ -9,12 +9,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) func TestComponentLifecycle(t *testing.T) { @@ -54,9 +52,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/sqlqueryreceiver/metadata.yaml b/receiver/sqlqueryreceiver/metadata.yaml index dbe4d52791cd..d76b2dcac828 100644 --- a/receiver/sqlqueryreceiver/metadata.yaml +++ b/receiver/sqlqueryreceiver/metadata.yaml @@ -9,6 +9,3 @@ status: codeowners: active: [dmitryax, crobert-1] emeritus: [pmcollins] - -tests: - config: diff --git a/receiver/sqlserverreceiver/generated_component_test.go b/receiver/sqlserverreceiver/generated_component_test.go index 4fe860085b9d..3cdf4b1bfb84 100644 --- a/receiver/sqlserverreceiver/generated_component_test.go +++ b/receiver/sqlserverreceiver/generated_component_test.go @@ -1,5 +1,4 @@ // Code generated by mdatagen. DO NOT EDIT. - //go:build !darwin && !linux package sqlserverreceiver @@ -11,12 +10,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) func TestComponentLifecycle(t *testing.T) { @@ -49,9 +46,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/sshcheckreceiver/generated_component_test.go b/receiver/sshcheckreceiver/generated_component_test.go index 460f0edbf3e9..a5304d1ebc3e 100644 --- a/receiver/sshcheckreceiver/generated_component_test.go +++ b/receiver/sshcheckreceiver/generated_component_test.go @@ -1,5 +1,4 @@ // Code generated by mdatagen. DO NOT EDIT. - //go:build !windows package sshcheckreceiver @@ -11,12 +10,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) func TestComponentLifecycle(t *testing.T) { @@ -49,9 +46,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/sshcheckreceiver/metadata.yaml b/receiver/sshcheckreceiver/metadata.yaml index 92846a93301b..a5e408bea000 100644 --- a/receiver/sshcheckreceiver/metadata.yaml +++ b/receiver/sshcheckreceiver/metadata.yaml @@ -66,6 +66,3 @@ metrics: monotonic: false unit: "{error}" attributes: [error.message] - -tests: - config: diff --git a/receiver/statsdreceiver/generated_component_test.go b/receiver/statsdreceiver/generated_component_test.go index e1e2ca0aa5c3..a1e58e5504e2 100644 --- a/receiver/statsdreceiver/generated_component_test.go +++ b/receiver/statsdreceiver/generated_component_test.go @@ -9,12 +9,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) func TestComponentLifecycle(t *testing.T) { @@ -47,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/statsdreceiver/metadata.yaml b/receiver/statsdreceiver/metadata.yaml index d11d7b216244..c0e649588670 100644 --- a/receiver/statsdreceiver/metadata.yaml +++ b/receiver/statsdreceiver/metadata.yaml @@ -7,6 +7,3 @@ status: distributions: [contrib, splunk, sumo, aws] codeowners: active: [jmacd, dmitryax] - -tests: - config: diff --git a/receiver/syslogreceiver/generated_component_test.go b/receiver/syslogreceiver/generated_component_test.go index 7fb02312a38f..0d7b3f75ad5d 100644 --- a/receiver/syslogreceiver/generated_component_test.go +++ b/receiver/syslogreceiver/generated_component_test.go @@ -9,12 +9,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) func TestComponentLifecycle(t *testing.T) { @@ -47,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/tcplogreceiver/generated_component_test.go b/receiver/tcplogreceiver/generated_component_test.go index 0ada9a905bc8..269bac37a152 100644 --- a/receiver/tcplogreceiver/generated_component_test.go +++ b/receiver/tcplogreceiver/generated_component_test.go @@ -9,12 +9,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) func TestComponentLifecycle(t *testing.T) { @@ -47,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/udplogreceiver/generated_component_test.go b/receiver/udplogreceiver/generated_component_test.go index 9ccc797ac3a9..ac60549b2d55 100644 --- a/receiver/udplogreceiver/generated_component_test.go +++ b/receiver/udplogreceiver/generated_component_test.go @@ -9,12 +9,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) func TestComponentLifecycle(t *testing.T) { @@ -47,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/vcenterreceiver/generated_component_test.go b/receiver/vcenterreceiver/generated_component_test.go index e2710dc7036c..fec61aef1064 100644 --- a/receiver/vcenterreceiver/generated_component_test.go +++ b/receiver/vcenterreceiver/generated_component_test.go @@ -9,12 +9,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) func TestComponentLifecycle(t *testing.T) { @@ -47,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/vcenterreceiver/metadata.yaml b/receiver/vcenterreceiver/metadata.yaml index 48e05d26c5f6..c7c462c84857 100644 --- a/receiver/vcenterreceiver/metadata.yaml +++ b/receiver/vcenterreceiver/metadata.yaml @@ -422,6 +422,3 @@ metrics: gauge: value_type: double attributes: [] - -tests: - config: diff --git a/receiver/wavefrontreceiver/generated_component_test.go b/receiver/wavefrontreceiver/generated_component_test.go index 1510df167c69..0351479be02b 100644 --- a/receiver/wavefrontreceiver/generated_component_test.go +++ b/receiver/wavefrontreceiver/generated_component_test.go @@ -8,13 +8,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) func TestComponentLifecycle(t *testing.T) { @@ -47,22 +44,5 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - - t.Run(test.name+"-lifecycle", func(t *testing.T) { - - // TODO support lifecycle - t.SkipNow() - - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) - require.NoError(t, err) - host := componenttest.NewNopHost() - require.NoError(t, err) - require.NoError(t, firstRcvr.Start(context.Background(), host)) - require.NoError(t, firstRcvr.Shutdown(context.Background())) - secondRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) - require.NoError(t, err) - require.NoError(t, secondRcvr.Start(context.Background(), host)) - require.NoError(t, secondRcvr.Shutdown(context.Background())) - }) } } diff --git a/receiver/wavefrontreceiver/metadata.yaml b/receiver/wavefrontreceiver/metadata.yaml index d6829633cbf2..a4e833962661 100644 --- a/receiver/wavefrontreceiver/metadata.yaml +++ b/receiver/wavefrontreceiver/metadata.yaml @@ -8,6 +8,6 @@ status: codeowners: active: [samiura] +# TODO: Update the receiver to pass the tests tests: - config: skip_lifecycle: true diff --git a/receiver/webhookeventreceiver/generated_component_test.go b/receiver/webhookeventreceiver/generated_component_test.go index 26afc7d1c0ba..24fb011d6c0a 100644 --- a/receiver/webhookeventreceiver/generated_component_test.go +++ b/receiver/webhookeventreceiver/generated_component_test.go @@ -9,12 +9,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) func TestComponentLifecycle(t *testing.T) { @@ -47,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/windowseventlogreceiver/generated_component_test.go b/receiver/windowseventlogreceiver/generated_component_test.go index 7cdd6eaa73cb..5f007a661ca7 100644 --- a/receiver/windowseventlogreceiver/generated_component_test.go +++ b/receiver/windowseventlogreceiver/generated_component_test.go @@ -1,5 +1,4 @@ // Code generated by mdatagen. DO NOT EDIT. - //go:build !darwin && !linux package windowseventlogreceiver @@ -11,12 +10,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) func TestComponentLifecycle(t *testing.T) { @@ -49,9 +46,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/windowsperfcountersreceiver/generated_component_test.go b/receiver/windowsperfcountersreceiver/generated_component_test.go index 6e8e604ce9c9..347f5b63d2fd 100644 --- a/receiver/windowsperfcountersreceiver/generated_component_test.go +++ b/receiver/windowsperfcountersreceiver/generated_component_test.go @@ -1,5 +1,4 @@ // Code generated by mdatagen. DO NOT EDIT. - //go:build !darwin && !linux package windowsperfcountersreceiver @@ -11,12 +10,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) func TestComponentLifecycle(t *testing.T) { @@ -49,9 +46,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/zipkinreceiver/generated_component_test.go b/receiver/zipkinreceiver/generated_component_test.go index 94111d3bbfa1..c7ea198e355c 100644 --- a/receiver/zipkinreceiver/generated_component_test.go +++ b/receiver/zipkinreceiver/generated_component_test.go @@ -9,12 +9,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) func TestComponentLifecycle(t *testing.T) { @@ -47,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() diff --git a/receiver/zipkinreceiver/metadata.yaml b/receiver/zipkinreceiver/metadata.yaml index e0c7eadb0b3d..0228140f6fb5 100644 --- a/receiver/zipkinreceiver/metadata.yaml +++ b/receiver/zipkinreceiver/metadata.yaml @@ -16,6 +16,3 @@ status: - liatrio codeowners: active: [MovieStoreGuy, astencel-sumo, crobert-1] - -tests: - config: diff --git a/receiver/zookeeperreceiver/generated_component_test.go b/receiver/zookeeperreceiver/generated_component_test.go index 5c10212cb5f5..ebc3a3e52748 100644 --- a/receiver/zookeeperreceiver/generated_component_test.go +++ b/receiver/zookeeperreceiver/generated_component_test.go @@ -9,12 +9,10 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - + "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" - - "go.opentelemetry.io/collector/confmap/confmaptest" ) func TestComponentLifecycle(t *testing.T) { @@ -47,9 +45,7 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) - t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost()