You've already forked opentelemetry-go
mirror of
https://github.com/open-telemetry/opentelemetry-go.git
synced 2025-11-25 22:41:46 +02:00
Move trace sdk tests from trace_test into trace package (#6400)
I would like to be able to use a private option in https://github.com/open-telemetry/opentelemetry-go/pull/6393 in tests, and decided to split this refactoring out into its own PR. This moves the batch span processor benchmarks into benchmark_test.go, and replaces one instance of the tracetest.NewInMemoryExporter with a different test exporter implementation. It then moves most unit tests from `trace_test` to the main `trace` package.
This commit is contained in:
@@ -1,19 +1,17 @@
|
||||
// Copyright The OpenTelemetry Authors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
package trace_test
|
||||
package trace
|
||||
|
||||
import (
|
||||
"context"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
sdktrace "go.opentelemetry.io/otel/sdk/trace"
|
||||
)
|
||||
|
||||
func basicTracerProvider(t *testing.T) *sdktrace.TracerProvider {
|
||||
tp := sdktrace.NewTracerProvider(sdktrace.WithSampler(sdktrace.AlwaysSample()))
|
||||
func basicTracerProvider(t *testing.T) *TracerProvider {
|
||||
tp := NewTracerProvider(WithSampler(AlwaysSample()))
|
||||
t.Cleanup(func() {
|
||||
assert.NoError(t, tp.Shutdown(context.Background()))
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user