1
0
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:
David Ashpole
2025-03-04 21:29:11 -05:00
committed by GitHub
parent 38f4f39284
commit e2aee3aff8
5 changed files with 147 additions and 171 deletions

View File

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