77 empty "github.com/golang/protobuf/ptypes/empty"
88 "github.com/layer5io/learn-layer5/smi-conformance/conformance"
99 test_gen "github.com/layer5io/learn-layer5/smi-conformance/test-gen"
10- common "github.com/layer5io/service-mesh-performance/common"
11- controller "github.com/layer5io/service-mesh-performance/controller"
10+ service "github.com/layer5io/service-mesh-performance/service"
1211 smp "github.com/layer5io/service-mesh-performance/spec"
1312)
1413
@@ -65,20 +64,20 @@ func (s *Service) RunTest(ctx context.Context, req *conformance.Request) (*confo
6564 d := & conformance.Detail {
6665 Smispec : res .Name ,
6766 Specversion : "v1alpha1" ,
68- Duration : res .Time ,
6967 Assertion : strconv .Itoa (res .Assertions ),
70- // Capability: conformance.Capability(conformance.Capability_FULL),
71- Status : conformance .ResultStatus (conformance .ResultStatus_PASSED ),
68+ Duration : res .Time ,
69+ Capability : conformance .Capability_FULL ,
70+ Status : conformance .ResultStatus_PASSED ,
7271 Result : & conformance.Result {
7372 Result : & conformance.Result_Message {
74- Message : "" ,
73+ Message : "All test passed " ,
7574 },
7675 },
7776 }
7877 if len (res .Failure .Text ) > 2 {
7978 d .Result = & conformance.Result {
8079 Result : & conformance.Result_Error {
81- Error : & common .CommonError {
80+ Error : & service .CommonError {
8281 Code : "" ,
8382 Severity : "" ,
8483 ShortDescription : res .Failure .Text ,
@@ -88,35 +87,28 @@ func (s *Service) RunTest(ctx context.Context, req *conformance.Request) (*confo
8887 },
8988 },
9089 }
91- d .Status = conformance .ResultStatus ( conformance . ResultStatus_FAILED )
92- // d.Capability = "None"
90+ d .Status = conformance .ResultStatus_FAILED
91+ d .Capability = conformance . Capability_NONE
9392 failures += 1
9493 if (res .Assertions - failures ) > (res .Assertions / 2 ) {
95- // d.Capability = "Half"
94+ d .Capability = conformance . Capability_HALF
9695 }
9796 }
9897 details = append (details , d )
9998 }
100- capability := conformance .Capability_NONE
101- if totalcases - failures > totalcases / 2 {
102- capability = conformance .Capability_HALF
103- } else if failures == 0 {
104- capability = conformance .Capability_FULL
105- }
10699
107100 return & conformance.Response {
108101 Casespassed : strconv .Itoa (totalcases - failures ),
109102 Passpercent : strconv .Itoa (((totalcases - failures ) / totalcases ) * 100 ),
110- Details : details ,
111103 Mesh : req .Mesh ,
112- Capability : capability ,
104+ Details : details ,
113105 }, nil
114106}
115107
116- func (s * Service ) Info (context.Context , * empty.Empty ) (* controller. ControllerInfo , error ) {
117- return & controller. ControllerInfo {}, nil
108+ func (s * Service ) Info (context.Context , * empty.Empty ) (* service. ServiceInfo , error ) {
109+ return & service. ServiceInfo {}, nil
118110}
119111
120- func (s * Service ) Health (context.Context , * empty.Empty ) (* controller. ControllerHealth , error ) {
121- return & controller. ControllerHealth {}, nil
112+ func (s * Service ) Health (context.Context , * empty.Empty ) (* service. ServiceHealth , error ) {
113+ return & service. ServiceHealth {}, nil
122114}
0 commit comments