@@ -88,24 +88,24 @@ func (o *defaultRunOutput) renderTestXsTable(txs []*models.TestExecution, runnin
8888 for _ , tx := range txs {
8989 var icon , statusText string
9090 switch tx .Status .Phase {
91- case "pending" :
91+ case models . TestexecutionsPhasePending :
9292 icon = runningIcon
9393 statusText = "pending"
94- case "in_progress" :
94+ case models . TestexecutionsPhaseInProgress :
9595 icon = runningIcon
9696 statusText = "running"
97- case "failed" :
97+ case models . TestexecutionsPhaseFailed :
9898 icon = "❌"
9999 statusText = "failed"
100- case "canceled" :
100+ case models . TestexecutionsPhaseCanceled :
101101 icon = "❌"
102102 statusText = "canceled"
103- case "succeeded" :
103+ case models . TestexecutionsPhaseSucceeded :
104104 icon = "✅"
105105 statusText = "completed"
106106 default :
107107 icon = "⚪"
108- statusText = tx .Status .Phase
108+ statusText = string ( tx .Status .Phase )
109109 }
110110 fmt .Fprintf (tw , "%s\t %s\t [ID: %s, STATUS: %s]\n " , icon , truncateTestName (tx .Spec .External .TestName , 48 ),
111111 tx .ID , statusText )
@@ -137,31 +137,31 @@ func (o *defaultRunOutput) renderTestXsSummary(txs []*models.TestExecution) {
137137
138138func (o * defaultRunOutput ) getExecutionsDetails (txs []* models.TestExecution ) string {
139139 total := 0
140- phaseMap := map [string ]int {}
140+ phaseMap := map [models. TestexecutionsPhase ]int {}
141141 for _ , tx := range txs {
142142 total += 1
143143 phaseMap [tx .Status .Phase ] += 1
144144 }
145145
146146 var icon string
147147 switch {
148- case phaseMap ["canceled" ] > 0 || phaseMap ["failed" ] > 0 :
148+ case phaseMap [models . TestexecutionsPhaseCanceled ] > 0 || phaseMap [models . TestexecutionsPhaseFailed ] > 0 :
149149 icon = "❌"
150150 default :
151151 icon = "✅"
152152 }
153153
154- details := fmt .Sprintf ("%s %d/%d tests completed" , icon , phaseMap ["succeeded" ], total )
155- if phaseMap ["succeeded" ] != total {
154+ details := fmt .Sprintf ("%s %d/%d tests completed" , icon , phaseMap [models . TestexecutionsPhaseSucceeded ], total )
155+ if phaseMap [models . TestexecutionsPhaseSucceeded ] != total {
156156 details += " ("
157157 var otherSts []string
158- if phaseMap ["canceled" ] > 0 {
158+ if phaseMap [models . TestexecutionsPhaseCanceled ] > 0 {
159159 otherSts = append (otherSts ,
160- fmt .Sprintf ("%d canceled" , phaseMap ["canceled" ]))
160+ fmt .Sprintf ("%d canceled" , phaseMap [models . TestexecutionsPhaseCanceled ]))
161161 }
162- if phaseMap ["failed" ] > 0 {
162+ if phaseMap [models . TestexecutionsPhaseFailed ] > 0 {
163163 otherSts = append (otherSts ,
164- fmt .Sprintf ("%d failed" , phaseMap ["failed" ]))
164+ fmt .Sprintf ("%d failed" , phaseMap [models . TestexecutionsPhaseFailed ]))
165165 }
166166 details += strings .Join (otherSts , ", " ) + ")"
167167 }
0 commit comments