Skip to content

Commit b7e563e

Browse files
committed
Fix the errors in ci
1 parent 0535d88 commit b7e563e

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

apiv2/internal/server/site_test.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,7 @@ func TestSite_Get(t *testing.T) {
156156
},
157157
},
158158
RenderedMetadata: &inventory.GetResourceResponse_ResourceMetadata{
159-
PhyMetadata: `[{"key":"environment","value":"production"},
160-
{"key":"location","value":"datacenter-1"}]`,
159+
PhyMetadata: `[{"label":{"key":"environment","value":"production"}},{"label":{"key":"location","value":"datacenter-1"}}]`,
161160
},
162161
}, nil).Once(),
163162
}
@@ -234,8 +233,7 @@ func TestSite_List(t *testing.T) {
234233
},
235234
},
236235
RenderedMetadata: &inventory.GetResourceResponse_ResourceMetadata{
237-
PhyMetadata: `[{"key":"environment","value":"production"},
238-
{"key":"location","value":"datacenter-1"}]`,
236+
PhyMetadata: `[{"label":{"key":"environment","value":"production"}},{"label":{"key":"location","value":"datacenter-1"}}]`,
239237
},
240238
},
241239
},

apiv2/internal/server/utils_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ func compareProtoMessages(t *testing.T, msg1, msg2 proto.Message) {
3333
continue
3434
}
3535

36-
if field1.Kind() == reflect.Struct {
36+
// Handle embedded structs and interfaces by comparing their fields recursively.
37+
// Special case of oneof fields in protobuf messages
38+
if field1.Kind() == reflect.Struct || field1.Kind() == reflect.Interface {
3739
// Handle embedded structs by comparing their fields recursively
3840
if field1.CanInterface() && field2.CanInterface() {
3941
// Try to convert to proto.Message first

tenant-controller/internal/testing/testing_utils.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// SPDX-License-Identifier: Apache-2.0
44

5-
package testing //nolint:revive // this package is used for testing and should not be imported by other packages
5+
package testing //nolint:revive,nolintlint // this package is used for testing and should not be imported by other packages
66

77
import (
88
"os"

0 commit comments

Comments
 (0)