Skip to content

Commit 4f68d68

Browse files
committed
adding logging to the test process
1 parent 55bb63f commit 4f68d68

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

ci/ci.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ def create_dir():
145145

146146
# Take a screenshot using the webdriver
147147
def take_screenshot(endpoint,container_tag):
148+
print('Taking screenshot of ' + container_tag + ' at ' + endpoint)
148149
try:
149150
requests.get(endpoint, timeout=3)
150151
driver.get(endpoint)
@@ -162,6 +163,7 @@ def take_screenshot(endpoint,container_tag):
162163
# Main container test logic
163164
def container_test(tag):
164165
# Start the container
166+
print('Starting ' tag)
165167
container = client.containers.run(image + ':' + tag,
166168
detach=True,
167169
environment=dockerenv)
@@ -179,8 +181,10 @@ def container_test(tag):
179181
print(error)
180182
remove_container(container)
181183
if logsfound == True:
184+
print('Startup completed for ' tag)
182185
report_tests.append(['Startup ' + tag,'PASS'])
183186
elif logsfound == False:
187+
print('Startup failed for ' tag)
184188
report_tests.append(['Startup ' + tag,'FAIL INIT NOT FINISHED'])
185189
mark_fail()
186190
if screenshot == 'true':
@@ -195,6 +199,7 @@ def container_test(tag):
195199
ip = container.attrs["NetworkSettings"]["Networks"]["bridge"]["IPAddress"]
196200
take_screenshot(proto + webauth + '@' + ip + ':' + port + webpath ,tag)
197201
# Dump package information
202+
print('Dumping package info for ' tag)
198203
if base == 'alpine':
199204
command = 'apk info -v'
200205
elif base == 'debian' or base == 'ubuntu':
@@ -203,6 +208,7 @@ def container_test(tag):
203208
info = container.exec_run(command)
204209
packages = info[1].decode("utf-8")
205210
report_tests.append(['Dump Versions ' + tag,'PASS'])
211+
print('Got Package info for ' tag)
206212
except Exception as error:
207213
print(error)
208214
report_tests.append(['Dump Versions ' + tag,'FAIL'])
@@ -228,6 +234,7 @@ def container_test(tag):
228234

229235
# Render the markdown file for upload
230236
def report_render():
237+
print('Rendering Report')
231238
with open(os.path.dirname(os.path.realpath(__file__)) + '/results.template') as file_:
232239
template = Template(file_.read())
233240
markdown = template.render(
@@ -252,6 +259,7 @@ def badge_render():
252259

253260
# Upload report to DO Spaces
254261
def report_upload():
262+
print('Uploading Report')
255263
destination_dir = image + '/' + meta_tag + '/'
256264
latest_dir = image + '/latest/'
257265
spaces = session.client(
@@ -314,6 +322,8 @@ def report_upload():
314322
report_upload()
315323
# Exit based on test results
316324
if report_status == 'PASS':
325+
print('Tests Passed exiting 0')
317326
sys.exit(0)
318327
elif report_status == 'FAIL':
328+
print('Tests Failed exiting 1')
319329
sys.exit(1)

0 commit comments

Comments
 (0)