@@ -33,11 +33,12 @@ func checkCtxLogger(ctx context.Context, t *testing.T, expParams map[string]any)
3333
3434func TestContextualLogger (t * testing.T ) {
3535 const pluginID = "plugin-id"
36- pCtx := & pluginv2.PluginContext {PluginId : pluginID }
36+ const pluginVersion = "1.0.0"
37+ pCtx := & pluginv2.PluginContext {PluginId : pluginID , PluginVersion : pluginVersion }
3738 t .Run ("DataSDKAdapter" , func (t * testing.T ) {
3839 run := make (chan struct {}, 1 )
3940 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 })
4142 run <- struct {}{}
4243 return NewQueryDataResponse (), nil
4344 })
@@ -57,7 +58,7 @@ func TestContextualLogger(t *testing.T) {
5758 t .Run ("DiagnosticsSDKAdapter" , func (t * testing.T ) {
5859 run := make (chan struct {}, 1 )
5960 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 })
6162 run <- struct {}{}
6263 return & CheckHealthResult {}, nil
6364 })
@@ -77,7 +78,7 @@ func TestContextualLogger(t *testing.T) {
7778 t .Run ("ResourceSDKAdapter" , func (t * testing.T ) {
7879 run := make (chan struct {}, 1 )
7980 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 })
8182 run <- struct {}{}
8283 return nil
8384 })
@@ -101,17 +102,17 @@ func TestContextualLogger(t *testing.T) {
101102 handlers := Handlers {
102103 StreamHandler : & streamAdapter {
103104 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 })
105106 subscribeStreamRun <- struct {}{}
106107 return & SubscribeStreamResponse {}, nil
107108 },
108109 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 })
110111 publishStreamRun <- struct {}{}
111112 return & PublishStreamResponse {}, nil
112113 },
113114 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 })
115116 runStreamRun <- struct {}{}
116117 return nil
117118 },
0 commit comments