MCPcopy Create free account
hub / github.com/conforma/cli / appstudioReport

Function appstudioReport

cmd/test/appstudio.go:29–56  ·  view source on GitHub ↗
(results []output.CheckResult, namespaces []string)

Source from the content-addressed store, hash-verified

27)
28
29func 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
59func appstudioErrorHandler(noFail bool, prefix string, err error) error {

Callers 1

NewTestCommandFunction · 0.85

Calls 2

DeriveResultMethod · 0.95
DeriveNoteMethod · 0.95

Tested by

no test coverage detected