Skip to content

Commit

Permalink
review timers for plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
mtulio committed Sep 25, 2023
1 parent c1b1f92 commit 6bc5fc8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
1 change: 1 addition & 0 deletions data/templates/report/report.html
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,7 @@
let plugin = this.report.provider.plugins[name]
table = [{
"Plugin Name": plugin.id,
"Time": this.report.summary.runtime.plugins[name],
"Result": plugin.stat.filterSuite == 0 ? "passed" : plugin.stat.status,
"Status": plugin.stat.status,
"Total": plugin.stat.total,
Expand Down
13 changes: 11 additions & 2 deletions internal/opct/report/report.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"html/template"
"os"
"sort"
"strings"

vfs "github.com/redhat-openshift-ecosystem/provider-certification-tool/internal/assets"
"github.com/redhat-openshift-ecosystem/provider-certification-tool/internal/opct/archive"
Expand Down Expand Up @@ -178,8 +179,10 @@ func (re *Report) Populate(cs *summary.ConsolidatedSummary) error {
Tests: &ReportSummaryTests{
Archive: cs.GetProvider().Archive,
},
Runtime: &ReportSummaryRuntime{},
Alerts: &ReportSummaryAlerts{},
Runtime: &ReportSummaryRuntime{
Plugins: make(map[string]string, 4),
},
Alerts: &ReportSummaryAlerts{},
}
if err := re.populateSource(cs.GetProvider()); err != nil {
return err
Expand Down Expand Up @@ -316,6 +319,12 @@ func (re *Report) populateSource(rs *summary.ResultSummary) error {
}
if rs.Sonobuoy != nil && rs.Sonobuoy.MetaRuntime != nil {
reResult.Runtime.ServerLogs = rs.Sonobuoy.MetaRuntime
for _, e := range rs.Sonobuoy.MetaRuntime {
if strings.HasPrefix(e.Name, "plugin finished") {
arr := strings.Split(e.Name, "plugin finished ")
re.Summary.Runtime.Plugins[arr[len(arr)-1]] = e.Delta
}
}
}
if rs.Sonobuoy != nil && rs.Sonobuoy.MetaConfig != nil {
reResult.Runtime.ServerConfig = rs.Sonobuoy.MetaConfig
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/report/report.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ func showReportAggregatedSummary(re *report.Report) error {
fmt.Fprintf(tbWriter, " - Kubernetes\t: %s\n", re.Provider.Version.Kubernetes)
fmt.Fprintf(tbWriter, " - OpenShift\t: %s\n", re.Provider.Version.OpenShift.Desired)

fmt.Fprintf(tbWriter, " - OpenShift Previous\t: %s\n", re.Provider.Version.OpenShift.Previous)
// fmt.Fprintf(tbWriter, " - OpenShift Previous\t: %s\n", re.Provider.Version.OpenShift.Previous)
fmt.Fprintf(tbWriter, " - Channel\t: %s\n", re.Provider.Version.OpenShift.Channel)
fmt.Fprintf(tbWriter, " Cluster Status\t: %s\n", re.Provider.Version.OpenShift.OverallStatus)
if re.Provider.Version.OpenShift.OverallStatus != "Available" {
Expand Down

0 comments on commit 6bc5fc8

Please sign in to comment.