Skip to content
Open
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
29 changes: 17 additions & 12 deletions tools/codegen/cmd/featuregate-test-analyzer.go
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,14 @@ func listTestResultFor(featureGate string, clusterProfiles sets.Set[string]) (ma

var jobVariantsToCheck []JobVariant
if clusterProfiles.Has("Hypershift") && !nonHypershiftPlatforms.MatchString(featureGate) {
jobVariantsToCheck = append(jobVariantsToCheck, filterVariants(featureGate, requiredHypershiftJobVariants)...)
// See if the feature gate is specific to any platform
hypershiftPlatformVariants := filterVariants(featureGate, requiredHypershiftJobVariants)

if len(hypershiftPlatformVariants) == 0 {
hypershiftPlatformVariants = requiredHypershiftJobVariants
}

jobVariantsToCheck = append(jobVariantsToCheck, hypershiftPlatformVariants...)
Comment thread
qodo-for-rh-openshift[bot] marked this conversation as resolved.
}
if clusterProfiles.Has("SelfManagedHA") {
// See if the feature gate is specific to any platform
Expand Down Expand Up @@ -1053,10 +1060,10 @@ func verifyJobPassRate(client *http.Client, release string, job sippy.SippyJob,
// failures analysis of the job runs to see if failed runs are true failures or known regressions.
if runs < requiredNumberOfTestRunsPerVariant {
return &TestResults{
TestName: job.Name,
TotalRuns: runs,
TestName: job.Name,
TotalRuns: runs,
SuccessfulRuns: passes,
FailedRuns: runs - passes,
FailedRuns: runs - passes,
}, nil
}

Expand All @@ -1065,15 +1072,15 @@ func verifyJobPassRate(client *http.Client, release string, job sippy.SippyJob,
//
// This saves us from unnecessarily making calls out to Sippy to perform a more nuanced
// failures analysis of the job runs to see if failed runs are true failures or known regressions.
if float32(passes) / float32(runs) >= requiredPassRateOfTestsPerVariant {
if float32(passes)/float32(runs) >= requiredPassRateOfTestsPerVariant {
return &TestResults{
TestName: job.Name,
TotalRuns: runs,
TestName: job.Name,
TotalRuns: runs,
SuccessfulRuns: passes,
FailedRuns: runs - passes,
FailedRuns: runs - passes,
}, nil
}

// We haven't passed promotion requirements with this job, but jobs might be impacted
// by known regressed tests. While important to get fixed, many regressions are either
// release blockers or require an exception to not be a release blocker.
Expand Down Expand Up @@ -1147,7 +1154,6 @@ func getJobsForFeatureGateFromSippy(client *http.Client, release, featureGate st
return nil, fmt.Errorf("reading response body: %w", err)
}


jobs := []sippy.SippyJob{}
err = json.Unmarshal(body, &jobs)
if err != nil {
Expand All @@ -1158,7 +1164,7 @@ func getJobsForFeatureGateFromSippy(client *http.Client, release, featureGate st
}

func getJobRunsFromSippy(client *http.Client, release, jobName string) ([]sippy.SippyJobRun, error) {
resp, err := client.Get(sippy.BuildSippyJobRunsForJobURL(release, jobName, time.Now().Add(-1 * 14 * 24 * time.Hour)))
resp, err := client.Get(sippy.BuildSippyJobRunsForJobURL(release, jobName, time.Now().Add(-1*14*24*time.Hour)))
if err != nil {
return nil, fmt.Errorf("getting job info: %w", err)
}
Expand All @@ -1173,7 +1179,6 @@ func getJobRunsFromSippy(client *http.Client, release, jobName string) ([]sippy.
return nil, fmt.Errorf("reading response body: %w", err)
}


runResults := &sippy.SippyJobRunsResult{}
err = json.Unmarshal(body, runResults)
if err != nil {
Expand Down