@@ -103,6 +103,40 @@ func TestFullSteps(t *testing.T) {
103103{Name : postStepName , Status : actions_model .StatusSuccess , LogIndex : 100 , LogLength : 0 , Started : 10100 , Stopped : 10100 },
104104},
105105},
106+ {
107+ name : "all steps finished but task is running" ,
108+ task : & actions_model.ActionTask {
109+ Steps : []* actions_model.ActionTaskStep {
110+ {Status : actions_model .StatusSuccess , LogIndex : 10 , LogLength : 80 , Started : 10010 , Stopped : 10090 },
111+ },
112+ Status : actions_model .StatusRunning ,
113+ Started : 10000 ,
114+ Stopped : 0 ,
115+ LogLength : 100 ,
116+ },
117+ want : []* actions_model.ActionTaskStep {
118+ {Name : preStepName , Status : actions_model .StatusSuccess , LogIndex : 0 , LogLength : 10 , Started : 10000 , Stopped : 10010 },
119+ {Status : actions_model .StatusSuccess , LogIndex : 10 , LogLength : 80 , Started : 10010 , Stopped : 10090 },
120+ {Name : postStepName , Status : actions_model .StatusRunning , LogIndex : 90 , LogLength : 10 , Started : 10090 , Stopped : 0 },
121+ },
122+ },
123+ {
124+ name : "skipped task" ,
125+ task : & actions_model.ActionTask {
126+ Steps : []* actions_model.ActionTaskStep {
127+ {Status : actions_model .StatusSkipped , LogIndex : 0 , LogLength : 0 , Started : 0 , Stopped : 0 },
128+ },
129+ Status : actions_model .StatusSkipped ,
130+ Started : 0 ,
131+ Stopped : 0 ,
132+ LogLength : 0 ,
133+ },
134+ want : []* actions_model.ActionTaskStep {
135+ {Name : preStepName , Status : actions_model .StatusSkipped , LogIndex : 0 , LogLength : 0 , Started : 0 , Stopped : 0 },
136+ {Status : actions_model .StatusSkipped , LogIndex : 0 , LogLength : 0 , Started : 0 , Stopped : 0 },
137+ {Name : postStepName , Status : actions_model .StatusSkipped , LogIndex : 0 , LogLength : 0 , Started : 0 , Stopped : 0 },
138+ },
139+ },
106140}
107141for _ , tt := range tests {
108142t .Run (tt .name , func (t * testing.T ) {
0 commit comments