mirror of
https://github.com/internetarchive/warcprox.git
synced 2025-01-18 13:22:09 +01:00
spin up rethinkdb in docker, run tests in there
This commit is contained in:
parent
69d641cd50
commit
28d213fb18
21
tests/Dockerfile
Normal file
21
tests/Dockerfile
Normal file
@ -0,0 +1,21 @@
|
||||
FROM phusion/baseimage
|
||||
MAINTAINER Noah Levitt <nlevitt@archive.org>
|
||||
|
||||
# see https://github.com/stuartpb/rethinkdb-dockerfiles/blob/master/trusty/2.1.3/Dockerfile
|
||||
|
||||
ENV LANG=C.UTF-8
|
||||
|
||||
RUN apt-get update && apt-get --auto-remove -y dist-upgrade
|
||||
|
||||
# Add the RethinkDB repository and public key
|
||||
# "RethinkDB Packaging <packaging@rethinkdb.com>" http://download.rethinkdb.com/apt/pubkey.gpg
|
||||
RUN apt-key adv --keyserver pgp.mit.edu --recv-keys 1614552E5765227AEC39EFCFA7E00EF33A8F2399 \
|
||||
&& echo "deb http://download.rethinkdb.com/apt trusty main" > /etc/apt/sources.list.d/rethinkdb.list \
|
||||
&& apt-get update && apt-get -y install rethinkdb
|
||||
|
||||
RUN mkdir -vp /etc/service/rethinkdb \
|
||||
&& echo "#!/bin/sh\nrethinkdb --bind 0.0.0.0 --directory /tmp/rethink-data --runuser rethinkdb --rungroup rethinkdb\n" > /etc/service/rethinkdb/run \
|
||||
&& chmod a+x /etc/service/rethinkdb/run
|
||||
|
||||
RUN apt-get -y install python-virtualenv git
|
||||
RUN apt-get -y install python-gdbm python3-gdbm libpython2.7-dev libpython3.4-dev libffi-dev libssl-dev
|
22
tests/run-tests.sh
Executable file
22
tests/run-tests.sh
Executable file
@ -0,0 +1,22 @@
|
||||
#!/bin/bash
|
||||
|
||||
script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
docker build -t internetarchive/rethinkdb $script_dir || exit 1
|
||||
|
||||
uid=$(id -u)
|
||||
user=$(id -un)
|
||||
|
||||
for python in python2.7 python3.4
|
||||
do
|
||||
docker run --rm -i -t --volume="$script_dir/..:/warcprox" internetarchive/rethinkdb /sbin/my_init -- \
|
||||
bash -x -c "adduser --gecos=$user --disabled-password --quiet --uid=$uid $user \
|
||||
&& sudo -u $user bash -x -c 'cd /warcprox \
|
||||
&& virtualenv -p $python /tmp/venv \
|
||||
&& source /tmp/venv/bin/activate \
|
||||
&& pip --log-file /tmp/pip.log install -r requirements.txt . pytest requests \
|
||||
&& py.test tests \
|
||||
&& py.test --rethinkdb-servers=localhost tests \
|
||||
&& py.test --rethinkdb-servers=localhost --rethinkdb-big-table tests'"
|
||||
done
|
||||
|
Loading…
x
Reference in New Issue
Block a user