diff --git a/smi-conformance/conformance/conformance.pb.go b/smi-conformance/conformance/conformance.pb.go index bc50031..34d9028 100644 --- a/smi-conformance/conformance/conformance.pb.go +++ b/smi-conformance/conformance/conformance.pb.go @@ -110,6 +110,8 @@ type Detail struct { Assertions string `protobuf:"bytes,3,opt,name=assertions,proto3" json:"assertions,omitempty"` Result string `protobuf:"bytes,4,opt,name=result,proto3" json:"result,omitempty"` Reason string `protobuf:"bytes,5,opt,name=reason,proto3" json:"reason,omitempty"` + Capability string `protobuf:"bytes,6,opt,name=capability,proto3" json:"capability,omitempty"` + Status string `protobuf:"bytes,7,opt,name=status,proto3" json:"status,omitempty"` } func (x *Detail) Reset() { @@ -179,15 +181,28 @@ func (x *Detail) GetReason() string { return "" } +func (x *Detail) GetCapability() string { + if x != nil { + return x.Capability + } + return "" +} + +func (x *Detail) GetStatus() string { + if x != nil { + return x.Status + } + return "" +} + type Response struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Capability string `protobuf:"bytes,1,opt,name=capability,proto3" json:"capability,omitempty"` + Passpercent string `protobuf:"bytes,1,opt,name=passpercent,proto3" json:"passpercent,omitempty"` Casespassed string `protobuf:"bytes,2,opt,name=casespassed,proto3" json:"casespassed,omitempty"` - Status string `protobuf:"bytes,3,opt,name=status,proto3" json:"status,omitempty"` - Details []*Detail `protobuf:"bytes,4,rep,name=details,proto3" json:"details,omitempty"` + Details []*Detail `protobuf:"bytes,3,rep,name=details,proto3" json:"details,omitempty"` } func (x *Response) Reset() { @@ -222,9 +237,9 @@ func (*Response) Descriptor() ([]byte, []int) { return file_conformance_conformance_proto_rawDescGZIP(), []int{2} } -func (x *Response) GetCapability() string { +func (x *Response) GetPasspercent() string { if x != nil { - return x.Capability + return x.Passpercent } return "" } @@ -236,13 +251,6 @@ func (x *Response) GetCasespassed() string { return "" } -func (x *Response) GetStatus() string { - if x != nil { - return x.Status - } - return "" -} - func (x *Response) GetDetails() []*Detail { if x != nil { return x.Details @@ -277,7 +285,7 @@ var file_conformance_conformance_proto_rawDesc = []byte{ 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, - 0x22, 0x86, 0x01, 0x0a, 0x06, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x12, 0x18, 0x0a, 0x07, 0x73, + 0x22, 0xbe, 0x01, 0x0a, 0x06, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x6d, 0x69, 0x73, 0x70, 0x65, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x6d, 0x69, 0x73, 0x70, 0x65, 0x63, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x61, 0x73, 0x73, @@ -285,24 +293,26 @@ var file_conformance_conformance_proto_rawDesc = []byte{ 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x22, 0x97, 0x01, 0x0a, 0x08, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x61, 0x70, 0x61, 0x62, 0x69, - 0x6c, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x61, 0x70, 0x61, - 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x61, 0x73, 0x65, 0x73, 0x70, - 0x61, 0x73, 0x73, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x61, 0x73, - 0x65, 0x73, 0x70, 0x61, 0x73, 0x73, 0x65, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x12, 0x31, 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x17, 0x2e, 0x73, 0x6d, 0x69, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, - 0x6e, 0x63, 0x65, 0x2e, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x07, 0x64, 0x65, 0x74, 0x61, - 0x69, 0x6c, 0x73, 0x32, 0x54, 0x0a, 0x12, 0x63, 0x6f, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x6e, - 0x63, 0x65, 0x54, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x3e, 0x0a, 0x07, 0x52, 0x75, 0x6e, - 0x54, 0x65, 0x73, 0x74, 0x12, 0x18, 0x2e, 0x73, 0x6d, 0x69, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x6f, - 0x72, 0x6d, 0x61, 0x6e, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, - 0x2e, 0x73, 0x6d, 0x69, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x6e, 0x63, 0x65, - 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x19, 0x5a, 0x17, 0x63, 0x6f, 0x6e, - 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x6e, 0x63, 0x65, 0x3b, 0x63, 0x6f, 0x6e, 0x66, 0x6f, 0x72, 0x6d, - 0x61, 0x6e, 0x63, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x09, 0x52, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x61, 0x70, + 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, + 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x22, 0x81, 0x01, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x20, + 0x0a, 0x0b, 0x70, 0x61, 0x73, 0x73, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x61, 0x73, 0x73, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, + 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x61, 0x73, 0x65, 0x73, 0x70, 0x61, 0x73, 0x73, 0x65, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x61, 0x73, 0x65, 0x73, 0x70, 0x61, 0x73, 0x73, + 0x65, 0x64, 0x12, 0x31, 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x03, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x73, 0x6d, 0x69, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x6f, 0x72, + 0x6d, 0x61, 0x6e, 0x63, 0x65, 0x2e, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x07, 0x64, 0x65, + 0x74, 0x61, 0x69, 0x6c, 0x73, 0x32, 0x54, 0x0a, 0x12, 0x63, 0x6f, 0x6e, 0x66, 0x6f, 0x72, 0x6d, + 0x61, 0x6e, 0x63, 0x65, 0x54, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x3e, 0x0a, 0x07, 0x52, + 0x75, 0x6e, 0x54, 0x65, 0x73, 0x74, 0x12, 0x18, 0x2e, 0x73, 0x6d, 0x69, 0x5f, 0x63, 0x6f, 0x6e, + 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x6e, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x19, 0x2e, 0x73, 0x6d, 0x69, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x6e, + 0x63, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x19, 0x5a, 0x17, 0x63, + 0x6f, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x6e, 0x63, 0x65, 0x3b, 0x63, 0x6f, 0x6e, 0x66, 0x6f, + 0x72, 0x6d, 0x61, 0x6e, 0x63, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/smi-conformance/conformance/conformance.proto b/smi-conformance/conformance/conformance.proto index 5d85491..6a8fdfc 100644 --- a/smi-conformance/conformance/conformance.proto +++ b/smi-conformance/conformance/conformance.proto @@ -16,10 +16,12 @@ message Detail { string assertions = 3; string result = 4; string reason = 5; + string capability = 6; + string status = 7; } message Response { - string capability = 1; + string passpercent = 1; string casespassed = 2; repeated Detail details = 3; } diff --git a/smi-conformance/grpc/handlers.go b/smi-conformance/grpc/handlers.go index 6254301..0422562 100644 --- a/smi-conformance/grpc/handlers.go +++ b/smi-conformance/grpc/handlers.go @@ -60,18 +60,25 @@ func (s *Service) RunTest(ctx context.Context, req *conformance.Request) (*confo Smispec: res.Name, Time: res.Time, Assertions: strconv.Itoa(res.Assertions), + Capability: "Full", + Status: "Passing", } if len(res.Failure.Text) > 2 { d.Reason = res.Failure.Text d.Result = res.Failure.Message + d.Status = "Failing" + d.Capability = "None" failures += 1 + if (res.Assertions - failures) > (res.Assertions / 2) { + d.Capability = "Half" + } } details = append(details, d) } return &conformance.Response{ Casespassed: strconv.Itoa(totalcases - failures), - Capability: strconv.Itoa(((totalcases - failures) / totalcases) * 100), + Passpercent: strconv.Itoa(((totalcases - failures) / totalcases) * 100), Details: details, }, nil } diff --git a/smi-conformance/test-gen/test_gen.go b/smi-conformance/test-gen/test_gen.go index 2f3d76a..0babd47 100644 --- a/smi-conformance/test-gen/test_gen.go +++ b/smi-conformance/test-gen/test_gen.go @@ -50,16 +50,15 @@ func RunTest(meshConfig ServiceMesh, annotations, labels map[string]string) Resu // Run only traffic-split // testToRun := "traffic-split" - startKIND := false options := harness.TestSuite{} args := []string{"./test-yamls/"} options.TestDirs = args - options.Timeout = 300 + options.Timeout = 120 options.Parallel = 1 options.TestDirs = manifestDirs - options.StartKIND = startKIND + options.StartKIND = false options.SkipDelete = false if options.KINDContext == "" {