1
0
mirror of https://github.com/thib8956/nginx-proxy synced 2024-11-22 03:46:29 +00:00

TESTS: improve error reporting for failed to run docker-compose commands

This commit is contained in:
Thomas LEVEIL 2017-02-14 22:30:20 +01:00
parent 6069bc53cd
commit 85370fa31f

View File

@ -263,18 +263,18 @@ def get_nginx_conf_from_container(container):
def docker_compose_up(compose_file='docker-compose.yml'):
logging.info('docker-compose -f %s up -d' % compose_file)
try:
subprocess.check_output(shlex.split('docker-compose -f %s up -d' % compose_file))
subprocess.check_output(shlex.split('docker-compose -f %s up -d' % compose_file), stderr=subprocess.STDOUT)
except subprocess.CalledProcessError, e:
logging.error("Error while runninng 'docker-compose -f %s up -d':\n%s" % (compose_file, e.output))
raise
pytest.fail("Error while runninng 'docker-compose -f %s up -d':\n%s" % (compose_file, e.output), pytrace=False)
def docker_compose_down(compose_file='docker-compose.yml'):
logging.info('docker-compose -f %s down' % compose_file)
try:
subprocess.check_output(shlex.split('docker-compose -f %s down' % compose_file))
subprocess.check_output(shlex.split('docker-compose -f %s down' % compose_file), stderr=subprocess.STDOUT)
except subprocess.CalledProcessError, e:
logging.error("Error while runninng 'docker-compose -f %s down':\n%s" % (compose_file, e.output))
raise
pytest.fail("Error while runninng 'docker-compose -f %s down':\n%s" % (compose_file, e.output), pytrace=False)
def wait_for_nginxproxy_to_be_ready():
"""