diff --git a/.travis.yml b/.travis.yml index e8bf75c..7ca2301 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,6 +14,9 @@ install: jobs: include: + # ------------------------------------------------------------------------- + # Unit tests + # ------------------------------------------------------------------------- - name: Unit tests if: type = pull_request OR type = cron OR type = push AND branch =~ ^master|.*-dev script: @@ -22,10 +25,48 @@ jobs: - npm run codecov - bash test/travis-bin/sonar.sh - - name: Functional tests - if: type = cron OR (type = push OR type = pull_request) AND branch =~ ^master|.*-dev + # ------------------------------------------------------------------------- + # Functional tests - Redis 3.2 + # ------------------------------------------------------------------------- + - name: Functional tests - Redis 3.2 + if: type = cron OR type = push AND branch = master env: - DOCKER_COMPOSE_VERSION=1.24.0 + - REDIS_VERSION=3.2 + before_install: + - sudo rm /usr/local/bin/docker-compose + - sudo curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose + - sudo chmod +x /usr/local/bin/docker-compose + - sudo sysctl -w vm.max_map_count=262144 + - sudo sysctl -w fs.inotify.max_user_watches=524288 + script: + - bash test/travis-bin/functional-tests.sh + + # ------------------------------------------------------------------------- + # Functional tests - Redis 4 + # ------------------------------------------------------------------------- + - name: Functional tests- Redis 4 + if: type = cron OR type = push AND branch = master + env: + - DOCKER_COMPOSE_VERSION=1.24.0 + - REDIS_VERSION=4 + before_install: + - sudo rm /usr/local/bin/docker-compose + - sudo curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose + - sudo chmod +x /usr/local/bin/docker-compose + - sudo sysctl -w vm.max_map_count=262144 + - sudo sysctl -w fs.inotify.max_user_watches=524288 + script: + - bash test/travis-bin/functional-tests.sh + + # ------------------------------------------------------------------------- + # Functional tests - Redis 5 + # ------------------------------------------------------------------------- + - name: Functional tests - Redis 5 + if: type = cron OR type = push AND branch = master + env: + - DOCKER_COMPOSE_VERSION=1.24.0 + - REDIS_VERSION=5 before_install: - sudo rm /usr/local/bin/docker-compose - sudo curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose @@ -36,13 +77,13 @@ jobs: - bash test/travis-bin/functional-tests.sh notifications: - webhooks: - urls: - - https://webhooks.gitter.im/e/8e145155fbaaf37cffea - on_success: change - on_failure: always - on_start: never email: false + slack: + rooms: + - secure: "qMcRdKvIcnc56pQsHBgRDOAMbpIwMNd/brT8Vib+iA96JVpZz4voehRbQ4n7qOZER7riA4eXorcOLZQ1m3M+vyx247LePnDA5w2TWFmKy9nc6KMefB4m6ZktSFMWS/4J4rdj+jivEYAsM+xIo489lukWa1Y463bkg5KdWapEbgaEE0Jv1X5nElkSwazuUcRVMr9iEt0sA6So5dUx9nvi7P9u+KBC7kchfdh15+a7fhTKH1AltkHalPweVEeqbLRnwWNV43+hRI6oIgnuPITY4+/bgh47V/SIEAdUSZoEtdz+PeiyNEYCPgvDPKf3C1lL1bhQURpt6qgaO2Ocu9dIa3ZrSe89gTK0SD0GI3cQlxA8ODp19au55EBumLxceuIIThnvSqb9QLjqYcILQpDG3mkki4VsipP7h1Zzg0bF8ysHSeaeqv+55aIJo7POx2wVM1YXW7qVugMov0bC9gyu72I8iwn7jTPE5NQT7NJfL3STOHGy75tXSzYLN6VwvdGKhQScroIgPbsO8rkdzZad9e1G2w/s1IpnawD7H2FY1Mrb+FMcg9JJ6oLY7rmkK6Ol1cBxAtTO7qPQ7/bE8hax5uLWFEd6+r5RGIPbk7UtKd43pXIos7ajuKxX+7ovkwmZ7mioEuMvRF1DJbiw7LWTe65W35h2o7B4OIflgg/zlPE=" + on_success: never + on_failure: always + addons: sonarcloud: true diff --git a/docker-compose/docker-compose.yml.tpl b/docker-compose/docker-compose.yml.tpl index 4daab0f..8c75229 100644 --- a/docker-compose/docker-compose.yml.tpl +++ b/docker-compose/docker-compose.yml.tpl @@ -27,7 +27,10 @@ services: DEBUG_COLORS: ${DOLLAR}{DEBUG_COLORS:-on} redis: - build: ./redis + build: + context: ./redis + args: + - REDIS_VERSION=${DOLLAR}{REDIS_VERSION:-4.0} command: redis-server /usr/local/etc/redis/redis.conf redis_init_cluster: @@ -36,7 +39,7 @@ services: - redis elasticsearch: - image: kuzzleio/elasticsearch:5.4.1 + image: kuzzleio/elasticsearch:5.6.10 ulimits: nofile: 65536 environment: diff --git a/docker-compose/images/kuzzle/Dockerfile b/docker-compose/images/kuzzle/Dockerfile index 868bb17..bb94abc 100644 --- a/docker-compose/images/kuzzle/Dockerfile +++ b/docker-compose/images/kuzzle/Dockerfile @@ -1,4 +1,4 @@ -FROM kuzzleio/kuzzle +FROM kuzzleio/kuzzle:1-dev RUN set -x \ \ diff --git a/docker-compose/redis/Dockerfile b/docker-compose/redis/Dockerfile index c42021a..ced52dd 100644 --- a/docker-compose/redis/Dockerfile +++ b/docker-compose/redis/Dockerfile @@ -1,4 +1,5 @@ -FROM redis:4.0 +ARG REDIS_VERSION=5 +FROM redis:$REDIS_VERSION MAINTAINER Kuzzle COPY redis.conf /usr/local/etc/redis/redis.conf diff --git a/test/travis-bin/functional-tests.sh b/test/travis-bin/functional-tests.sh index c186ce2..11a234b 100644 --- a/test/travis-bin/functional-tests.sh +++ b/test/travis-bin/functional-tests.sh @@ -4,12 +4,8 @@ set -e docker pull kuzzleio/kuzzle -# git clone kuzzle -cd /tmp/ -git clone --recursive -b 1-dev https://github.com/kuzzleio/kuzzle.git - cd "$TRAVIS_BUILD_DIR" -echo "KUZ_PATH=/tmp/kuzzle" > docker-compose/my.env +touch docker-compose/my.env ./dev-npm-install.sh