From 67ab12e8e779f7341f4a7eb4c10d2b0b944e364f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Mon, 16 Oct 2017 11:08:46 +0200 Subject: [PATCH 1/6] Add environment variable to check whether to run test against postgis 2.4 or not --- docker-test.sh | 2 +- test/acceptance/mvt.js | 6 ++++-- test/acceptance/user-render-timeout-limit.js | 5 ++++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/docker-test.sh b/docker-test.sh index 6bf5360e..8cc8c093 100644 --- a/docker-test.sh +++ b/docker-test.sh @@ -8,4 +8,4 @@ yarn createdb template_postgis && createuser publicuser psql -c "CREATE EXTENSION postgis" template_postgis -npm test \ No newline at end of file +POSTGIS_VERSION=2.4 npm test \ No newline at end of file diff --git a/test/acceptance/mvt.js b/test/acceptance/mvt.js index 883f050f..ded1772e 100644 --- a/test/acceptance/mvt.js +++ b/test/acceptance/mvt.js @@ -20,7 +20,9 @@ function createMapConfig(sql = TestClient.SQL.ONE_POINT) { } describe('mvt (mapnik)', mvt(false)); -describe('mvt (postgis)', mvt(true)); +if (process.env.POSTGIS_VERSION === '2.4') { + describe('mvt (postgis)', mvt(true)); +} function mvt(usePostGIS) { return function () { @@ -185,7 +187,7 @@ return function () { type: 'mapnik', options: { sql: 'select * from populated_places_simple_reduced', - cartocss: + cartocss: '#layer0 { marker-fill: red; marker-width: 10; [name="Madrid"] { marker-fill: green; } }', cartocss_version: '2.0.1', widgets: { diff --git a/test/acceptance/user-render-timeout-limit.js b/test/acceptance/user-render-timeout-limit.js index eaf98805..0bb45c2b 100644 --- a/test/acceptance/user-render-timeout-limit.js +++ b/test/acceptance/user-render-timeout-limit.js @@ -201,7 +201,10 @@ describe('user render timeout limit', function () { }); }); - describe('vector (PostGIS)', vector(true)); + if (process.env.POSTGIS_VERSION === '2.4') { + describe('vector (PostGIS)', vector(true)); + } + describe('vector (mapnik)', vector(false)); function vector(usePostGIS) { const originalUsePostGIS = serverOptions.renderer.mvt.usePostGIS; From f8ff41be01cfd9bbf76efe91ff8a376937645b7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Mon, 16 Oct 2017 12:15:28 +0200 Subject: [PATCH 2/6] Do not run test if postgis version is lower than or equal to 2.4 --- docker-test.sh | 4 ++-- test/acceptance/buffer-size-format.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docker-test.sh b/docker-test.sh index 8cc8c093..00cc63b3 100644 --- a/docker-test.sh +++ b/docker-test.sh @@ -1,4 +1,4 @@ -export NPROCS=1 && export JOBS=1 && export CXX=g++-4.9 && export PGUSER=postgres +export NPROCS=1 && export JOBS=1 && export CXX=g++-4.9 && export PGUSER=postgres export POSTGIS_VERSION=2.4 npm install -g yarn@0.27.5 yarn @@ -8,4 +8,4 @@ yarn createdb template_postgis && createuser publicuser psql -c "CREATE EXTENSION postgis" template_postgis -POSTGIS_VERSION=2.4 npm test \ No newline at end of file +npm test \ No newline at end of file diff --git a/test/acceptance/buffer-size-format.js b/test/acceptance/buffer-size-format.js index 2366d035..ba8955e7 100644 --- a/test/acceptance/buffer-size-format.js +++ b/test/acceptance/buffer-size-format.js @@ -152,7 +152,7 @@ describe('buffer size per format', function () { }); }); }; - if (test.format === 'mvt'){ + if (process.env.POSTGIS_VERSION === '2.4' && test.format === 'mvt'){ testFn(true); } testFn(false); @@ -465,7 +465,7 @@ describe('buffer size per format for named maps w/o placeholders', function () { }); }); }; - if (test.format === 'mvt'){ + if (process.env.POSTGIS_VERSION === '2.4' && test.format === 'mvt'){ testFn(true); } testFn(false); From a1c08f9bf74f2c80a61312cc3b95970d11da7058 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Mon, 16 Oct 2017 12:53:23 +0200 Subject: [PATCH 3/6] Revert docker-test config --- docker-test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-test.sh b/docker-test.sh index 00cc63b3..6bf5360e 100644 --- a/docker-test.sh +++ b/docker-test.sh @@ -1,4 +1,4 @@ -export NPROCS=1 && export JOBS=1 && export CXX=g++-4.9 && export PGUSER=postgres export POSTGIS_VERSION=2.4 +export NPROCS=1 && export JOBS=1 && export CXX=g++-4.9 && export PGUSER=postgres npm install -g yarn@0.27.5 yarn From 515146bf285d40dffeae54592f504be6a817ba8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Mon, 16 Oct 2017 13:12:06 +0200 Subject: [PATCH 4/6] Configure travis to export environment variable (POSTGIS_VERSION) --- .travis.yml | 3 +++ docker-test.sh | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index b946378f..9ac20ae7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,5 +10,8 @@ before_install: script: - docker run -v `pwd`:/srv cartoimages/windshaft-carto-testing +after_success: + - export POSTGIS_VERSION=2.4 + language: generic diff --git a/docker-test.sh b/docker-test.sh index 6bf5360e..8cc8c093 100644 --- a/docker-test.sh +++ b/docker-test.sh @@ -8,4 +8,4 @@ yarn createdb template_postgis && createuser publicuser psql -c "CREATE EXTENSION postgis" template_postgis -npm test \ No newline at end of file +POSTGIS_VERSION=2.4 npm test \ No newline at end of file From 294a222669b39318a76f4cb0b1b2f65a56548eb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Mon, 16 Oct 2017 13:20:30 +0200 Subject: [PATCH 5/6] Configure travis to export environment variable (POSTGIS_VERSION) --- .travis.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9ac20ae7..d881854c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,10 +8,7 @@ before_install: - docker pull cartoimages/windshaft-carto-testing script: - - docker run -v `pwd`:/srv cartoimages/windshaft-carto-testing - -after_success: - - export POSTGIS_VERSION=2.4 + - docker run -v `pwd`:/srv cartoimages/windshaft-carto-testing -e POSTGIS_VERSION=2.4 language: generic From c2bf7b075ca859d9687f6000ddad1f73c056b313 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Mon, 16 Oct 2017 13:24:46 +0200 Subject: [PATCH 6/6] Fix travis to export environment variable (POSTGIS_VERSION) --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index d881854c..5bc0cf1d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,7 @@ before_install: - docker pull cartoimages/windshaft-carto-testing script: - - docker run -v `pwd`:/srv cartoimages/windshaft-carto-testing -e POSTGIS_VERSION=2.4 + - docker run -e POSTGIS_VERSION=2.4 -v `pwd`:/srv cartoimages/windshaft-carto-testing language: generic