@@ -33,11 +33,12 @@ func checkCtxLogger(ctx context.Context, t *testing.T, expParams map[string]any)
33
33
34
34
func TestContextualLogger (t * testing.T ) {
35
35
const pluginID = "plugin-id"
36
- pCtx := & pluginv2.PluginContext {PluginId : pluginID }
36
+ const pluginVersion = "1.0.0"
37
+ pCtx := & pluginv2.PluginContext {PluginId : pluginID , PluginVersion : pluginVersion }
37
38
t .Run ("DataSDKAdapter" , func (t * testing.T ) {
38
39
run := make (chan struct {}, 1 )
39
40
handler := QueryDataHandlerFunc (func (ctx context.Context , _ * QueryDataRequest ) (* QueryDataResponse , error ) {
40
- checkCtxLogger (ctx , t , map [string ]any {"endpoint" : "queryData" , "pluginId" : pluginID })
41
+ checkCtxLogger (ctx , t , map [string ]any {"endpoint" : "queryData" , "pluginId" : pluginID , "pluginVersion" : pluginVersion })
41
42
run <- struct {}{}
42
43
return NewQueryDataResponse (), nil
43
44
})
@@ -57,7 +58,7 @@ func TestContextualLogger(t *testing.T) {
57
58
t .Run ("DiagnosticsSDKAdapter" , func (t * testing.T ) {
58
59
run := make (chan struct {}, 1 )
59
60
handler := CheckHealthHandlerFunc (func (ctx context.Context , _ * CheckHealthRequest ) (* CheckHealthResult , error ) {
60
- checkCtxLogger (ctx , t , map [string ]any {"endpoint" : "checkHealth" , "pluginId" : pluginID })
61
+ checkCtxLogger (ctx , t , map [string ]any {"endpoint" : "checkHealth" , "pluginId" : pluginID , "pluginVersion" : pluginVersion })
61
62
run <- struct {}{}
62
63
return & CheckHealthResult {}, nil
63
64
})
@@ -77,7 +78,7 @@ func TestContextualLogger(t *testing.T) {
77
78
t .Run ("ResourceSDKAdapter" , func (t * testing.T ) {
78
79
run := make (chan struct {}, 1 )
79
80
handler := CallResourceHandlerFunc (func (ctx context.Context , _ * CallResourceRequest , _ CallResourceResponseSender ) error {
80
- checkCtxLogger (ctx , t , map [string ]any {"endpoint" : "callResource" , "pluginId" : pluginID })
81
+ checkCtxLogger (ctx , t , map [string ]any {"endpoint" : "callResource" , "pluginId" : pluginID , "pluginVersion" : pluginVersion })
81
82
run <- struct {}{}
82
83
return nil
83
84
})
@@ -101,17 +102,17 @@ func TestContextualLogger(t *testing.T) {
101
102
handlers := Handlers {
102
103
StreamHandler : & streamAdapter {
103
104
subscribeStreamFunc : func (ctx context.Context , _ * SubscribeStreamRequest ) (* SubscribeStreamResponse , error ) {
104
- checkCtxLogger (ctx , t , map [string ]any {"endpoint" : "subscribeStream" , "pluginId" : pluginID })
105
+ checkCtxLogger (ctx , t , map [string ]any {"endpoint" : "subscribeStream" , "pluginId" : pluginID , "pluginVersion" : pluginVersion })
105
106
subscribeStreamRun <- struct {}{}
106
107
return & SubscribeStreamResponse {}, nil
107
108
},
108
109
publishStreamFunc : func (ctx context.Context , _ * PublishStreamRequest ) (* PublishStreamResponse , error ) {
109
- checkCtxLogger (ctx , t , map [string ]any {"endpoint" : "publishStream" , "pluginId" : pluginID })
110
+ checkCtxLogger (ctx , t , map [string ]any {"endpoint" : "publishStream" , "pluginId" : pluginID , "pluginVersion" : pluginVersion })
110
111
publishStreamRun <- struct {}{}
111
112
return & PublishStreamResponse {}, nil
112
113
},
113
114
runStreamFunc : func (ctx context.Context , _ * RunStreamRequest , _ * StreamSender ) error {
114
- checkCtxLogger (ctx , t , map [string ]any {"endpoint" : "runStream" , "pluginId" : pluginID })
115
+ checkCtxLogger (ctx , t , map [string ]any {"endpoint" : "runStream" , "pluginId" : pluginID , "pluginVersion" : pluginVersion })
115
116
runStreamRun <- struct {}{}
116
117
return nil
117
118
},
0 commit comments