1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2024-12-04 09:43:23 +02:00

Discard error in trace testing

This commit is contained in:
Tyler Yahn 2020-06-02 13:33:19 -07:00
parent e73d119d6c
commit 50f0f85c79
No known key found for this signature in database
GPG Key ID: 42AA23B0BC85B798

View File

@ -24,6 +24,7 @@ import (
"testing"
"time"
"go.opentelemetry.io/otel/api/global"
"go.opentelemetry.io/otel/api/kv/value"
"github.com/google/go-cmp/cmp"
@ -43,9 +44,15 @@ var (
sid apitrace.SpanID
)
type discardHandler struct{}
func (*discardHandler) Handle(_ error) {}
func init() {
tid, _ = apitrace.IDFromHex("01020304050607080102040810203040")
sid, _ = apitrace.SpanIDFromHex("0102040810203040")
global.SetHandler(new(discardHandler))
}
func TestTracerFollowsExpectedAPIBehaviour(t *testing.T) {