From c1b1f92c25103dedd8c88948bf5d90785f194d1f Mon Sep 17 00:00:00 2001 From: Marco Braga Date: Mon, 25 Sep 2023 03:08:54 -0300 Subject: [PATCH] review report html and threasholds --- data/templates/report/report.html | 467 ++++++++++++------------------ internal/opct/report/checks.go | 2 +- internal/opct/report/report.go | 17 +- 3 files changed, 196 insertions(+), 290 deletions(-) diff --git a/data/templates/report/report.html b/data/templates/report/report.html index 309e3522..32f13430 100644 --- a/data/templates/report/report.html +++ b/data/templates/report/report.html @@ -71,7 +71,8 @@ @@ -204,99 +162,6 @@ - - - -

Summary

-
-
- -
Tests
-
- - - - - - - -
Result file[[ .Summary.Tests.Archive ]] [[ if .Summary.Tests.ArchiveDiff ]](diff [[ .Summary.Tests.ArchiveDiff ]])[[end]]
- - - - - - - - - - - - - - - - - -[[ range $plugin := .Provider.Plugins]] - - - - - - - - - - - - - -[[end]] - -
Plugin NameStatusTotalPassedFailedTimeoutSkippedFilterSuiteFilterBaselineFilterFailedPrio
[[ $plugin.Name ]] [[ $plugin.Stat.Status ]] [[ $plugin.Stat.Total ]] [[ $plugin.Stat.Passed ]] [[ $plugin.Stat.Failed ]] [[ $plugin.Stat.Timeout ]] [[ $plugin.Stat.Skipped ]] [[ $plugin.Stat.FilterSuite ]] [[ $plugin.Stat.FilterBaseline ]] [[ $plugin.Stat.FilterFailedPrio ]]
- -
- -
Cluster
-
- - - - - - - - - - - -
OpenShift version[[ .Provider.Version.OpenShift.Desired ]]
Kubernetes version[[ .Provider.Version.Kubernetes ]]
-
- -
Infrastructure
-
- - - - - - - - - - - - - - - - - -
PlatformTypeNameInfra TopologyControlPlaneTopology
[[ .Provider.Infra.PlatformType ]] [[ .Provider.Infra.Name ]] [[ .Provider.Infra.Topology ]] [[ .Provider.Infra.ControlPlaneTopology ]]
-
-
-
diff --git a/internal/opct/report/checks.go b/internal/opct/report/checks.go index 725997c2..f238b437 100644 --- a/internal/opct/report/checks.go +++ b/internal/opct/report/checks.go @@ -259,7 +259,7 @@ func NewCheckSummary(re *Report) *CheckSummary { // "Acceptable" are relative, we are trying to observe the baselines and set // a "good" value considering a healthy cluster. total := re.Provider.MustGatherInfo.ErrorCounters["total"] - if total > 25000 { + if total > 30000 { log.Debugf("Check Failed: OPCT-007: want[<=25000] got[%d]", total) return CheckResultFail } diff --git a/internal/opct/report/report.go b/internal/opct/report/report.go index 6adb65f0..ecfabe1b 100644 --- a/internal/opct/report/report.go +++ b/internal/opct/report/report.go @@ -47,7 +47,7 @@ type ReportResult struct { HasValidBaseline bool `json:"hasValidBaseline"` MustGatherInfo *mustgather.MustGather `json:"mustGatherInfo,omitempty"` ErrorCounters *archive.ErrorCounter `json:"errorCounters,omitempty"` - Runtime *ReportSummaryRuntime `json:"runtime,omitempty"` + Runtime *ReportRuntime `json:"runtime,omitempty"` } type ReportSummary struct { @@ -57,12 +57,9 @@ type ReportSummary struct { Headline string `json:"headline"` } -// TODO: get info about OPCT exec (total time, plugins, etc) type ReportSummaryRuntime struct { - ServerLogs []*archive.RuntimeInfoItem `json:"serverLogs,omitempty"` - ServerConfig []*archive.RuntimeInfoItem `json:"serverConfig,omitempty"` - OpctConfig []*archive.RuntimeInfoItem `json:"opctConfig,omitempty"` - Timers metrics.Timers `json:"timers,omitempty"` + Timers metrics.Timers `json:"timers,omitempty"` + Plugins map[string]string `json:"plugins,omitempty"` } type ReportSummaryTests struct { @@ -169,6 +166,12 @@ type ReportSetupFrontend struct { EmbedData bool } +type ReportRuntime struct { + ServerLogs []*archive.RuntimeInfoItem `json:"serverLogs,omitempty"` + ServerConfig []*archive.RuntimeInfoItem `json:"serverConfig,omitempty"` + OpctConfig []*archive.RuntimeInfoItem `json:"opctConfig,omitempty"` +} + func (re *Report) Populate(cs *summary.ConsolidatedSummary) error { cs.Timers.Add("report-populate") re.Summary = &ReportSummary{ @@ -309,7 +312,7 @@ func (re *Report) populateSource(rs *summary.ResultSummary) error { // Runtime if reResult.Runtime == nil { - reResult.Runtime = &ReportSummaryRuntime{} + reResult.Runtime = &ReportRuntime{} } if rs.Sonobuoy != nil && rs.Sonobuoy.MetaRuntime != nil { reResult.Runtime.ServerLogs = rs.Sonobuoy.MetaRuntime