@@ -12,7 +12,6 @@ import (
1212 "fmt"
1313 "testing"
1414
15- "github.com/DataDog/dd-trace-go/v2/ddtrace/mocktracer"
1615 "github.com/DataDog/dd-trace-go/v2/ddtrace/tracer"
1716 "github.com/DataDog/dd-trace-go/v2/instrumentation/testutils/testtracer"
1817 "github.com/mark3labs/mcp-go/mcp"
@@ -21,14 +20,7 @@ import (
2120 "github.com/stretchr/testify/require"
2221)
2322
24- func TestNewToolHandlerMiddleware (t * testing.T ) {
25- mt := mocktracer .Start ()
26- defer mt .Stop ()
27-
28- middleware := NewToolHandlerMiddleware ()
29- assert .NotNil (t , middleware )
30- }
31-
23+ // Test tool spans are recorded on a successful tool call
3224func TestIntegrationToolCallSuccess (t * testing.T ) {
3325 tt := testTracer (t )
3426 defer tt .Stop ()
@@ -107,6 +99,7 @@ func TestIntegrationToolCallSuccess(t *testing.T) {
10799 assert .Contains (t , outputStr , "8" )
108100}
109101
102+ // Test recording of tool spans on a failed tool call
110103func TestIntegrationToolCallError (t * testing.T ) {
111104 tt := testTracer (t )
112105 defer tt .Stop ()
@@ -157,6 +150,8 @@ func TestIntegrationToolCallError(t *testing.T) {
157150 assert .Contains (t , toolSpan .Meta , "input" )
158151}
159152
153+ // Test helpers
154+
160155// testTracer creates a testtracer with LLMObs enabled for integration tests
161156func testTracer (t * testing.T , opts ... testtracer.Option ) * testtracer.TestTracer {
162157 defaultOpts := []testtracer.Option {
0 commit comments