From 0f3ab76ff31af174bd0f8af54f194b91a80479f5 Mon Sep 17 00:00:00 2001 From: Tyler Yahn Date: Fri, 15 Apr 2022 08:47:09 -0700 Subject: [PATCH] Rename all test funcs that mix camel and snake (#2788) Unify on Go standard camel case naming. Co-authored-by: Chester Cheung --- bridge/opentracing/mix_test.go | 2 +- exporters/jaeger/jaeger_test.go | 2 +- .../otlp/otlpmetric/otlpmetricgrpc/client_test.go | 12 ++++++------ .../otlp/otlptrace/otlptracegrpc/client_test.go | 12 ++++++------ exporters/stdout/stdouttrace/trace_test.go | 2 +- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/bridge/opentracing/mix_test.go b/bridge/opentracing/mix_test.go index 2d0de4ccd67..8fba1f06878 100644 --- a/bridge/opentracing/mix_test.go +++ b/bridge/opentracing/mix_test.go @@ -652,7 +652,7 @@ func runOTOtelOT(t *testing.T, ctx context.Context, name string, callback func(* }(ctx) } -func TestOtTagToOTelLabel_CheckTypeConversions(t *testing.T) { +func TestOtTagToOTelLabelCheckTypeConversions(t *testing.T) { tableTest := []struct { key string value interface{} diff --git a/exporters/jaeger/jaeger_test.go b/exporters/jaeger/jaeger_test.go index b9965a3ac9f..e843b054095 100644 --- a/exporters/jaeger/jaeger_test.go +++ b/exporters/jaeger/jaeger_test.go @@ -146,7 +146,7 @@ func TestExporterExportSpan(t *testing.T) { assert.Equal(t, tagVal, uploadedBatch.GetProcess().GetTags()[0].GetVStr()) } -func Test_spanSnapshotToThrift(t *testing.T) { +func TestSpanSnapshotToThrift(t *testing.T) { now := time.Now() traceID, _ := trace.TraceIDFromHex("0102030405060708090a0b0c0d0e0f10") spanID, _ := trace.SpanIDFromHex("0102030405060708") diff --git a/exporters/otlp/otlpmetric/otlpmetricgrpc/client_test.go b/exporters/otlp/otlpmetric/otlpmetricgrpc/client_test.go index dc7eeda51d9..c81e51e4fe9 100644 --- a/exporters/otlp/otlpmetric/otlpmetricgrpc/client_test.go +++ b/exporters/otlp/otlpmetric/otlpmetricgrpc/client_test.go @@ -41,7 +41,7 @@ var ( testResource = resource.Empty() ) -func TestNewExporter_endToEnd(t *testing.T) { +func TestNewExporterEndToEnd(t *testing.T) { tests := []struct { name string additionalOpts []otlpmetricgrpc.Option @@ -131,7 +131,7 @@ func TestExporterShutdown(t *testing.T) { }) } -func TestNewExporter_invokeStartThenStopManyTimes(t *testing.T) { +func TestNewExporterInvokeStartThenStopManyTimes(t *testing.T) { mc := runMockCollector(t) defer func() { _ = mc.stop() @@ -164,7 +164,7 @@ func TestNewExporter_invokeStartThenStopManyTimes(t *testing.T) { } // This test takes a long time to run: to skip it, run tests using: -short -func TestNewExporter_collectorOnBadConnection(t *testing.T) { +func TestNewExporterCollectorOnBadConnection(t *testing.T) { if testing.Short() { t.Skipf("Skipping this long running test") } @@ -185,7 +185,7 @@ func TestNewExporter_collectorOnBadConnection(t *testing.T) { _ = exp.Shutdown(ctx) } -func TestNewExporter_withEndpoint(t *testing.T) { +func TestNewExporterWithEndpoint(t *testing.T) { mc := runMockCollector(t) defer func() { _ = mc.stop() @@ -196,7 +196,7 @@ func TestNewExporter_withEndpoint(t *testing.T) { _ = exp.Shutdown(ctx) } -func TestNewExporter_withHeaders(t *testing.T) { +func TestNewExporterWithHeaders(t *testing.T) { mc := runMockCollector(t) defer func() { _ = mc.stop() @@ -216,7 +216,7 @@ func TestNewExporter_withHeaders(t *testing.T) { assert.Equal(t, "value1", headers.Get("header1")[0]) } -func TestNewExporter_WithTimeout(t *testing.T) { +func TestNewExporterWithTimeout(t *testing.T) { tts := []struct { name string fn func(exp *otlpmetric.Exporter) error diff --git a/exporters/otlp/otlptrace/otlptracegrpc/client_test.go b/exporters/otlp/otlptrace/otlptracegrpc/client_test.go index 191ff23afd4..9228001a78c 100644 --- a/exporters/otlp/otlptrace/otlptracegrpc/client_test.go +++ b/exporters/otlp/otlptrace/otlptracegrpc/client_test.go @@ -58,7 +58,7 @@ func contextWithTimeout(parent context.Context, t *testing.T, timeout time.Durat return context.WithDeadline(parent, d) } -func TestNew_endToEnd(t *testing.T) { +func TestNewEndToEnd(t *testing.T) { tests := []struct { name string additionalOpts []otlptracegrpc.Option @@ -141,7 +141,7 @@ func TestExporterShutdown(t *testing.T) { otlptracetest.RunExporterShutdownTest(t, factory) } -func TestNew_invokeStartThenStopManyTimes(t *testing.T) { +func TestNewInvokeStartThenStopManyTimes(t *testing.T) { mc := runMockCollector(t) t.Cleanup(func() { require.NoError(t, mc.stop()) }) @@ -168,7 +168,7 @@ func TestNew_invokeStartThenStopManyTimes(t *testing.T) { } // This test takes a long time to run: to skip it, run tests using: -short -func TestNew_collectorOnBadConnection(t *testing.T) { +func TestNewCollectorOnBadConnection(t *testing.T) { if testing.Short() { t.Skipf("Skipping this long running test") } @@ -189,7 +189,7 @@ func TestNew_collectorOnBadConnection(t *testing.T) { _ = exp.Shutdown(ctx) } -func TestNew_withEndpoint(t *testing.T) { +func TestNewWithEndpoint(t *testing.T) { mc := runMockCollector(t) t.Cleanup(func() { require.NoError(t, mc.stop()) }) @@ -198,7 +198,7 @@ func TestNew_withEndpoint(t *testing.T) { _ = exp.Shutdown(ctx) } -func TestNew_withHeaders(t *testing.T) { +func TestNewWithHeaders(t *testing.T) { mc := runMockCollector(t) t.Cleanup(func() { require.NoError(t, mc.stop()) }) @@ -238,7 +238,7 @@ func TestExportSpansTimeoutHonored(t *testing.T) { require.Equal(t, codes.DeadlineExceeded, status.Convert(err).Code()) } -func TestNew_withMultipleAttributeTypes(t *testing.T) { +func TestNewWithMultipleAttributeTypes(t *testing.T) { mc := runMockCollector(t) <-time.After(5 * time.Millisecond) diff --git a/exporters/stdout/stdouttrace/trace_test.go b/exporters/stdout/stdouttrace/trace_test.go index 1095cb5666c..77ceae2baeb 100644 --- a/exporters/stdout/stdouttrace/trace_test.go +++ b/exporters/stdout/stdouttrace/trace_test.go @@ -33,7 +33,7 @@ import ( "go.opentelemetry.io/otel/trace" ) -func TestExporter_ExportSpan(t *testing.T) { +func TestExporterExportSpan(t *testing.T) { // setup test span now := time.Now() traceID, _ := trace.TraceIDFromHex("0102030405060708090a0b0c0d0e0f10")