Skip to content

Commit

Permalink
Fix linter and test issues
Browse files Browse the repository at this point in the history
  • Loading branch information
mx-psi committed Feb 5, 2024
1 parent 83dfce8 commit 554c353
Show file tree
Hide file tree
Showing 13 changed files with 13 additions and 18 deletions.
2 changes: 1 addition & 1 deletion exporter/f5cloudexporter/factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (

func TestFactory_TestType(t *testing.T) {
f := NewFactory()
assert.Equal(t, f.Type(), component.Type(metadata.Type))
assert.Equal(t, f.Type(), metadata.Type)
}

func TestFactory_CreateDefaultConfig(t *testing.T) {
Expand Down
3 changes: 1 addition & 2 deletions exporter/googlecloudpubsubexporter/factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"testing"

"github.com/stretchr/testify/assert"
"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/component/componenttest"
"go.opentelemetry.io/collector/exporter/exportertest"

Expand All @@ -24,7 +23,7 @@ func TestCreateDefaultConfig(t *testing.T) {

func TestType(t *testing.T) {
factory := NewFactory()
assert.Equal(t, component.Type(metadata.Type), factory.Type())
assert.Equal(t, metadata.Type, factory.Type())
}

func TestCreateTracesExporter(t *testing.T) {
Expand Down
3 changes: 1 addition & 2 deletions exporter/mezmoexporter/factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"time"

"github.com/stretchr/testify/assert"
"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/component/componenttest"
"go.opentelemetry.io/collector/config/confighttp"
"go.opentelemetry.io/collector/config/configretry"
Expand All @@ -22,7 +21,7 @@ import (
func TestType(t *testing.T) {
factory := NewFactory()
pType := factory.Type()
assert.Equal(t, pType, component.Type(metadata.Type))
assert.Equal(t, pType, metadata.Type)
}

func TestCreateDefaultConfig(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion exporter/sentryexporter/factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func TestCreateDefaultConfig(t *testing.T) {

func TestCreateExporter(t *testing.T) {
factory := NewFactory()
assert.Equal(t, metadata.Type, string(factory.Type()))
assert.Equal(t, metadata.Type, factory.Type())

cfg := factory.CreateDefaultConfig()
eCfg := cfg.(*Config)
Expand Down
3 changes: 1 addition & 2 deletions extension/basicauthextension/factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"testing"

"github.com/stretchr/testify/assert"
"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/component/componenttest"
"go.opentelemetry.io/collector/extension/extensiontest"

Expand Down Expand Up @@ -37,5 +36,5 @@ func TestCreateExtension_ValidConfig(t *testing.T) {
func TestNewFactory(t *testing.T) {
f := NewFactory()
assert.NotNil(t, f)
assert.Equal(t, f.Type(), component.Type(metadata.Type))
assert.Equal(t, f.Type(), metadata.Type)
}
2 changes: 1 addition & 1 deletion processor/attributesprocessor/factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (

func TestFactory_Type(t *testing.T) {
factory := NewFactory()
assert.Equal(t, factory.Type(), component.Type(metadata.Type))
assert.Equal(t, factory.Type(), metadata.Type)
}

func TestFactory_CreateDefaultConfig(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion processor/spanprocessor/factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (

func TestFactory_Type(t *testing.T) {
factory := NewFactory()
assert.Equal(t, factory.Type(), component.Type(metadata.Type))
assert.Equal(t, factory.Type(), metadata.Type)
}

func TestFactory_CreateDefaultConfig(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion processor/transformprocessor/factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (

func TestFactory_Type(t *testing.T) {
factory := NewFactory()
assert.Equal(t, factory.Type(), component.Type(metadata.Type))
assert.Equal(t, factory.Type(), metadata.Type)
}

func TestFactory_CreateDefaultConfig(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion receiver/activedirectorydsreceiver/factory_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func createMetricsReceiver(

adds := newActiveDirectoryDSScraper(c.MetricsBuilderConfig, params)
scraper, err := scraperhelper.NewScraper(
metadata.Type,
metadata.Type.String(),
adds.scrape,
scraperhelper.WithStart(adds.start),
scraperhelper.WithShutdown(adds.shutdown),
Expand Down
2 changes: 1 addition & 1 deletion receiver/awsxrayreceiver/factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func TestCreateDefaultConfig(t *testing.T) {
assert.NotNil(t, cfg, "failed to create default config")
assert.NoError(t, componenttest.CheckConfigStruct(cfg))

assert.Equal(t, component.Type(metadata.Type), factory.Type())
assert.Equal(t, metadata.Type, factory.Type())
}

func TestCreateTracesReceiver(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion receiver/azureeventhubreceiver/eventhubhandler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func (m *mockDataConsumer) consume(ctx context.Context, event *eventhub.Event) e
}

err = m.nextLogsConsumer.ConsumeLogs(logsContext, logs)
m.obsrecv.EndLogsOp(logsContext, metadata.Type, 1, err)
m.obsrecv.EndLogsOp(logsContext, metadata.Type.String(), 1, err)

return err
}
Expand Down
3 changes: 1 addition & 2 deletions receiver/googlecloudpubsubreceiver/factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"testing"

"github.com/stretchr/testify/assert"
"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/component/componenttest"
"go.opentelemetry.io/collector/consumer/consumertest"
"go.opentelemetry.io/collector/receiver/receivertest"
Expand All @@ -25,7 +24,7 @@ func TestCreateDefaultConfig(t *testing.T) {

func TestType(t *testing.T) {
factory := NewFactory()
assert.Equal(t, component.Type(metadata.Type), factory.Type())
assert.Equal(t, metadata.Type, factory.Type())
}

func TestCreateTracesReceiver(t *testing.T) {
Expand Down
3 changes: 1 addition & 2 deletions receiver/googlecloudspannerreceiver/factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/consumer/consumertest"
"go.opentelemetry.io/collector/receiver/receivertest"

Expand All @@ -24,7 +23,7 @@ func TestCreateDefaultConfig(t *testing.T) {

func TestType(t *testing.T) {
factory := NewFactory()
assert.Equal(t, component.Type(metadata.Type), factory.Type())
assert.Equal(t, metadata.Type, factory.Type())
}

func TestCreateMetricsReceiver(t *testing.T) {
Expand Down

0 comments on commit 554c353

Please sign in to comment.