From 0ce83af800be1d8d16f6c31785dab3835befc77d Mon Sep 17 00:00:00 2001 From: Nuwan Goonasekera Date: Mon, 11 Dec 2017 13:07:25 +0530 Subject: [PATCH] Wait for galaxy to come up before running tests --- .travis.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.travis.yml b/.travis.yml index 6bd7e5f..9e57ade 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,6 +22,11 @@ install: # Use the Galaxy Docker image to test the role - docker run --name galaxy -d -p 8080:80 quay.io/bgruening/galaxy + # Wait for web server port to come up + - ansible localhost -c local -m wait_for -a "port=8080 delay=5 state=started timeout=150" + + # Wait for Galaxy to respond + - ansible localhost -c local -m uri -a "url=http://localhost:8080/ register=result until='result.status[0] in [\"2\", \"3\"]' retries=50 delay=3 ignore_error=True" script: # Check the role works in the test playbook. - ansible-playbook -i "localhost," -c local -e galaxy_tools_galaxy_instance_url=http://127.0.0.1:8080 -e galaxy_runs_in_docker=yes -e galaxy_tools_api_key=admin test_playbook.yml