[ https://issues.apache.org/jira/browse/SCB-1070?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16710150#comment-16710150 ]
ASF GitHub Bot commented on SCB-1070: ------------------------------------- little-cui closed pull request #507: SCB-1070 New instance 'TESTING' status URL: https://github.com/apache/servicecomb-service-center/pull/507 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/server/core/proto/common.go b/server/core/proto/common.go index c7c5eccf..f21dcf5f 100644 --- a/server/core/proto/common.go +++ b/server/core/proto/common.go @@ -32,6 +32,7 @@ const ( MSI_UP string = "UP" MSI_DOWN string = "DOWN" MSI_STARTING string = "STARTING" + MSI_TESTING string = "TESTING" MSI_OUTOFSERVICE string = "OUTOFSERVICE" CHECK_BY_HEARTBEAT string = "push" diff --git a/server/service/instance_test.go b/server/service/instance_test.go index 3b67e018..25b654fa 100644 --- a/server/service/instance_test.go +++ b/server/service/instance_test.go @@ -620,11 +620,43 @@ var _ = Describe("'Instance' service", func() { It("should be passed", func() { By("update instance status") respUpdateStatus, err := instanceResource.UpdateStatus(getContext(), &pb.UpdateInstanceStatusRequest{ + ServiceId: serviceId, + InstanceId: instanceId, + Status: pb.MSI_DOWN, + }) + Expect(err).To(BeNil()) + Expect(respUpdateStatus.Response.Code).To(Equal(pb.Response_SUCCESS)) + + respUpdateStatus, err = instanceResource.UpdateStatus(getContext(), &pb.UpdateInstanceStatusRequest{ + ServiceId: serviceId, + InstanceId: instanceId, + Status: pb.MSI_OUTOFSERVICE, + }) + Expect(err).To(BeNil()) + Expect(respUpdateStatus.Response.Code).To(Equal(pb.Response_SUCCESS)) + + respUpdateStatus, err = instanceResource.UpdateStatus(getContext(), &pb.UpdateInstanceStatusRequest{ ServiceId: serviceId, InstanceId: instanceId, Status: pb.MSI_STARTING, }) + Expect(err).To(BeNil()) + Expect(respUpdateStatus.Response.Code).To(Equal(pb.Response_SUCCESS)) + + respUpdateStatus, err = instanceResource.UpdateStatus(getContext(), &pb.UpdateInstanceStatusRequest{ + ServiceId: serviceId, + InstanceId: instanceId, + Status: pb.MSI_TESTING, + }) + + Expect(err).To(BeNil()) + Expect(respUpdateStatus.Response.Code).To(Equal(pb.Response_SUCCESS)) + respUpdateStatus, err = instanceResource.UpdateStatus(getContext(), &pb.UpdateInstanceStatusRequest{ + ServiceId: serviceId, + InstanceId: instanceId, + Status: pb.MSI_UP, + }) Expect(err).To(BeNil()) Expect(respUpdateStatus.Response.Code).To(Equal(pb.Response_SUCCESS)) diff --git a/server/service/instance_validator.go b/server/service/instance_validator.go index cf7a1dfb..bebb2c31 100644 --- a/server/service/instance_validator.go +++ b/server/service/instance_validator.go @@ -36,9 +36,9 @@ var ( var ( instStatusRegex, _ = regexp.Compile("^(" + util.StringJoin([]string{ - pb.MSI_UP, pb.MSI_DOWN, pb.MSI_STARTING, pb.MSI_OUTOFSERVICE}, "|") + ")?$") + pb.MSI_UP, pb.MSI_DOWN, pb.MSI_STARTING, pb.MSI_TESTING, pb.MSI_OUTOFSERVICE}, "|") + ")?$") updateInstStatusRegex, _ = regexp.Compile("^(" + util.StringJoin([]string{ - pb.MSI_UP, pb.MSI_DOWN, pb.MSI_STARTING, pb.MSI_OUTOFSERVICE}, "|") + ")$") + pb.MSI_UP, pb.MSI_DOWN, pb.MSI_STARTING, pb.MSI_TESTING, pb.MSI_OUTOFSERVICE}, "|") + ")$") hbModeRegex, _ = regexp.Compile(`^(push|pull)$`) urlRegex, _ = regexp.Compile(`^\S*$`) epRegex, _ = regexp.Compile(`\S+`) ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on 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 > New instance 'TESTING' status > ----------------------------- > > Key: SCB-1070 > URL: https://issues.apache.org/jira/browse/SCB-1070 > Project: Apache ServiceComb > Issue Type: Improvement > Components: Service-Center > Reporter: little-cui > Assignee: little-cui > Priority: Major > Fix For: service-center-1.2.0 > > -- This message was sent by Atlassian JIRA (v7.6.3#76005)