Enable color output from integration tests in Docker containers (#16660)

Enable color output from integration tests in Docker containers:

* In run_tests.sh when output is attached to a terminal.
* In shippable/integration.sh using force mode (can be disabled).

Also fix blocks tests to work with or without color output
This commit is contained in:
Gennady Trafimenkov 2016-07-26 01:07:15 +04:00 committed by Matt Clay
commit ad24f2d206
3 changed files with 18 additions and 4 deletions

View file

@ -13,6 +13,10 @@ http_image="${HTTP_IMAGE:-ansible/ansible:httptester}"
keep_containers="${KEEP_CONTAINERS:-}"
copy_source="${COPY_SOURCE:-}"
# Force ansible color output by default.
# To disable color force mode use FORCE_COLOR=0
force_color="${FORCE_COLOR:-1}"
if [ "${SHIPPABLE_BUILD_DIR:-}" ]; then
host_shared_dir="/home/shippable/cache/build-${BUILD_NUMBER}"
controller_shared_dir="/home/shippable/cache/build-${BUILD_NUMBER}"
@ -69,6 +73,7 @@ fi
httptester_id=$(docker run -d "${http_image}")
container_id=$(docker run -d \
--env "ANSIBLE_FORCE_COLOR=${force_color}" \
-v "/sys/fs/cgroup:/sys/fs/cgroup:ro" \
-v "${host_shared_dir}:${test_shared_dir}" \
--link="${httptester_id}:ansible.http.tests" \