mirror of
https://github.com/go-gitea/gitea.git
synced 2026-08-22 06:50:35 +00:00
Backport #38939 by @bircni `FullSteps` only gave the synthetic "Complete job" step the remaining log range when the last step that had run was also the final step of the job. A skipped step does not count as having run, so any job ending in a skipped step left the post step with an empty range: its logs were stored but never rendered, and the duration showed as `0s`. Reproducible with any job whose last step is skipped, which is common for failure notifications: ```yaml steps: - run: echo hello - run: echo never if: failure() ``` The gate now checks whether the final step is done, which preserves the behaviour from https://github.com/go-gitea/gitea/pull/29926 of showing the post step as waiting while steps are still pending. --> Regression from https://github.com/go-gitea/gitea/pull/29926 Signed-off-by: bircni <bircni@icloud.com> Co-authored-by: bircni <bircni@icloud.com>
This commit is contained in:
@@ -156,6 +156,27 @@ func TestFullSteps(t *testing.T) {
|
||||
{Name: postStepName, Status: actions_model.StatusSuccess, LogIndex: 90, LogLength: 10, Started: 10090, Stopped: 10100},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "last step is skipped",
|
||||
task: &actions_model.ActionTask{
|
||||
Steps: []*actions_model.ActionTaskStep{
|
||||
{Status: actions_model.StatusSuccess, LogIndex: 10, LogLength: 20, Started: 10010, Stopped: 10020},
|
||||
{Status: actions_model.StatusSuccess, LogIndex: 30, LogLength: 60, Started: 10020, Stopped: 10090},
|
||||
{Status: actions_model.StatusSkipped, LogIndex: 0, LogLength: 0, Started: 0, Stopped: 0},
|
||||
},
|
||||
Status: actions_model.StatusSuccess,
|
||||
Started: 10000,
|
||||
Stopped: 10100,
|
||||
LogLength: 100,
|
||||
},
|
||||
want: []*actions_model.ActionTaskStep{
|
||||
{Name: preStepName, Status: actions_model.StatusSuccess, LogIndex: 0, LogLength: 10, Started: 10000, Stopped: 10010},
|
||||
{Status: actions_model.StatusSuccess, LogIndex: 10, LogLength: 20, Started: 10010, Stopped: 10020},
|
||||
{Status: actions_model.StatusSuccess, LogIndex: 30, LogLength: 60, Started: 10020, Stopped: 10090},
|
||||
{Status: actions_model.StatusSkipped, LogIndex: 0, LogLength: 0, Started: 0, Stopped: 0},
|
||||
{Name: postStepName, Status: actions_model.StatusSuccess, LogIndex: 90, LogLength: 10, Started: 10090, Stopped: 10100},
|
||||
},
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user