Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Python 3 CI support. #17209

Merged
merged 1 commit into from
Aug 24, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
61 changes: 61 additions & 0 deletions test/utils/docker/ubuntu1604py3/Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
15 changes: 15 additions & 0 deletions test/utils/shippable/integration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"

Expand Down Expand Up @@ -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 \
Expand Down
44 changes: 44 additions & 0 deletions test/utils/shippable/python3-test-tag-blacklist.txt
Original file line number Diff line number Diff line change
@@ -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 changes: 14 additions & 0 deletions test/utils/shippable/python3-test-target-blacklist.txt
Original file line number Diff line number Diff line change
@@ -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 / /