Skip to content

Commit

Permalink
Rename all test funcs that mix camel and snake (#2788)
Browse files Browse the repository at this point in the history
Unify on Go standard camel case naming.

Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>
  • Loading branch information
MrAlias and hanyuancheung authored Apr 15, 2022
1 parent ff0857a commit 0f3ab76
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion bridge/opentracing/mix_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{}
Expand Down
2 changes: 1 addition & 1 deletion exporters/jaeger/jaeger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
12 changes: 6 additions & 6 deletions exporters/otlp/otlpmetric/otlpmetricgrpc/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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")
}
Expand All @@ -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()
Expand All @@ -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()
Expand All @@ -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
Expand Down
12 changes: 6 additions & 6 deletions exporters/otlp/otlptrace/otlptracegrpc/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()) })

Expand All @@ -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")
}
Expand All @@ -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()) })

Expand All @@ -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()) })

Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion exporters/stdout/stdouttrace/trace_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 0f3ab76

Please sign in to comment.