Skip to content

Commit

Permalink
Merge pull request #43 from kumarabd/addLabels
Browse files Browse the repository at this point in the history
modified results struct to return results
  • Loading branch information
leecalcote committed Aug 14, 2020
2 parents c0fb370 + 47c7806 commit d124065
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 15 deletions.
2 changes: 1 addition & 1 deletion smi-conformance/grpc/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
34 changes: 20 additions & 14 deletions smi-conformance/test-gen/test_gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit d124065

Please sign in to comment.