aboutsummaryrefslogtreecommitdiff
path: root/internal/tracing_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/tracing_test.go')
-rw-r--r--internal/tracing_test.go25
1 files changed, 25 insertions, 0 deletions
diff --git a/internal/tracing_test.go b/internal/tracing_test.go
new file mode 100644
index 00000000..582f50c3
--- /dev/null
+++ b/internal/tracing_test.go
@@ -0,0 +1,25 @@
+package internal
+
+import (
+ "context"
+ "testing"
+
+ "github.com/stretchr/testify/assert"
+)
+
+func TestTracing(t *testing.T) {
+ inCtx := context.Background()
+
+ task, ctx := StartTask(inCtx, "testing")
+ assert.NotNil(t, ctx)
+ assert.NotNil(t, task)
+ assert.NotEqual(t, inCtx, ctx)
+ task.SetTag("key", "value")
+
+ region, ctx2 := StartRegion(ctx, "testing")
+ assert.NotNil(t, ctx)
+ assert.NotNil(t, region)
+ assert.NotEqual(t, ctx, ctx2)
+ defer task.EndTask()
+ defer region.EndRegion()
+}