mirror of
https://github.com/zeromicro/go-zero.git
synced 2026-05-07 15:10:01 +08:00
chore: upgrade go version (#4248)
Signed-off-by: kevin <wanjunfeng@gmail.com>
This commit is contained in:
@@ -7,6 +7,10 @@ import (
|
||||
"go.mongodb.org/mongo-driver/mongo/integration/mtest"
|
||||
)
|
||||
|
||||
func init() {
|
||||
_ = mtest.Setup()
|
||||
}
|
||||
|
||||
func TestClientManger_getClient(t *testing.T) {
|
||||
mt := mtest.New(t, mtest.NewOptions().ClientType(mtest.Mock))
|
||||
mt.Run("test", func(mt *mtest.T) {
|
||||
|
||||
@@ -5,6 +5,7 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"go.opentelemetry.io/otel"
|
||||
"go.opentelemetry.io/otel/attribute"
|
||||
"go.opentelemetry.io/otel/codes"
|
||||
"go.opentelemetry.io/otel/trace"
|
||||
@@ -13,8 +14,9 @@ import (
|
||||
)
|
||||
|
||||
func TestMessageType_Event(t *testing.T) {
|
||||
var span mockSpan
|
||||
ctx := trace.ContextWithSpan(context.Background(), &span)
|
||||
ctx, s := otel.Tracer(TraceName).Start(context.Background(), "test")
|
||||
span := mockSpan{Span: s}
|
||||
ctx = trace.ContextWithSpan(ctx, &span)
|
||||
MessageReceived.Event(ctx, 1, "foo")
|
||||
assert.Equal(t, messageEvent, span.name)
|
||||
assert.NotEmpty(t, span.options)
|
||||
@@ -30,6 +32,7 @@ func TestMessageType_EventProtoMessage(t *testing.T) {
|
||||
}
|
||||
|
||||
type mockSpan struct {
|
||||
trace.Span
|
||||
name string
|
||||
options []trace.EventOption
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user