mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 13:52:54 +00:00
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:
committed by
Matt Clay
parent
7e54c9a468
commit
ad24f2d206
@@ -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" \
|
||||
|
||||
Reference in New Issue
Block a user