tianxiaoliang commented on a change in pull request #1047:
URL: 
https://github.com/apache/servicecomb-service-center/pull/1047#discussion_r651704722



##########
File path: datasource/mongo/sd/instancec_test.go
##########
@@ -83,3 +84,72 @@ func TestInstCacheBasicFunc(t *testing.T) {
                assert.Len(t, instanceCache.cache.GetValue("svcid"), 0)
        })
 }
+
+func TestInstValueUpdate(t *testing.T) {
+       inst1 := model.Instance{
+               Domain:      "d1",
+               Project:     "p1",
+               RefreshTime: time.Time{},
+               Instance: &discovery.MicroServiceInstance{
+                       InstanceId: "123",
+                       Version:    "1.0",
+               },
+       }
+       inst2 := model.Instance{
+               Domain:      "d1",
+               Project:     "p1",
+               RefreshTime: time.Time{},
+               Instance: &discovery.MicroServiceInstance{
+                       InstanceId: "123",
+                       Version:    "1.0",
+               },
+       }
+       inst3 := model.Instance{
+               Domain:      "d2",
+               Project:     "p2",
+               RefreshTime: time.Time{},
+               Instance: &discovery.MicroServiceInstance{
+                       InstanceId: "123",
+                       Version:    "1.0",
+               },
+       }
+       inst4 := model.Instance{
+               Domain:      "d2",
+               Project:     "p2",
+               RefreshTime: time.Time{},
+               Instance: &discovery.MicroServiceInstance{
+                       InstanceId: "123",
+                       Version:    "1.1",
+               },
+       }
+       inst5 := model.Instance{
+               Domain:      "d2",
+               Project:     "p2",
+               RefreshTime: time.Now(),
+               Instance: &discovery.MicroServiceInstance{
+                       InstanceId: "123",
+                       Version:    "1.1",
+               },
+       }
+       var InstTests = []struct {
+               in       []interface{}
+               expected bool
+       }{
+               {in: []interface{}{inst1, inst2},

Review comment:
       可能gotests工具版本和别人不同?没有test case 名字




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to