Skip to content

Commit

Permalink
Risk Analysis: ensure Test ID is populated
Browse files Browse the repository at this point in the history
  • Loading branch information
sosiouxme committed Jul 11, 2024
1 parent 4fa6a90 commit 6c547f6
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion pkg/api/job_runs.go
Original file line number Diff line number Diff line change
Expand Up @@ -528,9 +528,17 @@ func runTestRunAnalysis(failedTest models.ProwJobRunTest, jobRun *models.ProwJob
return apitype.ProwJobRunTestRiskAnalysis{}, errJobNames
}

// one of our data sources should have the test ID
testID := failedTest.Test.ID
if testID == 0 && testResultsJobNames != nil {
testID = uint(testResultsJobNames.ID)
}
if testID == 0 && testResultsVariants != nil {
testID = uint(testResultsVariants.ID)
}
analysis := apitype.ProwJobRunTestRiskAnalysis{
Name: failedTest.Test.Name,
TestID: failedTest.Test.ID,
TestID: testID,
OpenBugs: failedTest.Test.Bugs,
}
// Watch out for tests that ran in previous period, but not current, no sense comparing to 0 runs:
Expand Down

0 comments on commit 6c547f6

Please sign in to comment.