@@ -57,9 +57,16 @@ def _on_result_for(self, test, result):
57
57
58
58
59
59
class ProgressIndicator (base .TestProcObserver ):
60
+ def __init__ (self ):
61
+ super (base .TestProcObserver , self ).__init__ ()
62
+ self .options = None
63
+
60
64
def finished (self ):
61
65
pass
62
66
67
+ def configure (self , options ):
68
+ self .options = options
69
+
63
70
64
71
class SimpleProgressIndicator (ProgressIndicator ):
65
72
def __init__ (self ):
@@ -114,8 +121,7 @@ def _print(self, text):
114
121
sys .stdout .flush ()
115
122
self ._last_printed_time = time .time ()
116
123
117
- def _on_result_for (self , test , result ):
118
- super (VerboseProgressIndicator , self )._on_result_for (test , result )
124
+ def _message (self , test , result ):
119
125
# TODO(majeski): Support for dummy/grouped results
120
126
if result .has_unexpected_output :
121
127
if result .output .HasCrashed ():
@@ -124,9 +130,12 @@ def _on_result_for(self, test, result):
124
130
outcome = 'FAIL'
125
131
else :
126
132
outcome = 'pass'
133
+ return 'Done running %s %s: %s' % (
134
+ test , test .variant or 'default' , outcome )
127
135
128
- self ._print ('Done running %s %s: %s' % (
129
- test , test .variant or 'default' , outcome ))
136
+ def _on_result_for (self , test , result ):
137
+ super (VerboseProgressIndicator , self )._on_result_for (test , result )
138
+ self ._print (self ._message (test , result ))
130
139
131
140
# TODO(machenbach): Remove this platform specific hack and implement a proper
132
141
# feedback channel from the workers, providing which tests are currently run.
@@ -155,6 +164,14 @@ def _on_event(self, event):
155
164
self ._print_processes_linux ()
156
165
157
166
167
+ class CIProgressIndicator (VerboseProgressIndicator ):
168
+ def _on_result_for (self , test , result ):
169
+ super (VerboseProgressIndicator , self )._on_result_for (test , result )
170
+ if self .options .ci_test_completion :
171
+ with open (self .options .ci_test_completion , "a" ) as f :
172
+ f .write (self ._message (test , result ) + "\n " )
173
+
174
+
158
175
class DotsProgressIndicator (SimpleProgressIndicator ):
159
176
def __init__ (self ):
160
177
super (DotsProgressIndicator , self ).__init__ ()
0 commit comments