Commit b328c5c2 authored by Georges Racinet's avatar Georges Racinet 🦑
Browse files

initial setup: more useful logging

when using `log_cli=True`, it's nicer to see the real progression
of the Heptapod server preparations or resuming.
parent d6b894e2dcee
......@@ -120,6 +120,7 @@ class Heptapod:
In that latter case, an amount of extra wait after the first successful
HTTP response is often needed.
"""
logger.info("Waiting for Heptapod to answer requests")
dead_msg = ("Heptapod server did not "
"respond in %s seconds" % first_response_timeout)
start = time.time()
......@@ -141,7 +142,6 @@ class Heptapod:
"after first successful HTTP call",
wait_after_first_response)
time.sleep(wait_after_first_response)
logger.info("Proceeding with tests")
return
duration = 1
......@@ -167,27 +167,34 @@ class Heptapod:
if self.dead is None:
self.wait_startup(
wait_after_first_response=self.wait_after_first_response)
logger.info("Preparing root user.")
root = self.users['root'] = {}
driver = self.new_webdriver()
# guaranteeing driver to be available for teardown as soon as created
root['webdriver'] = driver
session.login_as_root(driver, self, root_password)
logger.info("Preparing application settings.")
# necessary if we want to listen to web hooks from these tests
# in GitLab v12.2.0, this is deprecated for ...from_web_hooks...
self.set_application_settings(
allow_local_requests_from_hooks_and_services="true")
logger.info("Preparing basic user.")
basic, driver = session.ensure_user(self, 'test_basic',
fullname='Bäsîc Test',
password='test_basic')
self.users[basic.name]['id'] = basic.id
self.users[basic.name]['webdriver'] = driver
logger.info("Uploading users SSH keys.")
self.load_ssh_keys()
self.upload_ssh_pub_keys()
subprocess.call((
'ssh-keygen',
'-R', '[{host}]:{port}'.format(
host=self.host, port=self.ssh_port)))
logger.info("All preparations done, proceeding with tests.")
def set_application_settings(self, **settings):
"""Change GitLab application settings and update :attr:`settings`."""
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment