diff options
author | drebs <drebs@leap.se> | 2016-06-06 20:43:59 -0300 |
---|---|---|
committer | drebs <drebs@leap.se> | 2016-06-06 21:40:44 -0300 |
commit | 57e21dc89f1cc5e34261da75d939e53edd3d5a2b (patch) | |
tree | 441f960a5a06df0985a8d930cba58f36384528cf | |
parent | 7ee12a38d6e8230525f3401abdbd3def4d81502b (diff) |
[test] add rule for running trial tests in a docker container
-rw-r--r-- | scripts/docker/Dockerfile | 1 | ||||
-rw-r--r-- | scripts/docker/Makefile | 7 | ||||
-rwxr-xr-x | scripts/docker/files/start-trial-test.sh | 19 |
3 files changed, 27 insertions, 0 deletions
diff --git a/scripts/docker/Dockerfile b/scripts/docker/Dockerfile index 24bfff30..8b7dcb71 100644 --- a/scripts/docker/Dockerfile +++ b/scripts/docker/Dockerfile @@ -39,4 +39,5 @@ COPY files/client_side_db.py /usr/local/soledad/ COPY files/util.py /usr/local/soledad/ COPY files/start-server.sh /usr/local/soledad/ COPY files/start-client-test.sh /usr/local/soledad/ +COPY files/start-trial-test.sh /usr/local/soledad/ COPY files/conf/* /usr/local/soledad/conf/ diff --git a/scripts/docker/Makefile b/scripts/docker/Makefile index 9b9ab8f7..872bdc40 100644 --- a/scripts/docker/Makefile +++ b/scripts/docker/Makefile @@ -50,6 +50,13 @@ run-client-test: $(IMAGE_NAME) \ /usr/local/soledad/start-client-test.sh +run-trial-test: + docker run -t -i \ + --env="SOLEDAD_REMOTE=$(SOLEDAD_REMOTE)" \ + --env="SOLEDAD_BRANCH=$(SOLEDAD_BRANCH)" \ + $(IMAGE_NAME) \ + /usr/local/soledad/start-trial-test.sh + run-shell: image docker run -t -i $(IMAGE_NAME) /bin/bash diff --git a/scripts/docker/files/start-trial-test.sh b/scripts/docker/files/start-trial-test.sh new file mode 100755 index 00000000..98b09e53 --- /dev/null +++ b/scripts/docker/files/start-trial-test.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +# Run Soledad tests. + +CMD="/usr/local/soledad/test-env.py" +REPO="/var/local/soledad" + +if [ ! -z "${SOLEDAD_REMOTE}" ]; then + git -C ${REPO} remote add test ${SOLEDAD_REMOTE} + git -C ${REPO} fetch test +fi + +if [ ! -z "${SOLEDAD_BRANCH}" ]; then + git -C ${REPO} checkout ${SOLEDAD_BRANCH} +fi + +${CMD} couch start + +trial leap.soledad.common |