Skip to content

Commit

Permalink
Added panic test for res.Failure
Browse files Browse the repository at this point in the history
Signed-off-by: dhruv0000 <[email protected]>
  • Loading branch information
dhruv0000 committed Mar 17, 2021
1 parent 92d8cea commit a9e71a9
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions smi-conformance/grpc/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,16 @@ func (s *Service) RunTest(ctx context.Context, req *conformance.Request) (*confo

// A hacky way to see the testStep Failed, since KUDO only provides it in Failure.Message
re := regexp.MustCompile(`[0-9]+`)
stepFailed := re.FindAllString(res.Failure.Message, 1)
if len(stepFailed) != 0 {
passed, _ := strconv.Atoi(stepFailed[0])
passed = passed - 1
failures := stepsCount[res.Name] - passed
totalFailures += failures
if (passed) >= (stepsCount[res.Name] / 2) {
d.Capability = conformance.Capability_HALF
if res.Failure != nil {
stepFailed := re.FindAllString(res.Failure.Message, 1)
if len(stepFailed) != 0 {
passed, _ := strconv.Atoi(stepFailed[0])
passed = passed - 1
failures := stepsCount[res.Name] - passed
totalFailures += failures
if (passed) >= (stepsCount[res.Name] / 2) {
d.Capability = conformance.Capability_HALF
}
}
}
}
Expand Down

0 comments on commit a9e71a9

Please sign in to comment.