@@ -32,11 +32,12 @@ type TransactionRunOutput struct {
32
32
33
33
func (f transactionRun ) Format (output TransactionRunOutput , format Output ) string {
34
34
output .RunWebURL = f .getRunLink (output .Transaction .GetId (), output .Run .GetId ())
35
+
35
36
switch format {
36
- case Pretty :
37
- return f .pretty (output )
38
37
case JSON :
39
38
return f .json (output )
39
+ case Pretty , "" :
40
+ return f .pretty (output )
40
41
}
41
42
42
43
return ""
@@ -77,16 +78,14 @@ func (f transactionRun) json(output TransactionRunOutput) string {
77
78
}
78
79
79
80
func (f transactionRun ) pretty (output TransactionRunOutput ) string {
81
+ message := fmt .Sprintf ("%s %s (%s)\n " , PASSED_TEST_ICON , output .Transaction .GetName (), output .RunWebURL )
80
82
if ! output .HasResults {
81
- return ""
83
+ return f . getColoredText ( true , message )
82
84
}
83
85
84
- link := output .RunWebURL
85
86
allStepsPassed := f .allTransactionStepsPassed (output )
86
- message := fmt .Sprintf ("%s %s (%s)\n " , PASSED_TEST_ICON , output .Transaction .GetName (), link )
87
-
88
87
if ! allStepsPassed {
89
- message = fmt .Sprintf ("%s %s (%s)\n " , FAILED_TEST_ICON , output .Transaction .GetName (), link )
88
+ message = fmt .Sprintf ("%s %s (%s)\n " , FAILED_TEST_ICON , output .Transaction .GetName (), output . RunWebURL )
90
89
}
91
90
92
91
// the transaction name + all steps
@@ -130,5 +129,5 @@ func (f transactionRun) getColoredText(passed bool, text string) string {
130
129
}
131
130
132
131
func (f transactionRun ) getRunLink (transactionID , runID string ) string {
133
- return fmt .Sprintf ("%s://%s /transaction/%s/run/%s" , f .baseURL , transactionID , runID )
132
+ return fmt .Sprintf ("%s/transaction/%s/run/%s" , f .baseURL , transactionID , runID )
134
133
}
0 commit comments