From 646d3dca2a8e7e5a6ff6bfae0549e1319d457afa Mon Sep 17 00:00:00 2001 From: Matthew Wear Date: Fri, 4 Oct 2024 15:11:20 -0700 Subject: [PATCH] Lint --- exporter/otlpexporter/otlp_test.go | 6 +++--- exporter/otlphttpexporter/go.mod | 2 -- exporter/otlphttpexporter/otlp_test.go | 12 ++++++------ 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/exporter/otlpexporter/otlp_test.go b/exporter/otlpexporter/otlp_test.go index 7117a5f57c0..38db5aa5504 100644 --- a/exporter/otlpexporter/otlp_test.go +++ b/exporter/otlpexporter/otlp_test.go @@ -856,7 +856,7 @@ func TestComponentStatus(t *testing.T) { exp, err := factory.CreateTracesExporter(context.Background(), set, cfg) require.NoError(t, err) require.NotNil(t, exp) - assert.NoError(t, exp.Start(context.Background(), host)) + require.NoError(t, exp.Start(context.Background(), host)) defer func() { assert.NoError(t, exp.Shutdown(context.Background())) @@ -897,7 +897,7 @@ func TestComponentStatus(t *testing.T) { exp, err := factory.CreateMetricsExporter(context.Background(), set, cfg) require.NoError(t, err) require.NotNil(t, exp) - assert.NoError(t, exp.Start(context.Background(), host)) + require.NoError(t, exp.Start(context.Background(), host)) defer func() { assert.NoError(t, exp.Shutdown(context.Background())) @@ -937,7 +937,7 @@ func TestComponentStatus(t *testing.T) { exp, err := factory.CreateLogsExporter(context.Background(), set, cfg) require.NoError(t, err) require.NotNil(t, exp) - assert.NoError(t, exp.Start(context.Background(), host)) + require.NoError(t, exp.Start(context.Background(), host)) defer func() { assert.NoError(t, exp.Shutdown(context.Background())) diff --git a/exporter/otlphttpexporter/go.mod b/exporter/otlphttpexporter/go.mod index 91864f8b9ff..5f2be9dd9ed 100644 --- a/exporter/otlphttpexporter/go.mod +++ b/exporter/otlphttpexporter/go.mod @@ -77,8 +77,6 @@ replace go.opentelemetry.io/collector => ../../ replace go.opentelemetry.io/collector/component => ../../component -replace go.opentelemetry.io/collector/component/componentstatus => ../../component/componentstatus - replace go.opentelemetry.io/collector/config/configauth => ../../config/configauth replace go.opentelemetry.io/collector/config/configcompression => ../../config/configcompression diff --git a/exporter/otlphttpexporter/otlp_test.go b/exporter/otlphttpexporter/otlp_test.go index eb35e5825a0..8e6b19a764d 100644 --- a/exporter/otlphttpexporter/otlp_test.go +++ b/exporter/otlphttpexporter/otlp_test.go @@ -1055,7 +1055,7 @@ func TestComponentStatus(t *testing.T) { t.Run("traces", func(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - srv := createBackend("/v1/traces", func(writer http.ResponseWriter, request *http.Request) { + srv := createBackend("/v1/traces", func(writer http.ResponseWriter, _ *http.Request) { writer.WriteHeader(tt.responseStatus) }) defer srv.Close() @@ -1082,7 +1082,7 @@ func TestComponentStatus(t *testing.T) { traces := ptrace.NewTraces() err = exp.ConsumeTraces(context.Background(), traces) if tt.componentStatus != componentstatus.StatusOK { - assert.Error(t, err) + require.Error(t, err) } assert.Equal(t, tt.componentStatus, host.lastStatus) }) @@ -1092,7 +1092,7 @@ func TestComponentStatus(t *testing.T) { t.Run("metrics", func(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - srv := createBackend("/v1/metrics", func(writer http.ResponseWriter, request *http.Request) { + srv := createBackend("/v1/metrics", func(writer http.ResponseWriter, _ *http.Request) { writer.WriteHeader(tt.responseStatus) }) defer srv.Close() @@ -1119,7 +1119,7 @@ func TestComponentStatus(t *testing.T) { metrics := pmetric.NewMetrics() err = exp.ConsumeMetrics(context.Background(), metrics) if tt.componentStatus != componentstatus.StatusOK { - assert.Error(t, err) + require.Error(t, err) } assert.Equal(t, tt.componentStatus, host.lastStatus) }) @@ -1129,7 +1129,7 @@ func TestComponentStatus(t *testing.T) { t.Run("logs", func(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - srv := createBackend("/v1/logs", func(writer http.ResponseWriter, request *http.Request) { + srv := createBackend("/v1/logs", func(writer http.ResponseWriter, _ *http.Request) { writer.WriteHeader(tt.responseStatus) }) defer srv.Close() @@ -1156,7 +1156,7 @@ func TestComponentStatus(t *testing.T) { logs := plog.NewLogs() err = exp.ConsumeLogs(context.Background(), logs) if tt.componentStatus != componentstatus.StatusOK { - assert.Error(t, err) + require.Error(t, err) } assert.Equal(t, tt.componentStatus, host.lastStatus) })