diff --git a/.travis.yml b/.travis.yml index fc228792..12f90930 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,14 @@ -jobs: - include: - - sudo: required - services: - - docker - language: generic - before_install: docker pull carto/nodejs-xenial-pg101:latest - script: npm run docker-test -- 10.15.1 # Node.js version +language: generic +sudo: required +env: + global: + - VERSION=1.${TRAVIS_BUILD_NUMBER} + matrix: + - NODE_VERSION=10.15.1 + DOCKER_IMAGE=carto/nodejs-xenial-pg101:latest + - NODE_VERSION=10.15.1 + DOCKER_IMAGE=carto/nodejs-xenial-pg1121:latest +services: + - docker +before_install: docker pull ${DOCKER_IMAGE} +script: npm run docker-test -- ${DOCKER_IMAGE} ${NODE_VERSION} diff --git a/docker-test.sh b/docker-test.sh index 44821126..bca2c5db 100755 --- a/docker-test.sh +++ b/docker-test.sh @@ -1,4 +1,4 @@ #!/bin/bash -docker run -e "NODEJS_VERSION=${1}" -v `pwd`:/srv carto/nodejs-xenial-pg101:latest bash run_tests_docker.sh && \ +docker run -e "NODEJS_VERSION=${2}" -v `pwd`:/srv ${1} bash run_tests_docker.sh && \ docker ps --filter status=dead --filter status=exited -aq | xargs docker rm -v diff --git a/docker/Dockerfile-nodejs-xenial-pg1121:latest b/docker/Dockerfile-nodejs-xenial-pg1121:latest new file mode 100644 index 00000000..7fccc2a7 --- /dev/null +++ b/docker/Dockerfile-nodejs-xenial-pg1121:latest @@ -0,0 +1,85 @@ +FROM ubuntu:xenial + +# Use UTF8 to avoid encoding problems with pgsql +ENV LANG C.UTF-8 +ENV NPROCS 1 +ENV JOBS 1 +ENV CXX g++-4.9 +ENV PGUSER postgres + +# Add external repos +RUN set -ex \ + && apt-get update \ + && apt-get install -y \ + curl \ + software-properties-common \ + locales \ + && add-apt-repository -y ppa:ubuntu-toolchain-r/test \ + && add-apt-repository -y ppa:cartodb/postgresql-11 \ + && add-apt-repository -y ppa:cartodb/redis-next \ + && curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash \ + && . ~/.nvm/nvm.sh \ + && locale-gen en_US.UTF-8 \ + && update-locale LANG=en_US.UTF-8 + +RUN set -ex \ + && apt-get update \ + && apt-get install -y \ + g++-4.9 \ + gcc-4.9 \ + git \ + libcairo2-dev \ + libgdal-dev=2.3.2+dfsg-2build2~carto1 \ + libgdal20=2.3.2+dfsg-2build2~carto1 \ + libgeos-dev=3.7.1~carto1 \ + libgif-dev \ + libjpeg8-dev \ + libjson-c-dev \ + libpango1.0-dev \ + libpixman-1-dev \ + libproj-dev \ + libprotobuf-c-dev \ + libxml2-dev \ + gdal-bin=2.3.2+dfsg-2build2~carto1 \ + make \ + nodejs \ + protobuf-c-compiler \ + pkg-config \ + wget \ + zip \ + libopenscenegraph100v5 \ + libsfcgal1 \ + liblwgeom-2.5.0=2.5.1.4+carto-1 \ + postgresql-11 \ + postgresql-11-plproxy \ + postgis=2.5.1.4+carto-1 \ + postgresql-11-postgis-2.5=2.5.1.4+carto-1 \ + postgresql-11-postgis-2.5-scripts=2.5.1.4+carto-1 \ + postgresql-client-11 \ + postgresql-client-common \ + postgresql-common \ + postgresql-contrib \ + postgresql-plpython-11 \ + postgresql-server-dev-11 \ + redis=5:4.0.9-1carto1~xenial1 \ + && apt-get purge -y wget protobuf-c-compiler \ + && apt-get autoremove -y + +# Configure PostgreSQL +RUN set -ex \ + && echo "listen_addresses='*'" >> /etc/postgresql/11/main/postgresql.conf \ + && echo "local all all trust" > /etc/postgresql/11/main/pg_hba.conf \ + && echo "host all all 0.0.0.0/0 trust" >> /etc/postgresql/11/main/pg_hba.conf \ + && echo "host all all ::1/128 trust" >> /etc/postgresql/11/main/pg_hba.conf \ + && /etc/init.d/postgresql start \ + && createdb template_postgis \ + && createuser publicuser \ + && psql -c "CREATE EXTENSION postgis" template_postgis \ + && /etc/init.d/postgresql stop + +WORKDIR /srv +EXPOSE 5858 + +COPY ./scripts/nodejs-install.sh /src/nodejs-install.sh +RUN chmod 777 /src/nodejs-install.sh +CMD /src/nodejs-install.sh diff --git a/test/acceptance/named_maps_static_view.js b/test/acceptance/named_maps_static_view.js index a6283d61..8a9b1402 100644 --- a/test/acceptance/named_maps_static_view.js +++ b/test/acceptance/named_maps_static_view.js @@ -106,7 +106,15 @@ describe('named maps static view', function() { } getStaticMap(function(err, img) { assert.ok(!err); - assert.imageIsSimilarToFile(img, previewFixture('estimated'), PNG_IMAGE_TOLERANCE, done); + assert.imageIsSimilarToFile(img, previewFixture('estimated'), PNG_IMAGE_TOLERANCE, err => { + if (err) { + assert.imageIsSimilarToFile(img, previewFixture('estimated-proj5'), PNG_IMAGE_TOLERANCE, done); + } + else + { + done(); + } + }); }); }); }); diff --git a/test/fixtures/previews/populated_places_simple_reduced-estimated-proj5.png b/test/fixtures/previews/populated_places_simple_reduced-estimated-proj5.png new file mode 100644 index 00000000..fb6e7948 Binary files /dev/null and b/test/fixtures/previews/populated_places_simple_reduced-estimated-proj5.png differ diff --git a/test/support/prepare_db.sh b/test/support/prepare_db.sh index 5989b498..ab9ba0f4 100755 --- a/test/support/prepare_db.sh +++ b/test/support/prepare_db.sh @@ -13,7 +13,6 @@ PREPARE_REDIS=yes PREPARE_PGSQL=yes DOWNLOAD_SQL_FILES=yes -PG_PARALLEL=$(pg_config --version | (awk '{$2*=1000; if ($2 >= 9600) print 1; else print 0;}' 2> /dev/null || echo 0)) while [ -n "$1" ]; do OPTION=$(echo "$1" | tr -d '[:space:]')