Skip to content

Commit 6a3a94f

Browse files
authored
Merge pull request #68 from kubevirt/list-lane-failures
e2e,failures: Include links to the failed prow jobs for each test lane in the failure board
2 parents e1845be + 2e27ff6 commit 6a3a94f

File tree

5 files changed

+18
-3
lines changed

5 files changed

+18
-3
lines changed

.github/workflows/test.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ jobs:
2323
run: |
2424
echo -n $GITHUB_TOKEN > $(pwd)/token
2525
26-
bazelisk test ... --action_env GITHUB_TOKEN_PATH=$(pwd)/token
26+
bazelisk test ... --action_env GITHUB_TOKEN_PATH=$(pwd)/token --test_timeout=600

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ Top failed lanes:
6969

7070
![failedjob10](https://kubevirt.io/ci-health/output/kubevirt/kubevirt/failedjob10.svg)
7171

72+
The links to each of these failed jobs can be found in the [latest execution data](https://kubevirt.io/ci-health/output/kubevirt/kubevirt/results.json)
73+
under the SIGRetests section
74+
7275
## Historical data evolution
7376

7477
These plots will be updated every week.

pkg/sigretests/main.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ type SigRetests struct {
3030
SigStorageSuccess int
3131
SigOperatorSuccess int
3232
FailedJobNames []string
33+
FailedJobURLs []string
3334
SuccessJobNames []string
3435
}
3536

@@ -55,7 +56,7 @@ func filterJobs(node *html.Node) (jobs []job) {
5556
for _, href := range node.FirstChild.Attr {
5657
if strings.Contains(href.Val, "e2e") {
5758
e2eJob.failure = true
58-
e2eJob.buildURL = href.Val
59+
e2eJob.buildURL = fmt.Sprintf("https://prow.ci.kubevirt.io/%s", href.Val)
5960
buildLogUrl := strings.Split(href.Val, "/")
6061
e2eJob.jobName = buildLogUrl[len(buildLogUrl)-2]
6162
e2eJob.buildNumber = buildLogUrl[len(buildLogUrl)-1]
@@ -160,6 +161,7 @@ func getJobsForLatestCommit(org string, repo string, prNumber string) (jobsLastC
160161
func sortJobNamesOnResult(job job, sigRetests SigRetests) (jobCounts SigRetests) {
161162
if job.failure == true {
162163
sigRetests.FailedJobNames = append(sigRetests.FailedJobNames, job.jobName)
164+
sigRetests.FailedJobURLs = append(sigRetests.FailedJobURLs, job.buildURL)
163165
} else {
164166
sigRetests.SuccessJobNames = append(sigRetests.SuccessJobNames, job.jobName)
165167
}

pkg/stats/stats.go

+9
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"math"
66
"slices"
77
"strconv"
8+
"strings"
89
"time"
910

1011
"github.com/kubevirt/ci-health/pkg/chatops"
@@ -256,6 +257,7 @@ func (h *Handler) mergedPRsProcessor(results *types.Results) (*types.Results, er
256257
func (h *Handler) sigRetestsProcessor(results *types.Results) (*types.Results, error) {
257258
currentTime, err := time.Parse(constants.DateFormat, results.EndDate)
258259
var failedJobNames []string
260+
var failedJobURLs []string
259261
var successJobNames []string
260262
if err != nil {
261263
return results, err
@@ -290,6 +292,7 @@ func (h *Handler) sigRetestsProcessor(results *types.Results) (*types.Results, e
290292
})
291293
failedJobNames = slices.Concat(failedJobNames, jobsPerSIG.FailedJobNames)
292294
successJobNames = slices.Concat(successJobNames, jobsPerSIG.SuccessJobNames)
295+
failedJobURLs = slices.Concat(failedJobURLs, jobsPerSIG.FailedJobURLs)
293296
}
294297
sortedFailedJobs := types.SortByMostFailed(countFailedJobs(failedJobNames))
295298
for i, job := range sortedFailedJobs {
@@ -298,6 +301,12 @@ func (h *Handler) sigRetestsProcessor(results *types.Results) (*types.Results, e
298301
sortedFailedJobs[i].SuccesCount++
299302
}
300303
}
304+
for _, failedJobURL := range failedJobURLs {
305+
jobNameInURL := strings.Split(failedJobURL, "/")[len(strings.Split(failedJobURL, "/"))-2]
306+
if job.JobName == jobNameInURL {
307+
sortedFailedJobs[i].FailureURLs = append(sortedFailedJobs[i].FailureURLs, failedJobURL)
308+
}
309+
}
301310
}
302311
dataItem.FailedJobLeaderBoard = sortedFailedJobs
303312
results.Data[constants.SIGRetests] = dataItem

pkg/types/main.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@ type FailedJob struct {
215215
JobName string
216216
FailureCount int
217217
SuccesCount int
218+
FailureURLs []string
218219
}
219220

220221
type FailedJobs []FailedJob
@@ -227,7 +228,7 @@ func SortByMostFailed(countFailedJobs map[string]int) FailedJobs {
227228
fl := make(FailedJobs, len(countFailedJobs))
228229
i := 0
229230
for j, f := range countFailedJobs {
230-
fl[i] = FailedJob{j, f, 0}
231+
fl[i] = FailedJob{j, f, 0, nil}
231232
i++
232233
}
233234
sort.Sort(sort.Reverse(fl))

0 commit comments

Comments
 (0)