@@ -32,7 +32,7 @@ func TestDisabled(t *testing.T) {
32
32
if err != nil {
33
33
t .Fatalf ("MockSQL failed with unexpected error: %s" , err )
34
34
}
35
- db := DB {DB : mockDB , options : core.CommenterOptions {}}
35
+ db := DB {DB : mockDB , driverName : "mocksql" , options : core.CommenterOptions {}}
36
36
query := "SELECT 2"
37
37
if got , want := db .withComment (context .Background (), query ), query ; got != want {
38
38
t .Errorf ("db.withComment(context.Background(), %q) = %q, want = %q" , query , got , want )
@@ -45,15 +45,15 @@ func TestHTTP_Net(t *testing.T) {
45
45
t .Fatalf ("MockSQL failed with unexpected error: %s" , err )
46
46
}
47
47
48
- db := DB {DB : mockDB , options : core.CommenterOptions {EnableDBDriver : true , EnableRoute : true , EnableFramework : true }}
48
+ db := DB {DB : mockDB , driverName : "mocksql" , options : core.CommenterOptions {EnableDBDriver : true , EnableRoute : true , EnableFramework : true }}
49
49
r , err := http .NewRequest ("GET" , "hello/1" , nil )
50
50
if err != nil {
51
51
t .Errorf ("http.NewRequest('GET', 'hello/1', nil) returned unexpected error: %v" , err )
52
52
}
53
53
54
54
ctx := core .ContextInject (r .Context (), httpnet .NewHTTPRequestExtractor (r , nil ))
55
55
got := db .withComment (ctx , "Select 1" )
56
- want := "Select 1/*driver=database%2Fsql,framework=net%2Fhttp,route=hello%2F1*/"
56
+ want := "Select 1/*driver=database%2Fsql%3Amocksql ,framework=net%2Fhttp,route=hello%2F1*/"
57
57
if got != want {
58
58
t .Errorf ("db.withComment(ctx, 'Select 1') got %q, wanted %q" , got , want )
59
59
}
@@ -65,9 +65,9 @@ func TestQueryWithSemicolon(t *testing.T) {
65
65
t .Fatalf ("MockSQL failed with unexpected error: %s" , err )
66
66
}
67
67
68
- db := DB {DB : mockDB , options : core.CommenterOptions {EnableDBDriver : true }}
68
+ db := DB {DB : mockDB , driverName : "mocksql" , options : core.CommenterOptions {EnableDBDriver : true }}
69
69
got := db .withComment (context .Background (), "Select 1;" )
70
- want := "Select 1/*driver=database%2Fsql*/;"
70
+ want := "Select 1/*driver=database%2Fsql%3Amocksql */;"
71
71
if got != want {
72
72
t .Errorf ("db.withComment(context.Background(), 'Select 1;') got %q, wanted %q" , got , want )
73
73
}
@@ -79,7 +79,7 @@ func TestOtelIntegration(t *testing.T) {
79
79
t .Fatalf ("MockSQL failed with unexpected error: %s" , err )
80
80
}
81
81
82
- db := DB {DB : mockDB , options : core.CommenterOptions {EnableTraceparent : true }}
82
+ db := DB {DB : mockDB , driverName : "mocksql" , options : core.CommenterOptions {EnableTraceparent : true }}
83
83
exp , _ := stdouttrace .New (stdouttrace .WithPrettyPrint ())
84
84
bsp := sdktrace .NewSimpleSpanProcessor (exp ) // You should use batch span processor in prod
85
85
tp := sdktrace .NewTracerProvider (
0 commit comments