summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorShane McDonald <shanemcd@redhat.com>2016-09-16 17:15:30 +0200
committerShane McDonald <shanemcd@redhat.com>2016-09-16 17:15:30 +0200
commitba8290a94af4b3707c8f700659e55f3b6b712c2b (patch)
tree2491e44a380a31db36eb3d7d958967bca6605303 /tools
parentAdd a Dockerfile for unittest environment (diff)
downloadawx-ba8290a94af4b3707c8f700659e55f3b6b712c2b.tar.xz
awx-ba8290a94af4b3707c8f700659e55f3b6b712c2b.zip
Fix pip install in unit test container
The SWIG_FEATURES environment variable is to get pip install working with M2Crypto==0.22.3. It works without SWIG_FEATURES if we update to M2Crypto >= 0.23.0. Also did some organization, add README.
Diffstat (limited to 'tools')
-rw-r--r--tools/docker-compose/unit-tests/Dockerfile (renamed from tools/docker-compose/Dockerfile.unittest)11
-rw-r--r--tools/docker-compose/unit-tests/README.md15
-rw-r--r--tools/docker-compose/unit-tests/docker-compose.yml13
3 files changed, 30 insertions, 9 deletions
diff --git a/tools/docker-compose/Dockerfile.unittest b/tools/docker-compose/unit-tests/Dockerfile
index eab785b65a..66f2c54558 100644
--- a/tools/docker-compose/Dockerfile.unittest
+++ b/tools/docker-compose/unit-tests/Dockerfile
@@ -1,11 +1,6 @@
# FROM gcr.io/ansible-tower-engineering/tower_devel:latest
FROM centos
-# RUN locale-gen en_US.UTF-8
-# ENV LANG en_US.UTF-8
-# ENV LANGUAGE en_US:en
-# ENV LC_ALL en_US.UTF-8
-
RUN yum install -y epel-release
RUN yum install -y \
@@ -39,9 +34,7 @@ RUN yum install -y nodejs
RUN npm set progress=false
WORKDIR "/ansible-tower"
-ENV SHELL /bin/bash
-ENV PATH /usr/bin:$PATH
-ENV SWIG_FEATURES="-cpperraswarn -includeall -D__`uname -m`__ -I/usr/include/openssl"
+
ENV VENV_BASE="/venv"
ENTRYPOINT ["/bin/bash", "-c"]
-CMD ["make requirements_test test"]
+CMD ["bash"]
diff --git a/tools/docker-compose/unit-tests/README.md b/tools/docker-compose/unit-tests/README.md
new file mode 100644
index 0000000000..c3fa200d38
--- /dev/null
+++ b/tools/docker-compose/unit-tests/README.md
@@ -0,0 +1,15 @@
+Run from the root of the repo:
+
+```shell
+$ docker-compose -f tools/docker-compose/unit-tests/docker-compose.yml run unit-tests
+```
+
+This will start the container, install the dependencies, and run the unit tests.
+
+If you just want to pop into a shell and poke around, run:
+
+```shell
+$ docker-compose -f tools/docker-compose/unit-tests/docker-compose.yml run unit-tests bash
+```
+
+If you run into any weirdness, it's probably a good idea to just give up and `make clean`.
diff --git a/tools/docker-compose/unit-tests/docker-compose.yml b/tools/docker-compose/unit-tests/docker-compose.yml
new file mode 100644
index 0000000000..77bf989475
--- /dev/null
+++ b/tools/docker-compose/unit-tests/docker-compose.yml
@@ -0,0 +1,13 @@
+---
+version: '2'
+services:
+ unit-tests:
+ build:
+ context: ../../../
+ dockerfile: tools/docker-compose/unit-tests/Dockerfile
+ environment:
+ SWIG_FEATURES: "-cpperraswarn -includeall -I/usr/include/openssl"
+ command: ["make requirements_test test"]
+
+ volumes:
+ - ../../../:/ansible-tower