Skip to content

Commit

Permalink
fix it
Browse files Browse the repository at this point in the history
  • Loading branch information
sperlingxx committed Apr 15, 2020
1 parent 1b9b047 commit 4c7a6e3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
10 changes: 6 additions & 4 deletions test/e2e/v1alpha3/resume-e2e-experiment.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,13 @@ func verifyResult(exp *experimentsv1alpha3.Experiment) (*commonv1alpha3.Metric,
return nil, fmt.Errorf("Best metrics not updated in status")
}

metric := exp.Status.CurrentOptimalTrial.Observation.Metrics[0]
if metric.Name != exp.Spec.Objective.ObjectiveMetricName {
return nil, fmt.Errorf("Best objective metric not updated in status")
for _, metric := range exp.Status.CurrentOptimalTrial.Observation.Metrics {
if metric.Name == exp.Spec.Objective.ObjectiveMetricName {
return &metric, nil
}
}
return &metric, nil

return nil, fmt.Errorf("Best objective metric not updated in status")
}

func main() {
Expand Down
10 changes: 6 additions & 4 deletions test/e2e/v1alpha3/run-e2e-experiment.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,13 @@ func verifyResult(exp *experimentsv1alpha3.Experiment) (*commonv1alpha3.Metric,
return nil, fmt.Errorf("Best metrics not updated in status")
}

metric := exp.Status.CurrentOptimalTrial.Observation.Metrics[0]
if metric.Name != exp.Spec.Objective.ObjectiveMetricName {
return nil, fmt.Errorf("Best objective metric not updated in status")
for _, metric := range exp.Status.CurrentOptimalTrial.Observation.Metrics {
if metric.Name == exp.Spec.Objective.ObjectiveMetricName {
return &metric, nil
}
}
return &metric, nil

return nil, fmt.Errorf("Best objective metric not updated in status")
}

func main() {
Expand Down

0 comments on commit 4c7a6e3

Please sign in to comment.