diff --git a/routers/web/devtest/mock_actions.go b/routers/web/devtest/mock_actions.go index f61becd65fd..2feb185cab0 100644 --- a/routers/web/devtest/mock_actions.go +++ b/routers/web/devtest/mock_actions.go @@ -6,7 +6,6 @@ package devtest import ( "fmt" "maps" - mathRand "math/rand/v2" "net/http" "net/url" "slices" @@ -597,7 +596,7 @@ func fillViewRunResponseCurrentJob(ctx *context.Context, resp *actions.ViewRespo mockLogOptions = append(mockLogOptions, generateMockStepsLogOptions{mockCountFirst: 30, mockCountGeneral: 3, groupRepeat: 20}) resp.State.CurrentJob.Steps = append(resp.State.CurrentJob.Steps, &actions.ViewJobStep{ - Summary: "step 2 (mock error)", + Summary: "step 2", Duration: time.Hour.String(), Status: actions_model.StatusRunning.String(), }) @@ -609,20 +608,16 @@ func fillViewRunResponseCurrentJob(ctx *context.Context, resp *actions.ViewRespo resp.Logs.StepsLog = []*actions.ViewStepLog{} doSlowResponse := false - doErrorResponse := false for _, logCur := range req.LogCursors { if !logCur.Expanded { continue } doSlowResponse = doSlowResponse || logCur.Step == 0 - doErrorResponse = doErrorResponse || logCur.Step == 2 resp.Logs.StepsLog = append(resp.Logs.StepsLog, generateMockStepsLog(logCur, mockLogOptions[logCur.Step])...) } - if doErrorResponse { - if mathRand.Float64() > 0.5 { - ctx.HTTPError(http.StatusInternalServerError, "devtest mock error response") - return - } + if ctx.PathParamInt64("run") == 50 && len(resp.Logs.StepsLog) > 0 { + ctx.HTTPError(http.StatusInternalServerError, "devtest mock error response") + return } if doSlowResponse { time.Sleep(time.Duration(3000) * time.Millisecond) diff --git a/templates/devtest/repo-action-view.tmpl b/templates/devtest/repo-action-view.tmpl index 12da63a7e9e..6fa52028f68 100644 --- a/templates/devtest/repo-action-view.tmpl +++ b/templates/devtest/repo-action-view.tmpl @@ -6,6 +6,7 @@ Run:CanRerunLatest Run:PreviousAttempt Run:ReusableCaller + Run:LogsAlwaysFail {{template "repo/actions/view_component" (dict "JobID" (or .JobID 0) diff --git a/templates/org/team/new.tmpl b/templates/org/team/new.tmpl index 45503ac8fe4..b34a12005b0 100644 --- a/templates/org/team/new.tmpl +++ b/templates/org/team/new.tmpl @@ -1,5 +1,5 @@ {{template "base/head" .}} -