mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 22:02:50 +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
@@ -30,7 +30,14 @@ else
|
||||
fi
|
||||
export C_NAME="testAbull_$$_$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 8 | head -n 1)"
|
||||
docker pull ansible/ansible:${TARGET}
|
||||
docker run -d --volume="${PWD}:/root/ansible:Z" $LINKS --name "${C_NAME}" --env HTTPTESTER=1 ${TARGET_OPTIONS:=''} ansible/ansible:${TARGET} > /tmp/cid_${TARGET}
|
||||
|
||||
# enable colors if output is going to a terminal
|
||||
COLOR_SETTINGS=""
|
||||
if [ -t 1 ]; then
|
||||
COLOR_SETTINGS="--env TERM=$TERM"
|
||||
fi
|
||||
|
||||
docker run -d --volume="${PWD}:/root/ansible:Z" $LINKS --name "${C_NAME}" $COLOR_SETTINGS --env HTTPTESTER=1 ${TARGET_OPTIONS:=''} ansible/ansible:${TARGET} > /tmp/cid_${TARGET}
|
||||
docker exec -ti $(cat /tmp/cid_${TARGET}) /bin/sh -c "export TEST_FLAGS='${TEST_FLAGS:-''}'; cd /root/ansible; . hacking/env-setup; (cd test/integration; LC_ALL=en_US.utf-8 make ${MAKE_TARGET:-})"
|
||||
docker kill $(cat /tmp/cid_${TARGET})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user