Add Python 3 CI support. (#17209)
This commit is contained in:
parent
a9322e8b8b
commit
e2e7390adc
4 changed files with 134 additions and 0 deletions
61
test/utils/docker/ubuntu1604py3/Dockerfile
Normal file
61
test/utils/docker/ubuntu1604py3/Dockerfile
Normal file
|
@ -0,0 +1,61 @@
|
||||||
|
FROM ubuntu:16.04
|
||||||
|
|
||||||
|
RUN apt-get update -y && \
|
||||||
|
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
|
||||||
|
acl \
|
||||||
|
apache2 \
|
||||||
|
bzip2 \
|
||||||
|
curl \
|
||||||
|
debhelper \
|
||||||
|
debianutils \
|
||||||
|
devscripts \
|
||||||
|
docbook-xml \
|
||||||
|
dpkg-dev \
|
||||||
|
fakeroot \
|
||||||
|
gawk \
|
||||||
|
git \
|
||||||
|
iproute2 \
|
||||||
|
libxml2-utils \
|
||||||
|
locales \
|
||||||
|
lsb-release \
|
||||||
|
make \
|
||||||
|
mysql-server \
|
||||||
|
openssh-client \
|
||||||
|
openssh-server \
|
||||||
|
python3-coverage \
|
||||||
|
python3-dbus \
|
||||||
|
python3-httplib2 \
|
||||||
|
python3-jinja2 \
|
||||||
|
python3-mock \
|
||||||
|
python3-mysqldb \
|
||||||
|
python3-nose \
|
||||||
|
python3-paramiko \
|
||||||
|
python3-passlib \
|
||||||
|
python3-pip \
|
||||||
|
python3-setuptools \
|
||||||
|
python3-virtualenv \
|
||||||
|
python3-wheel \
|
||||||
|
python3-yaml \
|
||||||
|
reprepro \
|
||||||
|
rsync \
|
||||||
|
ruby \
|
||||||
|
subversion \
|
||||||
|
sudo \
|
||||||
|
unzip \
|
||||||
|
virtualenv \
|
||||||
|
xsltproc \
|
||||||
|
zip \
|
||||||
|
&& \
|
||||||
|
apt-get clean
|
||||||
|
|
||||||
|
RUN rm /etc/apt/apt.conf.d/docker-clean
|
||||||
|
RUN mkdir /etc/ansible/
|
||||||
|
RUN /bin/echo -e "[local]\nlocalhost ansible_connection=local" > /etc/ansible/hosts
|
||||||
|
RUN locale-gen en_US.UTF-8
|
||||||
|
RUN ssh-keygen -q -t rsa -N '' -f /root/.ssh/id_rsa && \
|
||||||
|
cp /root/.ssh/id_rsa.pub /root/.ssh/authorized_keys && \
|
||||||
|
for key in /etc/ssh/ssh_host_*_key.pub; do echo "localhost $(cat ${key})" >> /root/.ssh/known_hosts; done
|
||||||
|
VOLUME /sys/fs/cgroup /run/lock /run /tmp
|
||||||
|
RUN pip3 install junit-xml python3-keyczar
|
||||||
|
ENV container=docker
|
||||||
|
CMD ["/sbin/init"]
|
|
@ -7,6 +7,7 @@ test_privileged="${PRIVILEGED:-false}"
|
||||||
test_flags="${TEST_FLAGS:-}"
|
test_flags="${TEST_FLAGS:-}"
|
||||||
test_target="${TARGET:-}"
|
test_target="${TARGET:-}"
|
||||||
test_ansible_dir="${TEST_ANSIBLE_DIR:-/root/ansible}"
|
test_ansible_dir="${TEST_ANSIBLE_DIR:-/root/ansible}"
|
||||||
|
test_python3="${PYTHON3:-}"
|
||||||
|
|
||||||
http_image="${HTTP_IMAGE:-ansible/ansible:httptester}"
|
http_image="${HTTP_IMAGE:-ansible/ansible:httptester}"
|
||||||
|
|
||||||
|
@ -85,12 +86,26 @@ container_id=$(docker run -d \
|
||||||
|
|
||||||
show_environment
|
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
|
docker exec "${container_id}" pip install jmespath
|
||||||
|
|
||||||
if [ "${copy_source}" ]; then
|
if [ "${copy_source}" ]; then
|
||||||
docker exec "${container_id}" cp -a "${test_shared_dir}" "${test_ansible_dir}"
|
docker exec "${container_id}" cp -a "${test_shared_dir}" "${test_ansible_dir}"
|
||||||
fi
|
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}" mkdir -p "${test_shared_dir}/shippable/testresults"
|
||||||
docker exec "${container_id}" /bin/sh -c "cd '${test_ansible_dir}' && . hacking/env-setup && cd test/integration && \
|
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 \
|
JUNIT_OUTPUT_DIR='${test_shared_dir}/shippable/testresults' ANSIBLE_CALLBACK_WHITELIST=junit \
|
||||||
|
|
44
test/utils/shippable/python3-test-tag-blacklist.txt
Normal file
44
test/utils/shippable/python3-test-tag-blacklist.txt
Normal file
|
@ -0,0 +1,44 @@
|
||||||
|
test_apache2_module
|
||||||
|
test_apt
|
||||||
|
test_apt_repository
|
||||||
|
test_assemble
|
||||||
|
test_async
|
||||||
|
test_authorized_key
|
||||||
|
test_become
|
||||||
|
test_binary
|
||||||
|
test_changed_when
|
||||||
|
test_command_shell
|
||||||
|
test_conditionals
|
||||||
|
test_copy
|
||||||
|
test_embedded_module
|
||||||
|
test_facts_d
|
||||||
|
test_failed_when
|
||||||
|
test_fetch
|
||||||
|
test_file
|
||||||
|
test_filters
|
||||||
|
test_gem
|
||||||
|
test_get_url
|
||||||
|
test_git
|
||||||
|
test_good_parsing
|
||||||
|
test_handlers
|
||||||
|
test_hg
|
||||||
|
test_iterators
|
||||||
|
test_lineinfile
|
||||||
|
test_lookups
|
||||||
|
test_mysql_db
|
||||||
|
test_mysql_user
|
||||||
|
test_mysql_variables
|
||||||
|
test_pip
|
||||||
|
test_postgresql
|
||||||
|
test_service
|
||||||
|
test_special_vars
|
||||||
|
test_stat
|
||||||
|
test_subversion
|
||||||
|
test_sudo
|
||||||
|
test_synchronize
|
||||||
|
test_task_ordering
|
||||||
|
test_template
|
||||||
|
test_unarchive
|
||||||
|
test_until
|
||||||
|
test_uri
|
||||||
|
test_var_blending
|
14
test/utils/shippable/python3-test-target-blacklist.txt
Normal file
14
test/utils/shippable/python3-test-target-blacklist.txt
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
s/ check_mode / /
|
||||||
|
s/ environment / /
|
||||||
|
s/ includes / /
|
||||||
|
s/ no_log / /
|
||||||
|
s/ pull / /
|
||||||
|
s/ test_async_conditional / /
|
||||||
|
s/ test_binary_modules$/ /
|
||||||
|
s/ test_connection / /
|
||||||
|
s/ test_handlers / /
|
||||||
|
s/ test_hash / /
|
||||||
|
s/ test_lookup_paths / /
|
||||||
|
s/ test_var_precedence / /
|
||||||
|
s/ test_vault / /
|
||||||
|
s/ unicode / /
|
Loading…
Reference in a new issue