|
|
|
@ -103,6 +103,40 @@ func TestFullSteps(t *testing.T) {
|
|
|
|
|
{Name: postStepName, Status: actions_model.StatusSuccess, LogIndex: 100, LogLength: 0, Started: 10100, Stopped: 10100},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "all steps finished but task is running",
|
|
|
|
|
task: &actions_model.ActionTask{
|
|
|
|
|
Steps: []*actions_model.ActionTaskStep{
|
|
|
|
|
{Status: actions_model.StatusSuccess, LogIndex: 10, LogLength: 80, Started: 10010, Stopped: 10090},
|
|
|
|
|
},
|
|
|
|
|
Status: actions_model.StatusRunning,
|
|
|
|
|
Started: 10000,
|
|
|
|
|
Stopped: 0,
|
|
|
|
|
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: 80, Started: 10010, Stopped: 10090},
|
|
|
|
|
{Name: postStepName, Status: actions_model.StatusRunning, LogIndex: 90, LogLength: 10, Started: 10090, Stopped: 0},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "skipped task",
|
|
|
|
|
task: &actions_model.ActionTask{
|
|
|
|
|
Steps: []*actions_model.ActionTaskStep{
|
|
|
|
|
{Status: actions_model.StatusSkipped, LogIndex: 0, LogLength: 0, Started: 0, Stopped: 0},
|
|
|
|
|
},
|
|
|
|
|
Status: actions_model.StatusSkipped,
|
|
|
|
|
Started: 0,
|
|
|
|
|
Stopped: 0,
|
|
|
|
|
LogLength: 0,
|
|
|
|
|
},
|
|
|
|
|
want: []*actions_model.ActionTaskStep{
|
|
|
|
|
{Name: preStepName, Status: actions_model.StatusSkipped, LogIndex: 0, LogLength: 0, Started: 0, Stopped: 0},
|
|
|
|
|
{Status: actions_model.StatusSkipped, LogIndex: 0, LogLength: 0, Started: 0, Stopped: 0},
|
|
|
|
|
{Name: postStepName, Status: actions_model.StatusSkipped, LogIndex: 0, LogLength: 0, Started: 0, Stopped: 0},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
for _, tt := range tests {
|
|
|
|
|
t.Run(tt.name, func(t *testing.T) {
|
|
|
|
|