Skip to content
Snippets Groups Projects
Commit 4e744ba9 authored by Ryan Sanford's avatar Ryan Sanford
Browse files

Define supported dockerized test execution

parent 7727e13c
No related branches found
No related tags found
No related merge requests found
......@@ -67,6 +67,9 @@ RUN pip install --upgrade pip wheel setuptools \
&& pip install -r /var/scitran/code/api/requirements-docker.txt \
&& pip install -r /var/scitran/code/api/requirements.txt
COPY test /var/scitran/code/api/test/
RUN bash -e -x /var/scitran/code/api/test/bin/setup-integration-tests-ubuntu.sh
# Copy full repo
#
......
......@@ -12,6 +12,32 @@
./test/bin/run-tests-ubuntu.sh
```
### Docker
```
# Execute this from the root of this repository
# Build the docker image
docker build -t scitran-core .
# Launch Mongo isinstance
docker run --name some-mongo -d mongo
# Execute tests
docker run \
--rm \
--name scitran-core-tester \
-e "SCITRAN_PERSISTENT_DB_URI=mongodb://some-mongo:27017/scitran" \
--link some-mongo \
-v $(pwd):/var/scitran/code/api \
--entrypoint bash \
scitran-core \
/var/scitran/code/api/test/bin/run-tests-ubuntu.sh
# Stop and remove mongo container
docker rm -v -f some-mongo
```
### Tools
- [abao](https://github.com/cybertk/abao/)
- [postman](https://www.getpostman.com/docs/)
......
FROM python:2.7
ENV MONGO_PATH='mongodb://mongo:27017/scitran'
ENV BASE_URL='http://scitran-core:8080/api'
VOLUME /usr/src/tests
WORKDIR /usr/src/tests
COPY integration_tests/requirements-integration-test.txt requirements.txt
RUN pip install -r requirements.txt
# Install node for testing tools
# We need node >= 4.0 for newman so install from node-source repo
# Need to install apt support for https to access these urls
RUN apt-get update && apt-get install -y apt-transport-https
RUN curl --silent https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add -
RUN echo "deb https://deb.nodesource.com/node_5.x trusty main" | tee /etc/apt/sources.list.d/nodesource.list
RUN echo "deb-src https://deb.nodesource.com/node_5.x trusty main" | tee -a /etc/apt/sources.list.d/nodesource.list
RUN apt-get update && apt-get -y install nodejs
# Install newman for running postman collection tests from CLI
RUN npm install -g /usr/src/tests
ENTRYPOINT ["py.test"]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment