Skip to content

Commit

Permalink
Merge pull request #64 from momentumft/fix-integration-tests
Browse files Browse the repository at this point in the history
Fix integration testing
  • Loading branch information
tanuck authored Jun 7, 2017
2 parents c54df99 + 7b1c4b2 commit 6ae9fb2
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 25 deletions.
22 changes: 4 additions & 18 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ services:

env:
matrix:
- DOCKER_VERSION=1.13.1-0~ubuntu-trusty
- DOCKER_VERSION=1.12.6-0~ubuntu-trusty
- DOCKER_TAG=1.13-dind
- DOCKER_TAG=1.12-dind
global:
- DEBUG='navy:*' NAVY_DEBUG='navy:*' DOCKER_COMPOSE_VERSION=1.8.0

Expand All @@ -28,27 +28,13 @@ matrix:

include:
- node_js: 6
env: DOCKER_VERSION=1.11.2-0~trusty
env: DOCKER_TAG=1.11-dind
- node_js: 6
env: DOCKER_VERSION=1.10.3-0~trusty
env: DOCKER_TAG=1.10-dind

before_install:
# list docker-engine versions
- apt-cache madison docker-engine

# upgrade docker-engine to specific version
- sudo apt-get purge -y docker-engine
- sudo apt-get -o Dpkg::Options::="--force-confnew" install -y docker-engine=${DOCKER_VERSION}

# reinstall docker-compose at specific version
- sudo rm /usr/local/bin/docker-compose
- curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose
- chmod +x docker-compose
- sudo mv docker-compose /usr/local/bin

# print versions
- docker --version
- docker-compose --version

before_script:
# bootstrap packages
Expand Down
15 changes: 13 additions & 2 deletions scripts/integration.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,26 @@
set -e

echo ""
echo "SETTING UP ENVIRONMENT"
echo "This may take several minutes to build the necessary docker containers..."
echo "This will only take a while the first time you run the tests, subsequent runs should be faster"
echo ""
echo ""

DOCKER_TAG=${DOCKER_TAG:-1.12-dind}
DOCKER_COMPOSE_VERSION=${DOCKER_COMPOSE_VERSION:-1.8.0}
NODE_VERSION=${TRAVIS_NODE_VERSION:-6}

docker run -d --name navy-test-runner-daemon --privileged \
-v $(pwd):/usr/src/app \
docker:1.12-dind --storage-driver=aufs
docker:$DOCKER_TAG --storage-driver=aufs

docker build -t navy-test-runner -f test/integration/runner/Dockerfile .
docker build \
-t navy-test-runner \
-f test/integration/runner/Dockerfile \
--build-arg DOCKER_COMPOSE_VERSION=$DOCKER_COMPOSE_VERSION \
--build-arg NODE_VERSION=$NODE_VERSION \
.

echo ""
echo ""
Expand Down
9 changes: 4 additions & 5 deletions test/integration/runner/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
FROM ubuntu

ENV DOCKER_BUCKET get.docker.com
ENV DOCKER_VERSION 1.12.0
ENV DOCKER_SHA256 3dd07f65ea4a7b4c8829f311ab0213bca9ac551b5b24706f3e79a97e22097f8b
ARG DOCKER_COMPOSE_VERSION
ARG NODE_VERSION

RUN apt-get update -y && apt-get install -y build-essential git curl

RUN curl -sL https://deb.nodesource.com/setup_6.x | bash - && apt-get install -y nodejs python-software-properties python
RUN curl -sL https://deb.nodesource.com/setup_$NODE_VERSION.x | bash - && apt-get install -y nodejs python-software-properties python

RUN curl -L https://github.com/docker/compose/releases/download/1.8.0/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
RUN curl -L https://github.com/docker/compose/releases/download/$DOCKER_COMPOSE_VERSION/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
RUN chmod +x /usr/local/bin/docker-compose

ADD ./test/integration/runner/docker-entrypoint.sh /usr/local/bin/
Expand Down

0 comments on commit 6ae9fb2

Please sign in to comment.