@@ -145,6 +145,7 @@ def create_dir():
145
145
146
146
# Take a screenshot using the webdriver
147
147
def take_screenshot (endpoint ,container_tag ):
148
+ print ('Taking screenshot of ' + container_tag + ' at ' + endpoint )
148
149
try :
149
150
requests .get (endpoint , timeout = 3 )
150
151
driver .get (endpoint )
@@ -162,6 +163,7 @@ def take_screenshot(endpoint,container_tag):
162
163
# Main container test logic
163
164
def container_test (tag ):
164
165
# Start the container
166
+ print ('Starting ' tag )
165
167
container = client .containers .run (image + ':' + tag ,
166
168
detach = True ,
167
169
environment = dockerenv )
@@ -179,8 +181,10 @@ def container_test(tag):
179
181
print (error )
180
182
remove_container (container )
181
183
if logsfound == True :
184
+ print ('Startup completed for ' tag )
182
185
report_tests .append (['Startup ' + tag ,'PASS' ])
183
186
elif logsfound == False :
187
+ print ('Startup failed for ' tag )
184
188
report_tests .append (['Startup ' + tag ,'FAIL INIT NOT FINISHED' ])
185
189
mark_fail ()
186
190
if screenshot == 'true' :
@@ -195,6 +199,7 @@ def container_test(tag):
195
199
ip = container .attrs ["NetworkSettings" ]["Networks" ]["bridge" ]["IPAddress" ]
196
200
take_screenshot (proto + webauth + '@' + ip + ':' + port + webpath ,tag )
197
201
# Dump package information
202
+ print ('Dumping package info for ' tag )
198
203
if base == 'alpine' :
199
204
command = 'apk info -v'
200
205
elif base == 'debian' or base == 'ubuntu' :
@@ -203,6 +208,7 @@ def container_test(tag):
203
208
info = container .exec_run (command )
204
209
packages = info [1 ].decode ("utf-8" )
205
210
report_tests .append (['Dump Versions ' + tag ,'PASS' ])
211
+ print ('Got Package info for ' tag )
206
212
except Exception as error :
207
213
print (error )
208
214
report_tests .append (['Dump Versions ' + tag ,'FAIL' ])
@@ -228,6 +234,7 @@ def container_test(tag):
228
234
229
235
# Render the markdown file for upload
230
236
def report_render ():
237
+ print ('Rendering Report' )
231
238
with open (os .path .dirname (os .path .realpath (__file__ )) + '/results.template' ) as file_ :
232
239
template = Template (file_ .read ())
233
240
markdown = template .render (
@@ -252,6 +259,7 @@ def badge_render():
252
259
253
260
# Upload report to DO Spaces
254
261
def report_upload ():
262
+ print ('Uploading Report' )
255
263
destination_dir = image + '/' + meta_tag + '/'
256
264
latest_dir = image + '/latest/'
257
265
spaces = session .client (
@@ -314,6 +322,8 @@ def report_upload():
314
322
report_upload ()
315
323
# Exit based on test results
316
324
if report_status == 'PASS' :
325
+ print ('Tests Passed exiting 0' )
317
326
sys .exit (0 )
318
327
elif report_status == 'FAIL' :
328
+ print ('Tests Failed exiting 1' )
319
329
sys .exit (1 )
0 commit comments