diff --git a/smi-conformance/grpc/handlers.go b/smi-conformance/grpc/handlers.go index 9fce133..3b8eaa7 100644 --- a/smi-conformance/grpc/handlers.go +++ b/smi-conformance/grpc/handlers.go @@ -54,7 +54,7 @@ func (s *Service) RunTest(ctx context.Context, req *conformance.Request) (*confo result := test_gen.RunTest(config, req.Annotations, req.Labels) fmt.Printf("%+v\n", result) - for _, res := range result.Testcase { + for _, res := range result.Testsuite[0].Testcase { results = append(results, &conformance.SingleTestResult{ Name: res.Name, Time: res.Time, diff --git a/smi-conformance/test-gen/test_gen.go b/smi-conformance/test-gen/test_gen.go index f46c42d..10d630b 100644 --- a/smi-conformance/test-gen/test_gen.go +++ b/smi-conformance/test-gen/test_gen.go @@ -13,20 +13,26 @@ import ( ) 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"` + Name string `json:"name"` + Tests int `json:"tests"` + Failures int `json:"failures"` + Time string `json:"time"` + Testsuite []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"` + } `json:"testcase"` + } `json:"testsuite"` } func RunTest(meshConfig ServiceMesh, annotations, labels map[string]string) Results {