Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions pkg/api/componentreadiness/component_report.go
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ func (c *ComponentReportGenerator) generateComponentTestReport(basisStatusMap, s
keySet := sets.NewString(slices.Collect(maps.Keys(basisStatusMap))...)
keySet.Insert(slices.Collect(maps.Keys(sampleStatusMap))...)
for testKeyStr := range keySet {
var cellReport testdetails.TestComparison // The actual stats we return over the API
cell := testdetails.TestComparison{Explanations: []string{}}
sampleStatus, sampleThere := sampleStatusMap[testKeyStr]
basisStatus, basisThere := basisStatusMap[testKeyStr]

Expand All @@ -630,23 +630,23 @@ func (c *ComponentReportGenerator) generateComponentTestReport(basisStatusMap, s
if !sampleThere {
// we use this to find tests associated with the basis that we don't see now in sample,
// meaning they have been renamed or removed. no further analysis is needed.
cellReport.ReportStatus = crtest.MissingSample
cell.ReportStatus = crtest.MissingSample
} else {
// Initialize the test analysis before we start passing it around to the middleware
if basisThere {
initTestAnalysisStruct(&cellReport, c.ReqOptions, sampleStatus, &basisStatus)
initTestAnalysisStruct(&cell, c.ReqOptions, sampleStatus, &basisStatus)
} else {
initTestAnalysisStruct(&cellReport, c.ReqOptions, sampleStatus, nil)
initTestAnalysisStruct(&cell, c.ReqOptions, sampleStatus, nil)
}

// Give middleware a chance to adjust parameters prior to analysis
if err := c.middlewares.PreAnalysis(testKey, &cellReport); err != nil {
if err := c.middlewares.PreAnalysis(testKey, &cell); err != nil {
return crtype.ComponentReport{}, err
}

c.assessComponentStatus(&cellReport, log.NewEntry(log.New()))
c.assessComponentStatus(&cell, log.NewEntry(log.New()))
if lastFailure := sampleStatus.LastFailure; !lastFailure.IsZero() {
cellReport.LastFailure = &lastFailure // it's a copy, for pointer hygiene
cell.LastFailure = &lastFailure // it's a copy, for pointer hygiene
}
}

Expand All @@ -655,7 +655,7 @@ func (c *ComponentReportGenerator) generateComponentTestReport(basisStatusMap, s
return crtype.ComponentReport{}, err
}
updateCellStatus(
rowIdentifications, columnIdentifications, testKey, cellReport, // inputs
rowIdentifications, columnIdentifications, testKey, cell, // inputs
aggregatedStatus, allRows, allColumns, // these three are maps to be updated
)
}
Expand Down
1 change: 1 addition & 0 deletions pkg/api/componentreadiness/test_details.go
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,7 @@ func (c *ComponentReportGenerator) internalGenerateTestDetailsReport(
totalBase, totalSample, report, result, lastFailure := c.summarizeRecordedTestStats(baseStatus, sampleStatus, testKey)

testStats := testdetails.TestComparison{
Explanations: []string{},
RequiredConfidence: c.ReqOptions.AdvancedOption.Confidence,
SampleStats: testdetails.ReleaseStats{
Release: c.ReqOptions.SampleRelease.Name,
Expand Down
Loading