From d7fa90f843acc228ae5884bd5b129fbb74db2695 Mon Sep 17 00:00:00 2001 From: kumarabd Date: Thu, 6 Aug 2020 19:30:59 +0530 Subject: [PATCH] modified smi-conformance build Signed-off-by: kumarabd --- .github/workflows/ci.yml | 8 +- deploy/maesh.yaml | 8 +- smi-conformance/Dockerfile | 7 +- smi-conformance/conformance/conformance.pb.go | 164 ++++++++++++++---- smi-conformance/conformance/conformance.proto | 19 +- smi-conformance/go.mod | 1 + smi-conformance/grpc/handlers.go | 17 +- smi-conformance/test-gen/test_gen.go | 49 +++--- 8 files changed, 193 insertions(+), 80 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 44a8924..4f3cfb1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,15 +25,21 @@ jobs: with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - - name: Docker build & push + - name: Docker build & push services if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master') && success() run: | cd service && docker build --no-cache -t ${{ secrets.IMAGE_NAME }} . docker tag ${{ secrets.IMAGE_NAME }}:latest ${{ secrets.IMAGE_NAME }}:${GITHUB_SHA::6} docker push ${{ secrets.IMAGE_NAME }}:latest docker push ${{ secrets.IMAGE_NAME }}:${GITHUB_SHA::6} + cd ../smi-conformance && docker build --no-cache -t smi-conformance:latest . + docker tag smi-conformance:latest smi-conformance:${GITHUB_SHA::6} + docker push smi-conformance:latest + docker push smi-conformance:${GITHUB_SHA::6} - name: Docker tag release & push if: github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') && success() run: | docker tag ${{ secrets.IMAGE_NAME }}:latest ${{ secrets.IMAGE_NAME }}:${GITHUB_REF/refs\/tags\//} docker push ${{ secrets.IMAGE_NAME }}:${GITHUB_REF/refs\/tags\//} + docker tag smi-conformance:latest smi-conformance:${GITHUB_REF/refs\/tags\//} + docker push smi-conformance:${GITHUB_REF/refs\/tags\//} diff --git a/deploy/maesh.yaml b/deploy/maesh.yaml index 38baab6..8901819 100644 --- a/deploy/maesh.yaml +++ b/deploy/maesh.yaml @@ -97,11 +97,11 @@ mesh: # Tracing configuration. # tracing: - deploy: true + deploy: false jaeger: image: name: groundnuty/k8s-wait-for:v1.3 - enabled: true + enabled: false localagenthostport: "" samplingserverurl: "" # datadog: @@ -142,10 +142,10 @@ tracing: # Metrics configuration. # metrics: - deploy: true + deploy: false prometheus: # whether to expose Prometheus metrics - enabled: true + enabled: false ## you can override values of the metrics subchart here. ## check charts/metrics/values.yaml for the defaults. ## example: diff --git a/smi-conformance/Dockerfile b/smi-conformance/Dockerfile index db23cb8..eff2775 100644 --- a/smi-conformance/Dockerfile +++ b/smi-conformance/Dockerfile @@ -1,20 +1,21 @@ FROM golang:1.14-alpine3.11 as build-img LABEL maintainer "Layer5.io" -ENV GO111MODULE=off RUN apk update && apk add --no-cache git libc-dev gcc pkgconf && mkdir /home/meshery COPY ${PWD} /go/src/github.com/layer5io/learn-layer5/smi-conformance/ WORKDIR /go/src/github.com/layer5io/learn-layer5/smi-conformance/ # RUN git rev-parse HEAD > /home/meshery/version # RUN git describe --tags `git rev-list --tags --max-count=1` >> /home/com/version - RUN go mod vendor && go build -a -ldflags "-s -w" -o /home/meshery/smi_conformance main.go FROM alpine:latest -RUN apk --no-cache add ca-certificates +RUN apk --no-cache add ca-certificates && mkdir /home/test-yamls && mkdir /home/test-yamls/traffic-access && mkdir /home/test-yamls/traffic-spec && mkdir /home/test-yamls/traffic-split COPY --from=build-img /home/meshery/** /home/ +COPY --from=build-img /go/src/github.com/layer5io/learn-layer5/smi-conformance/test-gen/test-yamls/traffic-access/** /home/test-yamls/traffic-access/ +COPY --from=build-img /go/src/github.com/layer5io/learn-layer5/smi-conformance/test-gen/test-yamls/test-split/** /home/test-yamls/traffic-split/ +COPY --from=build-img /go/src/github.com/layer5io/learn-layer5/smi-conformance/test-gen/test-yamls/test-spec/** /home/test-yamls/traffic-spec/ WORKDIR /home/ EXPOSE 10008 CMD ["sh","-c","./smi_conformance"] \ No newline at end of file diff --git a/smi-conformance/conformance/conformance.pb.go b/smi-conformance/conformance/conformance.pb.go index d370d98..638b921 100644 --- a/smi-conformance/conformance/conformance.pb.go +++ b/smi-conformance/conformance/conformance.pb.go @@ -89,10 +89,10 @@ type SingleTestResult struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - TestCasesPassed string `protobuf:"bytes,2,opt,name=testCasesPassed,proto3" json:"testCasesPassed,omitempty"` - TotalCases string `protobuf:"bytes,3,opt,name=totalCases,proto3" json:"totalCases,omitempty"` - Message string `protobuf:"bytes,4,opt,name=message,proto3" json:"message,omitempty"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Time string `protobuf:"bytes,2,opt,name=time,proto3" json:"time,omitempty"` + Assertions string `protobuf:"bytes,3,opt,name=assertions,proto3" json:"assertions,omitempty"` + Failure *Failure `protobuf:"bytes,4,opt,name=failure,proto3" json:"failure,omitempty"` } func (x *SingleTestResult) Reset() { @@ -134,21 +134,76 @@ func (x *SingleTestResult) GetName() string { return "" } -func (x *SingleTestResult) GetTestCasesPassed() string { +func (x *SingleTestResult) GetTime() string { if x != nil { - return x.TestCasesPassed + return x.Time } return "" } -func (x *SingleTestResult) GetTotalCases() string { +func (x *SingleTestResult) GetAssertions() string { if x != nil { - return x.TotalCases + return x.Assertions } return "" } -func (x *SingleTestResult) GetMessage() string { +func (x *SingleTestResult) GetFailure() *Failure { + if x != nil { + return x.Failure + } + return nil +} + +type Failure struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Test string `protobuf:"bytes,1,opt,name=test,proto3" json:"test,omitempty"` + Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` +} + +func (x *Failure) Reset() { + *x = Failure{} + if protoimpl.UnsafeEnabled { + mi := &file_conformance_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Failure) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Failure) ProtoMessage() {} + +func (x *Failure) ProtoReflect() protoreflect.Message { + mi := &file_conformance_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Failure.ProtoReflect.Descriptor instead. +func (*Failure) Descriptor() ([]byte, []int) { + return file_conformance_proto_rawDescGZIP(), []int{2} +} + +func (x *Failure) GetTest() string { + if x != nil { + return x.Test + } + return "" +} + +func (x *Failure) GetMessage() string { if x != nil { return x.Message } @@ -160,13 +215,15 @@ type Response struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - SingleTestResult []*SingleTestResult `protobuf:"bytes,1,rep,name=singleTestResult,proto3" json:"singleTestResult,omitempty"` + Tests string `protobuf:"bytes,1,opt,name=tests,proto3" json:"tests,omitempty"` + Failures string `protobuf:"bytes,2,opt,name=failures,proto3" json:"failures,omitempty"` + SingleTestResult []*SingleTestResult `protobuf:"bytes,3,rep,name=singleTestResult,proto3" json:"singleTestResult,omitempty"` } func (x *Response) Reset() { *x = Response{} if protoimpl.UnsafeEnabled { - mi := &file_conformance_proto_msgTypes[2] + mi := &file_conformance_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -179,7 +236,7 @@ func (x *Response) String() string { func (*Response) ProtoMessage() {} func (x *Response) ProtoReflect() protoreflect.Message { - mi := &file_conformance_proto_msgTypes[2] + mi := &file_conformance_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -192,7 +249,21 @@ func (x *Response) ProtoReflect() protoreflect.Message { // Deprecated: Use Response.ProtoReflect.Descriptor instead. func (*Response) Descriptor() ([]byte, []int) { - return file_conformance_proto_rawDescGZIP(), []int{2} + return file_conformance_proto_rawDescGZIP(), []int{3} +} + +func (x *Response) GetTests() string { + if x != nil { + return x.Tests + } + return "" +} + +func (x *Response) GetFailures() string { + if x != nil { + return x.Failures + } + return "" } func (x *Response) GetSingleTestResult() []*SingleTestResult { @@ -218,18 +289,25 @@ var file_conformance_proto_rawDesc = []byte{ 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 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, 0x8a, 0x01, 0x0a, 0x10, 0x53, 0x69, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x8e, 0x01, 0x0a, 0x10, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x54, 0x65, 0x73, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x12, 0x28, 0x0a, 0x0f, 0x74, 0x65, 0x73, 0x74, 0x43, 0x61, 0x73, 0x65, 0x73, 0x50, - 0x61, 0x73, 0x73, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x74, 0x65, 0x73, - 0x74, 0x43, 0x61, 0x73, 0x65, 0x73, 0x50, 0x61, 0x73, 0x73, 0x65, 0x64, 0x12, 0x1e, 0x0a, 0x0a, - 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x43, 0x61, 0x73, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x43, 0x61, 0x73, 0x65, 0x73, 0x12, 0x18, 0x0a, 0x07, - 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x59, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x4d, 0x0a, 0x10, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x54, 0x65, 0x73, 0x74, - 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x73, + 0x6d, 0x65, 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, 0x65, 0x72, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x61, 0x73, 0x73, 0x65, + 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x32, 0x0a, 0x07, 0x66, 0x61, 0x69, 0x6c, 0x75, 0x72, + 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x73, 0x6d, 0x69, 0x5f, 0x63, 0x6f, + 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x6e, 0x63, 0x65, 0x2e, 0x46, 0x61, 0x69, 0x6c, 0x75, 0x72, + 0x65, 0x52, 0x07, 0x66, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x22, 0x37, 0x0a, 0x07, 0x46, 0x61, + 0x69, 0x6c, 0x75, 0x72, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x22, 0x8b, 0x01, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x14, 0x0a, 0x05, 0x74, 0x65, 0x73, 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x74, 0x65, 0x73, 0x74, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x61, 0x69, 0x6c, 0x75, 0x72, + 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x61, 0x69, 0x6c, 0x75, 0x72, + 0x65, 0x73, 0x12, 0x4d, 0x0a, 0x10, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x54, 0x65, 0x73, 0x74, + 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x73, 0x6d, 0x69, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x6e, 0x63, 0x65, 0x2e, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x54, 0x65, 0x73, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x10, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x54, 0x65, 0x73, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, @@ -255,23 +333,25 @@ func file_conformance_proto_rawDescGZIP() []byte { return file_conformance_proto_rawDescData } -var file_conformance_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_conformance_proto_msgTypes = make([]protoimpl.MessageInfo, 5) var file_conformance_proto_goTypes = []interface{}{ (*Request)(nil), // 0: smi_conformance.Request (*SingleTestResult)(nil), // 1: smi_conformance.SingleTestResult - (*Response)(nil), // 2: smi_conformance.Response - nil, // 3: smi_conformance.Request.AnnotationsEntry + (*Failure)(nil), // 2: smi_conformance.Failure + (*Response)(nil), // 3: smi_conformance.Response + nil, // 4: smi_conformance.Request.AnnotationsEntry } var file_conformance_proto_depIdxs = []int32{ - 3, // 0: smi_conformance.Request.annotations:type_name -> smi_conformance.Request.AnnotationsEntry - 1, // 1: smi_conformance.Response.singleTestResult:type_name -> smi_conformance.SingleTestResult - 0, // 2: smi_conformance.conformanceTesting.RunTest:input_type -> smi_conformance.Request - 2, // 3: smi_conformance.conformanceTesting.RunTest:output_type -> smi_conformance.Response - 3, // [3:4] is the sub-list for method output_type - 2, // [2:3] is the sub-list for method input_type - 2, // [2:2] is the sub-list for extension type_name - 2, // [2:2] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name + 4, // 0: smi_conformance.Request.annotations:type_name -> smi_conformance.Request.AnnotationsEntry + 2, // 1: smi_conformance.SingleTestResult.failure:type_name -> smi_conformance.Failure + 1, // 2: smi_conformance.Response.singleTestResult:type_name -> smi_conformance.SingleTestResult + 0, // 3: smi_conformance.conformanceTesting.RunTest:input_type -> smi_conformance.Request + 3, // 4: smi_conformance.conformanceTesting.RunTest:output_type -> smi_conformance.Response + 4, // [4:5] is the sub-list for method output_type + 3, // [3:4] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name } func init() { file_conformance_proto_init() } @@ -305,6 +385,18 @@ func file_conformance_proto_init() { } } file_conformance_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Failure); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_conformance_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Response); i { case 0: return &v.state @@ -323,7 +415,7 @@ func file_conformance_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_conformance_proto_rawDesc, NumEnums: 0, - NumMessages: 4, + NumMessages: 5, NumExtensions: 0, NumServices: 1, }, diff --git a/smi-conformance/conformance/conformance.proto b/smi-conformance/conformance/conformance.proto index 3523211..42f7783 100644 --- a/smi-conformance/conformance/conformance.proto +++ b/smi-conformance/conformance/conformance.proto @@ -5,18 +5,25 @@ option go_package = "conformance;conformance"; message Request { map annotations=1; - string meshname=2; + string meshname = 2; } message SingleTestResult { - string name =1; - string testCasesPassed =2; - string totalCases =3; - string message=4; + string name = 1; + string time = 2; + string assertions = 3; + Failure failure = 4; +} + +message Failure { + string test = 1; + string message = 2; } message Response { - repeated SingleTestResult singleTestResult=1; + string tests = 1; + string failures = 2; + repeated SingleTestResult singleTestResult=3; } service conformanceTesting{ diff --git a/smi-conformance/go.mod b/smi-conformance/go.mod index 3f5bb07..e46362a 100644 --- a/smi-conformance/go.mod +++ b/smi-conformance/go.mod @@ -10,6 +10,7 @@ require ( github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4 github.com/kudobuilder/kuttl v0.0.0-00010101000000-000000000000 github.com/kumarabd/gokit v0.2.0 + github.com/sirupsen/logrus v1.6.0 github.com/stretchr/testify v1.6.1 // indirect golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1 // indirect google.golang.org/genproto v0.0.0-20191009194640-548a555dbc03 // indirect diff --git a/smi-conformance/grpc/handlers.go b/smi-conformance/grpc/handlers.go index 1635534..d3fbfc4 100644 --- a/smi-conformance/grpc/handlers.go +++ b/smi-conformance/grpc/handlers.go @@ -2,6 +2,7 @@ package grpc import ( "context" + "fmt" "strconv" "github.com/layer5io/learn-layer5/smi-conformance/conformance" @@ -34,16 +35,22 @@ func (s *Service) RunTest(ctx context.Context, req *conformance.Request) (*confo } result := test_gen.RunTest(config, req.Annotations) - for _, res := range result { + fmt.Printf("%+v\n", result) + for _, res := range result.Testcase { results = append(results, &conformance.SingleTestResult{ - Name: res.Name, - TestCasesPassed: strconv.Itoa(res.Passed), - TotalCases: strconv.Itoa(res.Total), - Message: res.Message, + Name: res.Name, + Time: res.Time, + Assertions: strconv.Itoa(res.Assertions), + Failure: &conformance.Failure{ + Test: res.Failure.Text, + Message: res.Failure.Message, + }, }) } return &conformance.Response{ + Tests: strconv.Itoa(result.Tests), + Failures: strconv.Itoa(result.Failures), SingleTestResult: results, }, nil } diff --git a/smi-conformance/test-gen/test_gen.go b/smi-conformance/test-gen/test_gen.go index 51b10ae..dc98a46 100644 --- a/smi-conformance/test-gen/test_gen.go +++ b/smi-conformance/test-gen/test_gen.go @@ -11,20 +11,26 @@ import ( testutils "github.com/kudobuilder/kuttl/pkg/test/utils" ) -type Results []*Result - -type Result struct { - Name string - Total int - Passed int - Failures int - Elapsedtime string - Message string +type Results struct { + Tests int `json:"tests"` + Failures int `json:"failures"` + Time string `json:"time"` + Name string `json:"name"` + Testcase []struct { + Classname string `json:"classname"` + Name string `json:"name"` + Time string `json:"time"` + Assertions int `json:"assertions"` + Failure struct { + Text string `json:"text"` + Message string `json:"message"` + } `json:"failure,omitempty"` + } `json:"testcase"` } func RunTest(meshConfig ServiceMesh, annotations map[string]string) Results { manifestDirs := []string{} - result := make([]*Result, 0) + output := Results{} results := &report.Testsuites{} // Run all testCases @@ -35,10 +41,10 @@ func RunTest(meshConfig ServiceMesh, annotations map[string]string) Results { startKIND := false options := harness.TestSuite{} - args := []string{"./test-gen/test-yamls/"} + args := []string{"./test-yamls/"} options.TestDirs = args - options.Timeout = 120 + options.Timeout = 30 options.Parallel = 1 options.TestDirs = manifestDirs options.StartKIND = startKIND @@ -78,22 +84,15 @@ func RunTest(meshConfig ServiceMesh, annotations map[string]string) Results { s, _ := json.MarshalIndent(options, "", " ") fmt.Printf("Running integration tests with following options:\n%s\n", string(s)) - results := harness.Run() + results = harness.Run() data, _ := json.Marshal(results) // Results of the test fmt.Printf("Results :\n%v\n", string(data)) + err := json.Unmarshal([]byte(data), &output) + if err != nil { + fmt.Printf("Unable to unmarshal results") + } }) - for _, res := range results.Testsuite { - result = append(result, &Result{ - Name: res.Name, - Total: res.Tests, - Passed: res.Tests - res.Failures, - Failures: res.Failures, - Elapsedtime: res.Time, - Message: "", - }) - } - - return result + return output }