@@ -68,6 +68,7 @@ func MockActionsRunsJobs(ctx *context.Context) {
6868 runID := ctx .PathParamInt64 ("run" )
6969
7070 resp := & actions.ViewResponse {}
71+ resp .State .Run .RepoID = 12345
7172 resp .State .Run .TitleHTML = `mock run title <a href="/">link</a>`
7273 resp .State .Run .Link = setting .AppSubURL + "/devtest/repo-action-view/runs/" + strconv .FormatInt (runID , 10 )
7374 resp .State .Run .Status = actions_model .StatusRunning .String ()
@@ -135,12 +136,36 @@ func MockActionsRunsJobs(ctx *context.Context) {
135136 resp .State .Run .Jobs = append (resp .State .Run .Jobs , & actions.ViewJob {
136137 ID : runID * 10 + 2 ,
137138 JobID : "job-102" ,
138- Name : "job 102" ,
139+ Name : "ULTRA LOOOOOOOOOOOONG job name 102 that exceeds the limit " ,
139140 Status : actions_model .StatusFailure .String (),
140141 CanRerun : false ,
141142 Duration : "3h" ,
142143 Needs : []string {"job-100" , "job-101" },
143144 })
145+ resp .State .Run .Jobs = append (resp .State .Run .Jobs , & actions.ViewJob {
146+ ID : runID * 10 + 3 ,
147+ JobID : "job-103" ,
148+ Name : "job 103" ,
149+ Status : actions_model .StatusCancelled .String (),
150+ CanRerun : false ,
151+ Duration : "2m" ,
152+ Needs : []string {"job-100" },
153+ })
154+
155+ // add more jobs to a run for UI testing
156+ if resp .State .Run .CanCancel {
157+ for i := range 10 {
158+ resp .State .Run .Jobs = append (resp .State .Run .Jobs , & actions.ViewJob {
159+ ID : runID * 1000 + int64 (i ),
160+ JobID : "job-dup-test-" + strconv .Itoa (i ),
161+ Name : "job dup test " + strconv .Itoa (i ),
162+ Status : actions_model .StatusSuccess .String (),
163+ CanRerun : false ,
164+ Duration : "2m" ,
165+ Needs : []string {"job-103" , "job-101" , "job-100" },
166+ })
167+ }
168+ }
144169
145170 fillViewRunResponseCurrentJob (ctx , resp )
146171 ctx .JSON (http .StatusOK , resp )
0 commit comments