Skip to content

Commit

Permalink
Merge pull request ansible#3932 from shanemcd/zuul_k8s
Browse files Browse the repository at this point in the history
Changes to enable tests in k8s

Reviewed-by: https://github.com/softwarefactory-project-zuul[bot]
  • Loading branch information
softwarefactory-project-zuul[bot] authored May 28, 2019
2 parents 5a502f8 + 2f77c67 commit 8c56d1d
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 107 deletions.
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,7 @@ pylint: reports

genschema: reports
$(MAKE) swagger PYTEST_ARGS="--genschema"
mv swagger.json schema.json

swagger: reports
@if [ "$(VENV_BASE)" ]; then \
Expand Down Expand Up @@ -496,6 +497,10 @@ ui-devel: $(UI_DEPS_FLAG_FILE)
ui-test: $(UI_DEPS_FLAG_FILE)
$(NPM_BIN) --prefix awx/ui run test

ui-lint: $(UI_DEPS_FLAG_FILE)
$(NPM_BIN) run --prefix awx/ui jshint
$(NPM_BIN) run --prefix awx/ui lint

# A standard go-to target for API developers to use building the frontend
ui: clean-ui ui-devel

Expand Down Expand Up @@ -572,12 +577,7 @@ docker-compose-runtest:
docker-compose-build-swagger:
cd tools && CURRENT_UID=$(shell id -u) TAG=$(COMPOSE_TAG) DEV_DOCKER_TAG_BASE=$(DEV_DOCKER_TAG_BASE) docker-compose run --rm --service-ports awx /start_tests.sh swagger

docker-compose-genschema:
cd tools && CURRENT_UID=$(shell id -u) TAG=$(COMPOSE_TAG) DEV_DOCKER_TAG_BASE=$(DEV_DOCKER_TAG_BASE) docker-compose run --rm --service-ports awx /start_tests.sh genschema
mv swagger.json schema.json

docker-compose-detect-schema-change:
$(MAKE) docker-compose-genschema
detect-schema-change: genschema
curl https://s3.amazonaws.com/awx-public-ci-files/schema.json -o reference-schema.json
# Ignore differences in whitespace with -b
diff -u -b reference-schema.json schema.json
Expand Down
10 changes: 0 additions & 10 deletions awx/main/tests/functional/api/test_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,16 +386,6 @@ def test_saml_x509cert_validation(patch, get, admin, headers):
assert resp.status_code == 200


@pytest.mark.django_db
def test_default_broker_url():
url = parse_url(settings.BROKER_URL)
assert url['transport'] == 'amqp'
assert url['hostname'] == 'rabbitmq'
assert url['userid'] == 'guest'
assert url['password'] == 'guest'
assert url['virtual_host'] == '/'


@pytest.mark.django_db
def test_broker_url_with_special_characters():
settings.BROKER_URL = 'amqp://guest:a@ns:ibl3#@rabbitmq:5672//'
Expand Down
26 changes: 23 additions & 3 deletions tools/docker-compose/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,20 @@ RUN yum -y update && yum -y install epel-release

# sync with installer/roles/image_build/templates/Dockerfile.j2
RUN yum -y install acl \
alsa-lib \
ansible \
atk \
bubblewrap \
cups-libs \
curl \
cyrus-sasl \
cyrus-sasl-devel \
gcc \
gcc-c++ \
GConf2 \
git \
gtk3 \
ipa-gothic-fonts \
krb5-devel \
krb5-libs \
krb5-workstation \
Expand All @@ -22,8 +28,16 @@ RUN yum -y install acl \
libselinux-python \
libstdc++.so.6 \
libtool-ltdl-devel \
libXcomposite \
libXcursor \
libXdamage \
libXext \
libXi \
libxml2-devel \
libXrandr \
libXScrnSaver \
libxslt-devel \
libXtst \
make \
mercurial \
mg \
Expand All @@ -34,7 +48,6 @@ RUN yum -y install acl \
postgresql-devel \
python-devel \
python-pip \
python-pip \
python-psutil \
python-psycopg2 \
python-setuptools \
Expand All @@ -52,6 +65,12 @@ RUN yum -y install acl \
xmlsec1-devel \
xmlsec1-openssl \
xmlsec1-openssl-devel \
xorg-x11-fonts-100dpi \
xorg-x11-fonts-75dpi \
xorg-x11-fonts-cyrillic \
xorg-x11-fonts-misc \
xorg-x11-fonts-Type1 \
xorg-x11-utils \
yum-utils

ADD https://github.com/krallin/tini/releases/download/v0.14.0/tini /tini
Expand All @@ -67,7 +86,7 @@ ADD tools/docker-compose/awx.egg-info /tmp/awx.egg-info
RUN openssl req -nodes -newkey rsa:2048 -keyout /etc/nginx/nginx.key -out /etc/nginx/nginx.csr -subj "/C=US/ST=North Carolina/L=Durham/O=Ansible/OU=AWX Development/CN=awx.localhost"
RUN openssl x509 -req -days 365 -in /etc/nginx/nginx.csr -signkey /etc/nginx/nginx.key -out /etc/nginx/nginx.crt

RUN python3 -m ensurepip && pip3 install virtualenv
RUN python3 -m ensurepip && pip3 install virtualenv flake8
RUN pip install supervisor

ADD Makefile /tmp/Makefile
Expand All @@ -86,7 +105,6 @@ RUN cd /tmp && VENV_BASE="/venv" make requirements_dev
# Use the distro provided npm to bootstrap our required version of node
RUN npm install -g n
RUN n 8.15.0
ENV PATH /usr/bin:/usr/local/n/versions/node/8.15.0/bin:$PATH

RUN yum -y remove cyrus-sasl-devel \
gcc \
Expand Down Expand Up @@ -131,3 +149,5 @@ RUN for dir in /var/lib/awx/ /var/log/tower/ /projects /.ansible /var/log/nginx
RUN for file in /etc/passwd /etc/supervisord.conf \
/venv/awx/lib/python3.6/site-packages/awx.egg-link /var/run/nginx.pid; \
do touch $file; chmod -R g+rwx $file; chgrp -R root $file; done

ENV PATH=/usr/local/n/versions/node/8.15.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
6 changes: 0 additions & 6 deletions tools/docker-compose/start_tests.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
#!/bin/bash
set +x

if [ `id -u` -ge 500 ] || [ -z "${CURRENT_UID}" ]; then
echo "awx:x:`id -u`:`id -g`:,,,:/tmp:/bin/bash" >> /tmp/passwd
cat /tmp/passwd > /etc/passwd
rm /tmp/passwd
fi

cd /awx_devel
make clean
cp -R /tmp/awx.egg-info /awx_devel/ || true
Expand Down
82 changes: 0 additions & 82 deletions tox.ini

This file was deleted.

0 comments on commit 8c56d1d

Please sign in to comment.