(results []output.CheckResult, namespaces []string)
| 27 | ) |
| 28 | |
| 29 | func appstudioReport(results []output.CheckResult, namespaces []string) applicationsnapshot.TestReport { |
| 30 | // This is may need revising in future. It does not handle multiple namespaces |
| 31 | // accurately. We could consider using a string delimited list of namespaces |
| 32 | // but I'm being cautious about breaking consumers of this data. The |
| 33 | // testReport.Namespace field might need to be converted to a list of strings |
| 34 | // in future but we need to coordinate that change carefully. |
| 35 | // Also, we might prefer to extract the namespaces from results rather than |
| 36 | // use whatever the user provided on the command line. |
| 37 | useNamespace := "" |
| 38 | if len(namespaces) > 0 { |
| 39 | // The first namespace only |
| 40 | useNamespace = namespaces[0] |
| 41 | } |
| 42 | report := applicationsnapshot.TestReport{ |
| 43 | Timestamp: fmt.Sprint(time.Now().UTC().Unix()), |
| 44 | Namespace: useNamespace, |
| 45 | } |
| 46 | |
| 47 | for _, result := range results { |
| 48 | report.Successes += result.Successes |
| 49 | report.Failures += len(result.Failures) |
| 50 | report.Warnings += len(result.Warnings) |
| 51 | } |
| 52 | |
| 53 | report.DeriveResult(false) |
| 54 | report.DeriveNote() |
| 55 | return report |
| 56 | } |
| 57 | |
| 58 | // Special error handling for appstudio format only |
| 59 | func appstudioErrorHandler(noFail bool, prefix string, err error) error { |
no test coverage detected