Results returns the results of the test run. Panics if the test run is not done yet.
()
| 53 | // Results returns the results of the test run. Panics if the test run is not |
| 54 | // done yet. |
| 55 | func (r *TestRun) Result() RunResult { |
| 56 | select { |
| 57 | case <-r.done: |
| 58 | default: |
| 59 | panic("cannot get results of a test run that is not done yet") |
| 60 | } |
| 61 | |
| 62 | return RunResult{ |
| 63 | FullID: r.FullID(), |
| 64 | TestName: r.testName, |
| 65 | ID: r.id, |
| 66 | Logs: r.logs.String(), |
| 67 | Error: r.err, |
| 68 | StartedAt: r.started, |
| 69 | Duration: httpapi.Duration(r.duration), |
| 70 | DurationMS: r.duration.Milliseconds(), |
| 71 | Metrics: r.metrics, |
| 72 | } |
| 73 | } |
| 74 | |
| 75 | // Results collates the results of all the test runs and returns them. |
| 76 | func (h *TestHarness) Results() Results { |