mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 06:12:51 +00:00
Add Python 3 CI support. (#17209)
This commit is contained in:
@@ -7,6 +7,7 @@ test_privileged="${PRIVILEGED:-false}"
|
||||
test_flags="${TEST_FLAGS:-}"
|
||||
test_target="${TARGET:-}"
|
||||
test_ansible_dir="${TEST_ANSIBLE_DIR:-/root/ansible}"
|
||||
test_python3="${PYTHON3:-}"
|
||||
|
||||
http_image="${HTTP_IMAGE:-ansible/ansible:httptester}"
|
||||
|
||||
@@ -85,12 +86,26 @@ container_id=$(docker run -d \
|
||||
|
||||
show_environment
|
||||
|
||||
if [ "${test_python3}" ]; then
|
||||
docker exec "${container_id}" ln -s /usr/bin/python3 /usr/bin/python
|
||||
docker exec "${container_id}" ln -s /usr/bin/pip3 /usr/bin/pip
|
||||
|
||||
skip_tags=$(tr '\n' ',' < "${source_root}/test/utils/shippable/python3-test-tag-blacklist.txt")
|
||||
test_flags="--skip-tags ${skip_tags} ${test_flags}"
|
||||
fi
|
||||
|
||||
docker exec "${container_id}" pip install jmespath
|
||||
|
||||
if [ "${copy_source}" ]; then
|
||||
docker exec "${container_id}" cp -a "${test_shared_dir}" "${test_ansible_dir}"
|
||||
fi
|
||||
|
||||
if [ "${test_python3}" ]; then
|
||||
docker exec "${container_id}" sed -i -f \
|
||||
"${test_ansible_dir}/test/utils/shippable/python3-test-target-blacklist.txt" \
|
||||
"${test_ansible_dir}/test/integration/Makefile"
|
||||
fi
|
||||
|
||||
docker exec "${container_id}" mkdir -p "${test_shared_dir}/shippable/testresults"
|
||||
docker exec "${container_id}" /bin/sh -c "cd '${test_ansible_dir}' && . hacking/env-setup && cd test/integration && \
|
||||
JUNIT_OUTPUT_DIR='${test_shared_dir}/shippable/testresults' ANSIBLE_CALLBACK_WHITELIST=junit \
|
||||
|
||||
Reference in New Issue
Block a user