2020-03-23 22:41:10 -07:00
|
|
|
// Copyright The OpenTelemetry Authors
|
2024-02-29 07:05:28 +01:00
|
|
|
// SPDX-License-Identifier: Apache-2.0
|
2019-07-02 16:21:24 -07:00
|
|
|
|
2025-03-04 21:29:11 -05:00
|
|
|
package trace
|
2019-07-02 16:21:24 -07:00
|
|
|
|
|
|
|
|
import (
|
2025-02-26 23:32:15 +01:00
|
|
|
"context"
|
2019-07-02 16:21:24 -07:00
|
|
|
"testing"
|
2019-10-22 13:19:11 -07:00
|
|
|
|
2025-02-26 23:32:15 +01:00
|
|
|
"github.com/stretchr/testify/assert"
|
2019-07-02 16:21:24 -07:00
|
|
|
)
|
|
|
|
|
|
2025-03-04 21:29:11 -05:00
|
|
|
func basicTracerProvider(t *testing.T) *TracerProvider {
|
|
|
|
|
tp := NewTracerProvider(WithSampler(AlwaysSample()))
|
2025-02-26 23:32:15 +01:00
|
|
|
t.Cleanup(func() {
|
|
|
|
|
assert.NoError(t, tp.Shutdown(context.Background()))
|
|
|
|
|
})
|
2019-10-22 13:19:11 -07:00
|
|
|
return tp
|
2019-07-02 16:21:24 -07:00
|
|
|
}
|