Skip to content

Commit d124065

Browse files
authored
Merge pull request #43 from kumarabd/addLabels
modified results struct to return results
2 parents c0fb370 + 47c7806 commit d124065

File tree

2 files changed

+21
-15
lines changed

2 files changed

+21
-15
lines changed

smi-conformance/grpc/handlers.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ func (s *Service) RunTest(ctx context.Context, req *conformance.Request) (*confo
5454

5555
result := test_gen.RunTest(config, req.Annotations, req.Labels)
5656
fmt.Printf("%+v\n", result)
57-
for _, res := range result.Testcase {
57+
for _, res := range result.Testsuite[0].Testcase {
5858
results = append(results, &conformance.SingleTestResult{
5959
Name: res.Name,
6060
Time: res.Time,

smi-conformance/test-gen/test_gen.go

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,26 @@ import (
1313
)
1414

1515
type Results struct {
16-
Tests int `json:"tests"`
17-
Failures int `json:"failures"`
18-
Time string `json:"time"`
19-
Name string `json:"name"`
20-
Testcase []struct {
21-
Classname string `json:"classname"`
22-
Name string `json:"name"`
23-
Time string `json:"time"`
24-
Assertions int `json:"assertions"`
25-
Failure struct {
26-
Text string `json:"text"`
27-
Message string `json:"message"`
28-
} `json:"failure,omitempty"`
29-
} `json:"testcase"`
16+
Name string `json:"name"`
17+
Tests int `json:"tests"`
18+
Failures int `json:"failures"`
19+
Time string `json:"time"`
20+
Testsuite []struct {
21+
Tests int `json:"tests"`
22+
Failures int `json:"failures"`
23+
Time string `json:"time"`
24+
Name string `json:"name"`
25+
Testcase []struct {
26+
Classname string `json:"classname"`
27+
Name string `json:"name"`
28+
Time string `json:"time"`
29+
Assertions int `json:"assertions"`
30+
Failure struct {
31+
Text string `json:"text"`
32+
Message string `json:"message"`
33+
} `json:"failure"`
34+
} `json:"testcase"`
35+
} `json:"testsuite"`
3036
}
3137

3238
func RunTest(meshConfig ServiceMesh, annotations, labels map[string]string) Results {

0 commit comments

Comments
 (0)