diff --git a/INSTALL.md b/INSTALL.md index cfb6cfc4..751c5ef8 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -16,10 +16,6 @@ Make sure that you have the requirements needed. These are - CartoDB 0.9.5+ (for `CDB_QueryTables`) - Varnish (http://www.varnish-cache.org) -- For running the testsuite - - ImageMagick (http://www.imagemagick.org) - - On Ubuntu 14.04 the dependencies can be installed with ```shell diff --git a/NEWS.md b/NEWS.md index 6ad63596..18bb8737 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,8 +1,27 @@ # Changelog +## 2.26.0 + +Released 2016-mm-dd + +Announcements: + - Upgrades windshaft to [1.13.0](https://github.com/CartoDB/Windshaft/releases/tag/1.13.0) + + +## 2.25.2 + +Released 2016-02-22 + +Bug fixes: + - Correct URLs for widgets in named maps #381 + + ## 2.25.1 -Released 2016-mm-dd +Released 2016-02-22 + +Announcements: + - Upgrades windshaft to [1.11.1](https://github.com/CartoDB/Windshaft/releases/tag/1.11.1) ## 2.25.0 diff --git a/lib/cartodb/controllers/map.js b/lib/cartodb/controllers/map.js index f5c8b39b..dfaf904d 100644 --- a/lib/cartodb/controllers/map.js +++ b/lib/cartodb/controllers/map.js @@ -207,6 +207,8 @@ MapController.prototype.create = function(req, res, prepareConfigFn) { if (err) { self.sendError(req, res, err, 'ANONYMOUS LAYERGROUP'); } else { + addWidgetsUrl(req.context.user, layergroup); + res.set('X-Layergroup-Id', layergroup.layergroupid); self.send(req, res, layergroup, 200); } @@ -281,6 +283,8 @@ MapController.prototype.instantiateTemplate = function(req, res, prepareParamsFn var templateHash = self.templateMaps.fingerPrint(mapConfigProvider.template).substring(0, 8); layergroup.layergroupid = cdbuser + '@' + templateHash + '@' + layergroup.layergroupid; + addWidgetsUrl(req.context.user, layergroup); + res.set('X-Layergroup-Id', layergroup.layergroupid); self.surrogateKeysCache.tag(res, new NamedMapsCacheEntry(cdbuser, mapConfigProvider.getTemplateName())); @@ -364,9 +368,6 @@ MapController.prototype.afterLayergroupCreate = function(req, res, mapconfig, la layergroup.layergroupid = layergroup.layergroupid + ':' + result.lastUpdatedTime; layergroup.last_updated = new Date(result.lastUpdatedTime).toISOString(); - // TODO this should take into account several URL patterns - addWidgetsUrl(username, layergroup); - if (req.method === 'GET') { var tableCacheEntry = new TablesCacheEntry(result.affectedTables); var ttl = global.environment.varnish.layergroupTtl || 86400; diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index e8c9138c..8eab3b82 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "windshaft-cartodb", - "version": "2.25.1", + "version": "2.26.0", "dependencies": { "body-parser": { "version": "1.14.2", @@ -85,7 +85,7 @@ }, "mime-types": { "version": "2.1.10", - "from": "mime-types@>=2.1.9 <2.2.0", + "from": "mime-types@>=2.1.2 <2.2.0", "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.10.tgz", "dependencies": { "mime-db": { @@ -595,7 +595,7 @@ "dependencies": { "mime-types": { "version": "2.1.10", - "from": "mime-types@>=2.1.6 <2.2.0", + "from": "mime-types@>=2.1.9 <2.2.0", "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.10.tgz", "dependencies": { "mime-db": { @@ -784,7 +784,7 @@ }, "mime-types": { "version": "2.1.10", - "from": "mime-types@>=2.1.6 <2.2.0", + "from": "mime-types@>=2.1.9 <2.2.0", "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.10.tgz", "dependencies": { "mime-db": { @@ -1126,14 +1126,21 @@ "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.1.tgz", "dependencies": { "ansi-styles": { - "version": "2.1.0", + "version": "2.2.0", "from": "ansi-styles@>=2.1.0 <3.0.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.1.0.tgz" + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.0.tgz", + "dependencies": { + "color-convert": { + "version": "1.0.0", + "from": "color-convert@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.0.0.tgz" + } + } }, "escape-string-regexp": { - "version": "1.0.4", + "version": "1.0.5", "from": "escape-string-regexp@>=1.0.2 <2.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.4.tgz" + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz" }, "has-ansi": { "version": "2.0.0", @@ -1148,9 +1155,9 @@ } }, "strip-ansi": { - "version": "3.0.0", + "version": "3.0.1", "from": "strip-ansi@>=3.0.0 <4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.0.tgz", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", "dependencies": { "ansi-regex": { "version": "2.0.0", @@ -1179,9 +1186,9 @@ } }, "is-my-json-valid": { - "version": "2.13.0", + "version": "2.13.1", "from": "is-my-json-valid@>=2.12.0 <3.0.0", - "resolved": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.13.0.tgz", + "resolved": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.13.1.tgz", "dependencies": { "generate-function": { "version": "2.0.0", @@ -1232,390 +1239,75 @@ "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.6.0.tgz" }, "windshaft": { - "version": "1.11.0", - "from": "windshaft@1.11.0", - "resolved": "https://registry.npmjs.org/windshaft/-/windshaft-1.11.0.tgz", + "version": "1.13.0", + "from": "windshaft@1.13.0", + "resolved": "https://registry.npmjs.org/windshaft/-/windshaft-1.13.0.tgz", "dependencies": { - "mapnik": { - "version": "1.4.15-cdb6", - "from": "https://github.com/CartoDB/node-mapnik/tarball/1.4.15-cdb6", - "resolved": "https://github.com/CartoDB/node-mapnik/tarball/1.4.15-cdb6", + "abaculus": { + "version": "1.1.0-cdb4", + "from": "https://github.com/CartoDB/abaculus/tarball/1.1.0-cdb4", + "resolved": "https://github.com/CartoDB/abaculus/tarball/1.1.0-cdb4" + }, + "canvas": { + "version": "1.2.7-cdb1", + "from": "https://github.com/CartoDB/node-canvas/tarball/1.2.7-cdb1", + "resolved": "https://github.com/CartoDB/node-canvas/tarball/1.2.7-cdb1", "dependencies": { "nan": { - "version": "1.2.0", - "from": "nan@>=1.2.0 <1.3.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-1.2.0.tgz" + "version": "1.9.0", + "from": "nan@>=1.8.4 <2.0.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-1.9.0.tgz" + } + } + }, + "carto": { + "version": "0.15.1-cdb1", + "from": "https://github.com/CartoDB/carto/tarball/0.15.1-cdb1", + "resolved": "https://github.com/CartoDB/carto/tarball/0.15.1-cdb1", + "dependencies": { + "mapnik-reference": { + "version": "6.0.5", + "from": "mapnik-reference@>=6.0.2 <6.1.0", + "resolved": "https://registry.npmjs.org/mapnik-reference/-/mapnik-reference-6.0.5.tgz" }, - "mapnik-vector-tile": { - "version": "0.5.5", - "from": "mapnik-vector-tile@0.5.5", - "resolved": "https://registry.npmjs.org/mapnik-vector-tile/-/mapnik-vector-tile-0.5.5.tgz" - }, - "node-pre-gyp": { - "version": "0.5.25", - "from": "node-pre-gyp@0.5.25", - "resolved": "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.5.25.tgz", + "optimist": { + "version": "0.6.1", + "from": "optimist@>=0.6.0 <0.7.0", + "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", "dependencies": { - "nopt": { - "version": "3.0.1", - "from": "nopt@~3.0.1", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.1.tgz", - "dependencies": { - "abbrev": { - "version": "1.0.5", - "from": "abbrev@1", - "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.5.tgz" - } - } + "wordwrap": { + "version": "0.0.3", + "from": "wordwrap@>=0.0.2 <0.1.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz" }, - "npmlog": { - "version": "0.1.1", - "from": "npmlog@~0.1.1", - "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-0.1.1.tgz", - "dependencies": { - "ansi": { - "version": "0.3.0", - "from": "ansi@~0.3.0", - "resolved": "https://registry.npmjs.org/ansi/-/ansi-0.3.0.tgz" - } - } + "minimist": { + "version": "0.0.10", + "from": "minimist@>=0.0.1 <0.1.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz" + } + } + } + } + }, + "cartodb-psql": { + "version": "0.6.1", + "from": "cartodb-psql@>=0.6.1 <0.7.0", + "resolved": "https://registry.npmjs.org/cartodb-psql/-/cartodb-psql-0.6.1.tgz", + "dependencies": { + "pg": { + "version": "2.6.2-cdb3", + "from": "git://github.com/CartoDB/node-postgres.git#2.6.2-cdb3", + "resolved": "git://github.com/CartoDB/node-postgres.git#069c5296d1a093077feff21719641bb9e71fc50e", + "dependencies": { + "generic-pool": { + "version": "2.0.3", + "from": "generic-pool@2.0.3", + "resolved": "https://registry.npmjs.org/generic-pool/-/generic-pool-2.0.3.tgz" }, - "request": { - "version": "2.40.0", - "from": "request@2.x", - "resolved": "https://registry.npmjs.org/request/-/request-2.40.0.tgz", - "dependencies": { - "qs": { - "version": "1.0.2", - "from": "qs@~1.0.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-1.0.2.tgz" - }, - "json-stringify-safe": { - "version": "5.0.0", - "from": "json-stringify-safe@~5.0.0", - "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.0.tgz" - }, - "mime-types": { - "version": "1.0.2", - "from": "mime-types@~1.0.1", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-1.0.2.tgz" - }, - "forever-agent": { - "version": "0.5.2", - "from": "forever-agent@~0.5.0", - "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.5.2.tgz" - }, - "node-uuid": { - "version": "1.4.1", - "from": "node-uuid@~1.4.0", - "resolved": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.1.tgz" - }, - "tough-cookie": { - "version": "0.12.1", - "from": "tough-cookie@>=0.12.0", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-0.12.1.tgz", - "dependencies": { - "punycode": { - "version": "1.3.1", - "from": "punycode@>=0.2.0", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.1.tgz" - } - } - }, - "form-data": { - "version": "0.1.4", - "from": "form-data@~0.1.0", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-0.1.4.tgz", - "dependencies": { - "combined-stream": { - "version": "0.0.5", - "from": "combined-stream@~0.0.4", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-0.0.5.tgz", - "dependencies": { - "delayed-stream": { - "version": "0.0.5", - "from": "delayed-stream@0.0.5", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-0.0.5.tgz" - } - } - }, - "mime": { - "version": "1.2.11", - "from": "mime@~1.2.11", - "resolved": "https://registry.npmjs.org/mime/-/mime-1.2.11.tgz" - }, - "async": { - "version": "0.9.0", - "from": "async@~0.9.0", - "resolved": "https://registry.npmjs.org/async/-/async-0.9.0.tgz" - } - } - }, - "tunnel-agent": { - "version": "0.4.0", - "from": "tunnel-agent@~0.4.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.0.tgz" - }, - "http-signature": { - "version": "0.10.0", - "from": "http-signature@~0.10.0", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-0.10.0.tgz", - "dependencies": { - "assert-plus": { - "version": "0.1.2", - "from": "assert-plus@0.1.2", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.1.2.tgz" - }, - "asn1": { - "version": "0.1.11", - "from": "asn1@0.1.11", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.1.11.tgz" - }, - "ctype": { - "version": "0.5.2", - "from": "ctype@0.5.2", - "resolved": "https://registry.npmjs.org/ctype/-/ctype-0.5.2.tgz" - } - } - }, - "oauth-sign": { - "version": "0.3.0", - "from": "oauth-sign@~0.3.0", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.3.0.tgz" - }, - "hawk": { - "version": "1.1.1", - "from": "hawk@1.1.1", - "resolved": "https://registry.npmjs.org/hawk/-/hawk-1.1.1.tgz", - "dependencies": { - "hoek": { - "version": "0.9.1", - "from": "hoek@0.9.x", - "resolved": "https://registry.npmjs.org/hoek/-/hoek-0.9.1.tgz" - }, - "boom": { - "version": "0.4.2", - "from": "boom@0.4.x", - "resolved": "https://registry.npmjs.org/boom/-/boom-0.4.2.tgz" - }, - "cryptiles": { - "version": "0.2.2", - "from": "cryptiles@0.2.x", - "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-0.2.2.tgz" - }, - "sntp": { - "version": "0.2.4", - "from": "sntp@0.2.x", - "resolved": "https://registry.npmjs.org/sntp/-/sntp-0.2.4.tgz" - } - } - }, - "aws-sign2": { - "version": "0.5.0", - "from": "aws-sign2@~0.5.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.5.0.tgz" - }, - "stringstream": { - "version": "0.0.4", - "from": "stringstream@~0.0.4", - "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.4.tgz" - } - } - }, - "semver": { - "version": "3.0.1", - "from": "semver@~3.0.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-3.0.1.tgz" - }, - "tar": { - "version": "1.0.1", - "from": "tar@~1.0.0", - "resolved": "https://registry.npmjs.org/tar/-/tar-1.0.1.tgz", - "dependencies": { - "block-stream": { - "version": "0.0.7", - "from": "block-stream@*", - "resolved": "https://registry.npmjs.org/block-stream/-/block-stream-0.0.7.tgz" - }, - "fstream": { - "version": "1.0.2", - "from": "fstream@^1.0.2", - "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.2.tgz", - "dependencies": { - "graceful-fs": { - "version": "3.0.2", - "from": "graceful-fs@3", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-3.0.2.tgz" - } - } - }, - "inherits": { - "version": "2.0.1", - "from": "inherits@2", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz" - } - } - }, - "tar-pack": { - "version": "2.0.0", - "from": "tar-pack@~2.0.0", - "resolved": "https://registry.npmjs.org/tar-pack/-/tar-pack-2.0.0.tgz", - "dependencies": { - "uid-number": { - "version": "0.0.3", - "from": "uid-number@0.0.3", - "resolved": "https://registry.npmjs.org/uid-number/-/uid-number-0.0.3.tgz" - }, - "once": { - "version": "1.1.1", - "from": "once@~1.1.1", - "resolved": "https://registry.npmjs.org/once/-/once-1.1.1.tgz" - }, - "debug": { - "version": "0.7.4", - "from": "debug@~0.7.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-0.7.4.tgz" - }, - "fstream": { - "version": "0.1.31", - "from": "fstream@~0.1.22", - "resolved": "https://registry.npmjs.org/fstream/-/fstream-0.1.31.tgz", - "dependencies": { - "graceful-fs": { - "version": "3.0.2", - "from": "graceful-fs@~3.0.2", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-3.0.2.tgz" - }, - "inherits": { - "version": "2.0.1", - "from": "inherits@2", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz" - } - } - }, - "tar": { - "version": "0.1.20", - "from": "tar@~0.1.17", - "resolved": "https://registry.npmjs.org/tar/-/tar-0.1.20.tgz", - "dependencies": { - "block-stream": { - "version": "0.0.7", - "from": "block-stream@*", - "resolved": "https://registry.npmjs.org/block-stream/-/block-stream-0.0.7.tgz" - }, - "inherits": { - "version": "2.0.1", - "from": "inherits@2", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz" - } - } - }, - "fstream-ignore": { - "version": "0.0.7", - "from": "fstream-ignore@0.0.7", - "resolved": "https://registry.npmjs.org/fstream-ignore/-/fstream-ignore-0.0.7.tgz", - "dependencies": { - "minimatch": { - "version": "0.2.14", - "from": "minimatch@~0.2.0", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.2.14.tgz", - "dependencies": { - "lru-cache": { - "version": "2.5.0", - "from": "lru-cache@2", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.5.0.tgz" - }, - "sigmund": { - "version": "1.0.0", - "from": "sigmund@~1.0.0", - "resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.0.tgz" - } - } - }, - "inherits": { - "version": "2.0.1", - "from": "inherits@2", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz" - } - } - }, - "readable-stream": { - "version": "1.0.31", - "from": "readable-stream@~1.0.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.31.tgz", - "dependencies": { - "core-util-is": { - "version": "1.0.1", - "from": "core-util-is@~1.0.0", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.1.tgz" - }, - "isarray": { - "version": "0.0.1", - "from": "isarray@0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz" - }, - "string_decoder": { - "version": "0.10.31", - "from": "string_decoder@~0.10.x", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz" - }, - "inherits": { - "version": "2.0.1", - "from": "inherits@~2.0.1", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz" - } - } - }, - "graceful-fs": { - "version": "1.2.3", - "from": "graceful-fs@1.2", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-1.2.3.tgz" - } - } - }, - "mkdirp": { - "version": "0.5.0", - "from": "mkdirp@~0.5.0", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.0.tgz", - "dependencies": { - "minimist": { - "version": "0.0.8", - "from": "minimist@0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz" - } - } - }, - "rc": { - "version": "0.5.1", - "from": "rc@~0.5.0", - "resolved": "https://registry.npmjs.org/rc/-/rc-0.5.1.tgz", - "dependencies": { - "minimist": { - "version": "0.0.10", - "from": "minimist@~0.0.7", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz" - }, - "deep-extend": { - "version": "0.2.11", - "from": "deep-extend@~0.2.5", - "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.2.11.tgz" - }, - "strip-json-comments": { - "version": "0.1.3", - "from": "strip-json-comments@0.1.x", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-0.1.3.tgz" - }, - "ini": { - "version": "1.1.0", - "from": "ini@~1.1.0", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.1.0.tgz" - } - } - }, - "rimraf": { - "version": "2.2.8", - "from": "rimraf@~2.2.8", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.2.8.tgz" + "buffer-writer": { + "version": "1.0.0", + "from": "buffer-writer@1.0.0", + "resolved": "https://registry.npmjs.org/buffer-writer/-/buffer-writer-1.0.0.tgz" } } } @@ -3974,6 +3666,401 @@ } } }, + "mapnik": { + "version": "1.4.15-cdb6", + "from": "https://github.com/CartoDB/node-mapnik/tarball/1.4.15-cdb6", + "resolved": "https://github.com/CartoDB/node-mapnik/tarball/1.4.15-cdb6", + "dependencies": { + "nan": { + "version": "1.2.0", + "from": "nan@>=1.2.0 <1.3.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-1.2.0.tgz" + }, + "mapnik-vector-tile": { + "version": "0.5.5", + "from": "mapnik-vector-tile@0.5.5", + "resolved": "https://registry.npmjs.org/mapnik-vector-tile/-/mapnik-vector-tile-0.5.5.tgz" + }, + "node-pre-gyp": { + "version": "0.5.25", + "from": "node-pre-gyp@0.5.25", + "resolved": "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.5.25.tgz", + "dependencies": { + "nopt": { + "version": "3.0.1", + "from": "nopt@~3.0.1", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.1.tgz", + "dependencies": { + "abbrev": { + "version": "1.0.5", + "from": "abbrev@1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.5.tgz" + } + } + }, + "npmlog": { + "version": "0.1.1", + "from": "npmlog@~0.1.1", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-0.1.1.tgz", + "dependencies": { + "ansi": { + "version": "0.3.0", + "from": "ansi@~0.3.0", + "resolved": "https://registry.npmjs.org/ansi/-/ansi-0.3.0.tgz" + } + } + }, + "request": { + "version": "2.40.0", + "from": "request@2.x", + "resolved": "https://registry.npmjs.org/request/-/request-2.40.0.tgz", + "dependencies": { + "qs": { + "version": "1.0.2", + "from": "qs@~1.0.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-1.0.2.tgz" + }, + "json-stringify-safe": { + "version": "5.0.0", + "from": "json-stringify-safe@~5.0.0", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.0.tgz" + }, + "mime-types": { + "version": "1.0.2", + "from": "mime-types@~1.0.1", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-1.0.2.tgz" + }, + "forever-agent": { + "version": "0.5.2", + "from": "forever-agent@~0.5.0", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.5.2.tgz" + }, + "node-uuid": { + "version": "1.4.1", + "from": "node-uuid@~1.4.0", + "resolved": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.1.tgz" + }, + "tough-cookie": { + "version": "0.12.1", + "from": "tough-cookie@>=0.12.0", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-0.12.1.tgz", + "dependencies": { + "punycode": { + "version": "1.3.1", + "from": "punycode@>=0.2.0", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.1.tgz" + } + } + }, + "form-data": { + "version": "0.1.4", + "from": "form-data@~0.1.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-0.1.4.tgz", + "dependencies": { + "combined-stream": { + "version": "0.0.5", + "from": "combined-stream@~0.0.4", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-0.0.5.tgz", + "dependencies": { + "delayed-stream": { + "version": "0.0.5", + "from": "delayed-stream@0.0.5", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-0.0.5.tgz" + } + } + }, + "mime": { + "version": "1.2.11", + "from": "mime@~1.2.11", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.2.11.tgz" + }, + "async": { + "version": "0.9.0", + "from": "async@~0.9.0", + "resolved": "https://registry.npmjs.org/async/-/async-0.9.0.tgz" + } + } + }, + "tunnel-agent": { + "version": "0.4.0", + "from": "tunnel-agent@~0.4.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.0.tgz" + }, + "http-signature": { + "version": "0.10.0", + "from": "http-signature@~0.10.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-0.10.0.tgz", + "dependencies": { + "assert-plus": { + "version": "0.1.2", + "from": "assert-plus@0.1.2", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.1.2.tgz" + }, + "asn1": { + "version": "0.1.11", + "from": "asn1@0.1.11", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.1.11.tgz" + }, + "ctype": { + "version": "0.5.2", + "from": "ctype@0.5.2", + "resolved": "https://registry.npmjs.org/ctype/-/ctype-0.5.2.tgz" + } + } + }, + "oauth-sign": { + "version": "0.3.0", + "from": "oauth-sign@~0.3.0", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.3.0.tgz" + }, + "hawk": { + "version": "1.1.1", + "from": "hawk@1.1.1", + "resolved": "https://registry.npmjs.org/hawk/-/hawk-1.1.1.tgz", + "dependencies": { + "hoek": { + "version": "0.9.1", + "from": "hoek@0.9.x", + "resolved": "https://registry.npmjs.org/hoek/-/hoek-0.9.1.tgz" + }, + "boom": { + "version": "0.4.2", + "from": "boom@0.4.x", + "resolved": "https://registry.npmjs.org/boom/-/boom-0.4.2.tgz" + }, + "cryptiles": { + "version": "0.2.2", + "from": "cryptiles@0.2.x", + "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-0.2.2.tgz" + }, + "sntp": { + "version": "0.2.4", + "from": "sntp@0.2.x", + "resolved": "https://registry.npmjs.org/sntp/-/sntp-0.2.4.tgz" + } + } + }, + "aws-sign2": { + "version": "0.5.0", + "from": "aws-sign2@~0.5.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.5.0.tgz" + }, + "stringstream": { + "version": "0.0.4", + "from": "stringstream@~0.0.4", + "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.4.tgz" + } + } + }, + "semver": { + "version": "3.0.1", + "from": "semver@~3.0.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-3.0.1.tgz" + }, + "tar": { + "version": "1.0.1", + "from": "tar@~1.0.0", + "resolved": "https://registry.npmjs.org/tar/-/tar-1.0.1.tgz", + "dependencies": { + "block-stream": { + "version": "0.0.7", + "from": "block-stream@*", + "resolved": "https://registry.npmjs.org/block-stream/-/block-stream-0.0.7.tgz" + }, + "fstream": { + "version": "1.0.2", + "from": "fstream@^1.0.2", + "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.2.tgz", + "dependencies": { + "graceful-fs": { + "version": "3.0.2", + "from": "graceful-fs@3", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-3.0.2.tgz" + } + } + }, + "inherits": { + "version": "2.0.1", + "from": "inherits@2", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz" + } + } + }, + "tar-pack": { + "version": "2.0.0", + "from": "tar-pack@~2.0.0", + "resolved": "https://registry.npmjs.org/tar-pack/-/tar-pack-2.0.0.tgz", + "dependencies": { + "uid-number": { + "version": "0.0.3", + "from": "uid-number@0.0.3", + "resolved": "https://registry.npmjs.org/uid-number/-/uid-number-0.0.3.tgz" + }, + "once": { + "version": "1.1.1", + "from": "once@~1.1.1", + "resolved": "https://registry.npmjs.org/once/-/once-1.1.1.tgz" + }, + "debug": { + "version": "0.7.4", + "from": "debug@~0.7.2", + "resolved": "https://registry.npmjs.org/debug/-/debug-0.7.4.tgz" + }, + "fstream": { + "version": "0.1.31", + "from": "fstream@~0.1.22", + "resolved": "https://registry.npmjs.org/fstream/-/fstream-0.1.31.tgz", + "dependencies": { + "graceful-fs": { + "version": "3.0.2", + "from": "graceful-fs@~3.0.2", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-3.0.2.tgz" + }, + "inherits": { + "version": "2.0.1", + "from": "inherits@2", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz" + } + } + }, + "tar": { + "version": "0.1.20", + "from": "tar@~0.1.17", + "resolved": "https://registry.npmjs.org/tar/-/tar-0.1.20.tgz", + "dependencies": { + "block-stream": { + "version": "0.0.7", + "from": "block-stream@*", + "resolved": "https://registry.npmjs.org/block-stream/-/block-stream-0.0.7.tgz" + }, + "inherits": { + "version": "2.0.1", + "from": "inherits@2", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz" + } + } + }, + "fstream-ignore": { + "version": "0.0.7", + "from": "fstream-ignore@0.0.7", + "resolved": "https://registry.npmjs.org/fstream-ignore/-/fstream-ignore-0.0.7.tgz", + "dependencies": { + "minimatch": { + "version": "0.2.14", + "from": "minimatch@~0.2.0", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.2.14.tgz", + "dependencies": { + "lru-cache": { + "version": "2.5.0", + "from": "lru-cache@2", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.5.0.tgz" + }, + "sigmund": { + "version": "1.0.0", + "from": "sigmund@~1.0.0", + "resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.0.tgz" + } + } + }, + "inherits": { + "version": "2.0.1", + "from": "inherits@2", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz" + } + } + }, + "readable-stream": { + "version": "1.0.31", + "from": "readable-stream@~1.0.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.31.tgz", + "dependencies": { + "core-util-is": { + "version": "1.0.1", + "from": "core-util-is@~1.0.0", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.1.tgz" + }, + "isarray": { + "version": "0.0.1", + "from": "isarray@0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz" + }, + "string_decoder": { + "version": "0.10.31", + "from": "string_decoder@~0.10.x", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz" + }, + "inherits": { + "version": "2.0.1", + "from": "inherits@~2.0.1", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz" + } + } + }, + "graceful-fs": { + "version": "1.2.3", + "from": "graceful-fs@1.2", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-1.2.3.tgz" + } + } + }, + "mkdirp": { + "version": "0.5.0", + "from": "mkdirp@~0.5.0", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.0.tgz", + "dependencies": { + "minimist": { + "version": "0.0.8", + "from": "minimist@0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz" + } + } + }, + "rc": { + "version": "0.5.1", + "from": "rc@~0.5.0", + "resolved": "https://registry.npmjs.org/rc/-/rc-0.5.1.tgz", + "dependencies": { + "minimist": { + "version": "0.0.10", + "from": "minimist@~0.0.7", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz" + }, + "deep-extend": { + "version": "0.2.11", + "from": "deep-extend@~0.2.5", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.2.11.tgz" + }, + "strip-json-comments": { + "version": "0.1.3", + "from": "strip-json-comments@0.1.x", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-0.1.3.tgz" + }, + "ini": { + "version": "1.1.0", + "from": "ini@~1.1.0", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.1.0.tgz" + } + } + }, + "rimraf": { + "version": "2.2.8", + "from": "rimraf@~2.2.8", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.2.8.tgz" + } + } + } + } + }, + "semver": { + "version": "5.0.3", + "from": "semver@>=5.0.3 <5.1.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.0.3.tgz" + }, + "sphericalmercator": { + "version": "1.0.3", + "from": "sphericalmercator@1.0.3", + "resolved": "https://registry.npmjs.org/sphericalmercator/-/sphericalmercator-1.0.3.tgz" + }, "tilelive": { "version": "4.5.3", "from": "tilelive@>=4.5.3 <4.6.0", @@ -3998,23 +4085,6 @@ } } }, - "tilelive-mapnik": { - "version": "0.6.15-cdb5", - "from": "https://github.com/CartoDB/tilelive-mapnik/tarball/0.6.15-cdb5", - "resolved": "https://github.com/CartoDB/tilelive-mapnik/tarball/0.6.15-cdb5", - "dependencies": { - "generic-pool": { - "version": "2.1.1", - "from": "generic-pool@>=2.1.1 <2.2.0", - "resolved": "https://registry.npmjs.org/generic-pool/-/generic-pool-2.1.1.tgz" - }, - "mime": { - "version": "1.2.11", - "from": "mime@>=1.2.11 <1.3.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-1.2.11.tgz" - } - } - }, "tilelive-bridge": { "version": "1.3.0-cdb4", "from": "https://github.com/CartoDB/tilelive-bridge/tarball/1.3.0-cdb4", @@ -4039,73 +4109,20 @@ } } }, - "canvas": { - "version": "1.2.7-cdb1", - "from": "https://github.com/CartoDB/node-canvas/tarball/1.2.7-cdb1", - "resolved": "https://github.com/CartoDB/node-canvas/tarball/1.2.7-cdb1", + "tilelive-mapnik": { + "version": "0.6.15-cdb5", + "from": "https://github.com/CartoDB/tilelive-mapnik/tarball/0.6.15-cdb5", + "resolved": "https://github.com/CartoDB/tilelive-mapnik/tarball/0.6.15-cdb5", "dependencies": { - "nan": { - "version": "1.9.0", - "from": "nan@>=1.8.4 <2.0.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-1.9.0.tgz" - } - } - }, - "semver": { - "version": "5.0.3", - "from": "semver@>=5.0.3 <5.1.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.0.3.tgz" - }, - "carto": { - "version": "0.15.1-cdb1", - "from": "https://github.com/CartoDB/carto/tarball/0.15.1-cdb1", - "resolved": "https://github.com/CartoDB/carto/tarball/0.15.1-cdb1", - "dependencies": { - "mapnik-reference": { - "version": "6.0.5", - "from": "mapnik-reference@>=6.0.2 <6.1.0", - "resolved": "https://registry.npmjs.org/mapnik-reference/-/mapnik-reference-6.0.5.tgz" + "generic-pool": { + "version": "2.1.1", + "from": "generic-pool@>=2.1.1 <2.2.0", + "resolved": "https://registry.npmjs.org/generic-pool/-/generic-pool-2.1.1.tgz" }, - "optimist": { - "version": "0.6.1", - "from": "optimist@>=0.6.0 <0.7.0", - "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", - "dependencies": { - "wordwrap": { - "version": "0.0.3", - "from": "wordwrap@>=0.0.2 <0.1.0", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz" - }, - "minimist": { - "version": "0.0.10", - "from": "minimist@>=0.0.1 <0.1.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz" - } - } - } - } - }, - "cartodb-psql": { - "version": "0.6.1", - "from": "cartodb-psql@>=0.6.1 <0.7.0", - "resolved": "https://registry.npmjs.org/cartodb-psql/-/cartodb-psql-0.6.1.tgz", - "dependencies": { - "pg": { - "version": "2.6.2-cdb3", - "from": "git://github.com/CartoDB/node-postgres.git#2.6.2-cdb3", - "resolved": "git://github.com/CartoDB/node-postgres.git#069c5296d1a093077feff21719641bb9e71fc50e", - "dependencies": { - "generic-pool": { - "version": "2.0.3", - "from": "generic-pool@2.0.3", - "resolved": "https://registry.npmjs.org/generic-pool/-/generic-pool-2.0.3.tgz" - }, - "buffer-writer": { - "version": "1.0.0", - "from": "buffer-writer@1.0.0", - "resolved": "https://registry.npmjs.org/buffer-writer/-/buffer-writer-1.0.0.tgz" - } - } + "mime": { + "version": "1.2.11", + "from": "mime@>=1.2.11 <1.3.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.2.11.tgz" } } }, @@ -4114,15 +4131,515 @@ "from": "torque.js@>=2.11.0 <2.12.0", "resolved": "https://registry.npmjs.org/torque.js/-/torque.js-2.11.4.tgz" }, - "abaculus": { - "version": "1.1.0-cdb4", - "from": "https://github.com/CartoDB/abaculus/tarball/1.1.0-cdb4", - "resolved": "https://github.com/CartoDB/abaculus/tarball/1.1.0-cdb4" - }, - "sphericalmercator": { - "version": "1.0.3", - "from": "sphericalmercator@1.0.3", - "resolved": "https://registry.npmjs.org/sphericalmercator/-/sphericalmercator-1.0.3.tgz" + "turbo-cartocss": { + "version": "0.4.0", + "from": "turbo-cartocss@>=0.4.0 <0.5.0", + "dependencies": { + "browser-request": { + "version": "0.3.3", + "from": "browser-request@>=0.3.3 <0.4.0", + "resolved": "https://registry.npmjs.org/browser-request/-/browser-request-0.3.3.tgz" + }, + "colorbrewer": { + "version": "0.0.2", + "from": "colorbrewer@0.0.2", + "resolved": "https://registry.npmjs.org/colorbrewer/-/colorbrewer-0.0.2.tgz" + }, + "es6-promise": { + "version": "3.1.2", + "from": "es6-promise@>=3.0.2 <4.0.0", + "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-3.1.2.tgz" + }, + "less": { + "version": "2.6.0", + "from": "less@>=2.5.3 <3.0.0", + "resolved": "https://registry.npmjs.org/less/-/less-2.6.0.tgz", + "dependencies": { + "errno": { + "version": "0.1.4", + "from": "errno@>=0.1.1 <0.2.0", + "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.4.tgz", + "dependencies": { + "prr": { + "version": "0.0.0", + "from": "prr@>=0.0.0 <0.1.0", + "resolved": "https://registry.npmjs.org/prr/-/prr-0.0.0.tgz" + } + } + }, + "graceful-fs": { + "version": "3.0.8", + "from": "graceful-fs@>=3.0.5 <4.0.0", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-3.0.8.tgz" + }, + "image-size": { + "version": "0.3.5", + "from": "image-size@>=0.3.5 <0.4.0", + "resolved": "https://registry.npmjs.org/image-size/-/image-size-0.3.5.tgz" + }, + "mime": { + "version": "1.3.4", + "from": "mime@>=1.2.11 <2.0.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.3.4.tgz" + }, + "mkdirp": { + "version": "0.5.1", + "from": "mkdirp@>=0.5.0 <0.6.0", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "dependencies": { + "minimist": { + "version": "0.0.8", + "from": "minimist@0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz" + } + } + }, + "promise": { + "version": "6.1.0", + "from": "promise@>=6.0.1 <7.0.0", + "resolved": "https://registry.npmjs.org/promise/-/promise-6.1.0.tgz", + "dependencies": { + "asap": { + "version": "1.0.0", + "from": "asap@>=1.0.0 <1.1.0", + "resolved": "https://registry.npmjs.org/asap/-/asap-1.0.0.tgz" + } + } + }, + "source-map": { + "version": "0.4.4", + "from": "source-map@>=0.4.2 <0.5.0", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz", + "dependencies": { + "amdefine": { + "version": "1.0.0", + "from": "amdefine@>=0.0.4", + "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.0.tgz" + } + } + } + } + }, + "postcss": { + "version": "5.0.16", + "from": "postcss@>=5.0.13 <6.0.0", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-5.0.16.tgz", + "dependencies": { + "supports-color": { + "version": "3.1.2", + "from": "supports-color@>=3.1.2 <4.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.1.2.tgz", + "dependencies": { + "has-flag": { + "version": "1.0.0", + "from": "has-flag@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz" + } + } + }, + "source-map": { + "version": "0.5.3", + "from": "source-map@>=0.5.1 <0.6.0", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.3.tgz" + }, + "js-base64": { + "version": "2.1.9", + "from": "js-base64@>=2.1.9 <3.0.0", + "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.1.9.tgz" + } + } + }, + "postcss-value-parser": { + "version": "3.3.0", + "from": "postcss-value-parser@>=3.2.3 <4.0.0", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.0.tgz" + }, + "querystring": { + "version": "0.2.0", + "from": "querystring@>=0.2.0 <0.3.0", + "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz" + }, + "request": { + "version": "2.69.0", + "from": "request@>=2.67.0 <3.0.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.69.0.tgz", + "dependencies": { + "aws-sign2": { + "version": "0.6.0", + "from": "aws-sign2@>=0.6.0 <0.7.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.6.0.tgz" + }, + "aws4": { + "version": "1.2.1", + "from": "aws4@>=1.2.1 <2.0.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.2.1.tgz" + }, + "bl": { + "version": "1.0.3", + "from": "bl@>=1.0.0 <1.1.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-1.0.3.tgz", + "dependencies": { + "readable-stream": { + "version": "2.0.5", + "from": "readable-stream@>=2.0.5 <2.1.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.5.tgz", + "dependencies": { + "core-util-is": { + "version": "1.0.2", + "from": "core-util-is@>=1.0.0 <1.1.0", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz" + }, + "inherits": { + "version": "2.0.1", + "from": "inherits@>=2.0.1 <2.1.0", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz" + }, + "isarray": { + "version": "0.0.1", + "from": "isarray@0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz" + }, + "process-nextick-args": { + "version": "1.0.6", + "from": "process-nextick-args@>=1.0.6 <1.1.0", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.6.tgz" + }, + "string_decoder": { + "version": "0.10.31", + "from": "string_decoder@>=0.10.0 <0.11.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz" + }, + "util-deprecate": { + "version": "1.0.2", + "from": "util-deprecate@>=1.0.1 <1.1.0", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz" + } + } + } + } + }, + "caseless": { + "version": "0.11.0", + "from": "caseless@>=0.11.0 <0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.11.0.tgz" + }, + "combined-stream": { + "version": "1.0.5", + "from": "combined-stream@>=1.0.5 <1.1.0", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.5.tgz", + "dependencies": { + "delayed-stream": { + "version": "1.0.0", + "from": "delayed-stream@>=1.0.0 <1.1.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz" + } + } + }, + "extend": { + "version": "3.0.0", + "from": "extend@>=3.0.0 <3.1.0", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.0.tgz" + }, + "forever-agent": { + "version": "0.6.1", + "from": "forever-agent@>=0.6.1 <0.7.0", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz" + }, + "form-data": { + "version": "1.0.0-rc3", + "from": "form-data@>=1.0.0-rc3 <1.1.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-1.0.0-rc3.tgz", + "dependencies": { + "async": { + "version": "1.5.2", + "from": "async@>=1.4.0 <2.0.0", + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz" + } + } + }, + "har-validator": { + "version": "2.0.6", + "from": "har-validator@>=2.0.6 <2.1.0", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-2.0.6.tgz", + "dependencies": { + "chalk": { + "version": "1.1.1", + "from": "chalk@>=1.1.1 <2.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.1.tgz", + "dependencies": { + "ansi-styles": { + "version": "2.2.0", + "from": "ansi-styles@>=2.1.0 <3.0.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.0.tgz", + "dependencies": { + "color-convert": { + "version": "1.0.0", + "from": "color-convert@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.0.0.tgz" + } + } + }, + "escape-string-regexp": { + "version": "1.0.5", + "from": "escape-string-regexp@>=1.0.2 <2.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz" + }, + "has-ansi": { + "version": "2.0.0", + "from": "has-ansi@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "dependencies": { + "ansi-regex": { + "version": "2.0.0", + "from": "ansi-regex@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.0.0.tgz" + } + } + }, + "strip-ansi": { + "version": "3.0.1", + "from": "strip-ansi@>=3.0.0 <4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "dependencies": { + "ansi-regex": { + "version": "2.0.0", + "from": "ansi-regex@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.0.0.tgz" + } + } + }, + "supports-color": { + "version": "2.0.0", + "from": "supports-color@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz" + } + } + }, + "commander": { + "version": "2.9.0", + "from": "commander@>=2.9.0 <3.0.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.9.0.tgz", + "dependencies": { + "graceful-readlink": { + "version": "1.0.1", + "from": "graceful-readlink@>=1.0.0", + "resolved": "https://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz" + } + } + }, + "is-my-json-valid": { + "version": "2.13.1", + "from": "is-my-json-valid@>=2.12.4 <3.0.0", + "resolved": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.13.1.tgz", + "dependencies": { + "generate-function": { + "version": "2.0.0", + "from": "generate-function@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.0.0.tgz" + }, + "generate-object-property": { + "version": "1.2.0", + "from": "generate-object-property@>=1.1.0 <2.0.0", + "resolved": "https://registry.npmjs.org/generate-object-property/-/generate-object-property-1.2.0.tgz", + "dependencies": { + "is-property": { + "version": "1.0.2", + "from": "is-property@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz" + } + } + }, + "jsonpointer": { + "version": "2.0.0", + "from": "jsonpointer@2.0.0", + "resolved": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-2.0.0.tgz" + }, + "xtend": { + "version": "4.0.1", + "from": "xtend@>=4.0.0 <5.0.0", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz" + } + } + }, + "pinkie-promise": { + "version": "2.0.0", + "from": "pinkie-promise@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.0.tgz", + "dependencies": { + "pinkie": { + "version": "2.0.4", + "from": "pinkie@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz" + } + } + } + } + }, + "hawk": { + "version": "3.1.3", + "from": "hawk@>=3.1.0 <3.2.0", + "resolved": "https://registry.npmjs.org/hawk/-/hawk-3.1.3.tgz", + "dependencies": { + "hoek": { + "version": "2.16.3", + "from": "hoek@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz" + }, + "boom": { + "version": "2.10.1", + "from": "boom@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/boom/-/boom-2.10.1.tgz" + }, + "cryptiles": { + "version": "2.0.5", + "from": "cryptiles@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-2.0.5.tgz" + }, + "sntp": { + "version": "1.0.9", + "from": "sntp@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/sntp/-/sntp-1.0.9.tgz" + } + } + }, + "http-signature": { + "version": "1.1.1", + "from": "http-signature@>=1.1.0 <1.2.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.1.1.tgz", + "dependencies": { + "assert-plus": { + "version": "0.2.0", + "from": "assert-plus@>=0.2.0 <0.3.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.2.0.tgz" + }, + "jsprim": { + "version": "1.2.2", + "from": "jsprim@>=1.2.2 <2.0.0", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.2.2.tgz", + "dependencies": { + "extsprintf": { + "version": "1.0.2", + "from": "extsprintf@1.0.2", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.0.2.tgz" + }, + "json-schema": { + "version": "0.2.2", + "from": "json-schema@0.2.2", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.2.tgz" + }, + "verror": { + "version": "1.3.6", + "from": "verror@1.3.6", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.3.6.tgz" + } + } + }, + "sshpk": { + "version": "1.7.4", + "from": "sshpk@>=1.7.0 <2.0.0", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.7.4.tgz", + "dependencies": { + "asn1": { + "version": "0.2.3", + "from": "asn1@>=0.2.3 <0.3.0", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz" + }, + "dashdash": { + "version": "1.13.0", + "from": "dashdash@>=1.10.1 <2.0.0", + "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.13.0.tgz", + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "from": "assert-plus@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz" + } + } + }, + "jsbn": { + "version": "0.1.0", + "from": "jsbn@>=0.1.0 <0.2.0", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.0.tgz" + }, + "tweetnacl": { + "version": "0.14.0", + "from": "tweetnacl@>=0.13.0 <1.0.0", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.0.tgz" + }, + "jodid25519": { + "version": "1.0.2", + "from": "jodid25519@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/jodid25519/-/jodid25519-1.0.2.tgz" + }, + "ecc-jsbn": { + "version": "0.1.1", + "from": "ecc-jsbn@>=0.0.1 <1.0.0", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz" + } + } + } + } + }, + "is-typedarray": { + "version": "1.0.0", + "from": "is-typedarray@>=1.0.0 <1.1.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz" + }, + "isstream": { + "version": "0.1.2", + "from": "isstream@>=0.1.2 <0.2.0", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz" + }, + "json-stringify-safe": { + "version": "5.0.1", + "from": "json-stringify-safe@>=5.0.1 <5.1.0", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz" + }, + "mime-types": { + "version": "2.1.10", + "from": "mime-types@>=2.1.7 <2.2.0", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.10.tgz", + "dependencies": { + "mime-db": { + "version": "1.22.0", + "from": "mime-db@>=1.22.0 <1.23.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.22.0.tgz" + } + } + }, + "node-uuid": { + "version": "1.4.7", + "from": "node-uuid@>=1.4.7 <1.5.0", + "resolved": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.7.tgz" + }, + "oauth-sign": { + "version": "0.8.1", + "from": "oauth-sign@>=0.8.0 <0.9.0", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.1.tgz" + }, + "qs": { + "version": "6.0.2", + "from": "qs@>=6.0.2 <6.1.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.0.2.tgz" + }, + "stringstream": { + "version": "0.0.5", + "from": "stringstream@>=0.0.4 <0.1.0", + "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz" + }, + "tough-cookie": { + "version": "2.2.1", + "from": "tough-cookie@>=2.2.0 <2.3.0", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.2.1.tgz" + }, + "tunnel-agent": { + "version": "0.4.2", + "from": "tunnel-agent@>=0.4.1 <0.5.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.2.tgz" + } + } + } + } } } } diff --git a/package.json b/package.json index b60ebf7c..61e8f989 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "windshaft-cartodb", - "version": "2.25.1", + "version": "2.26.0", "description": "A map tile server for CartoDB", "keywords": [ "cartodb" @@ -26,7 +26,7 @@ "node-statsd": "~0.0.7", "underscore" : "~1.6.0", "dot": "~1.0.2", - "windshaft": "1.11.0", + "windshaft": "1.13.0", "step": "~0.0.6", "queue-async": "~1.0.7", "request": "~2.62.0", diff --git a/test/acceptance/limits.js b/test/acceptance/limits.js index e7e4a305..ef91dac4 100644 --- a/test/acceptance/limits.js +++ b/test/acceptance/limits.js @@ -292,7 +292,8 @@ describe('render limits', function() { if (err) { done(err); } - assert.imageEqualsFile(res.body, './test/fixtures/render-timeout-fallback.png', 25, + var referenceImagePath = './test/fixtures/render-timeout-fallback.png'; + assert.imageBufferIsSimilarToFile(res.body, referenceImagePath, 25, function(imgErr/*, similarity*/) { done(imgErr); } diff --git a/test/acceptance/multilayer.js b/test/acceptance/multilayer.js index d4e06e52..4118b9d8 100644 --- a/test/acceptance/multilayer.js +++ b/test/acceptance/multilayer.js @@ -122,7 +122,7 @@ describe(suiteName, function() { ' WHERE m.tabname = any ((SELECT tablenames from querytables)::regclass[])'); } - assert.imageEqualsFile(res.body, 'test/fixtures/test_table_0_0_0_multilayer1.png', + assert.imageBufferIsSimilarToFile(res.body, 'test/fixtures/test_table_0_0_0_multilayer1.png', IMAGE_EQUALS_HIGHER_TOLERANCE_PER_MIL, function(err/*, similarity*/) { next(err); } @@ -190,38 +190,50 @@ describe(suiteName, function() { }); - it("should include serverMedata in the response", function(done) { - global.environment.serverMetadata = { cdn_url : { http:'test', https: 'tests' } }; - var layergroup = { - version: '1.0.0', - layers: [ - { options: { - sql: 'select cartodb_id, ST_Translate(the_geom_webmercator, 5e6, 0) as the_geom_webmercator' + - ' from test_table limit 2', - cartocss: '#layer { marker-fill:red; marker-width:32; marker-allow-overlap:true; }', - cartocss_version: '2.0.1' - } } - ] - }; + describe('server-metadata', function() { + var serverMetadata; + beforeEach(function() { + serverMetadata = global.environment.serverMetadata; + global.environment.serverMetadata = { cdn_url : { http:'test', https: 'tests' } }; + }); + + afterEach(function() { + global.environment.serverMetadata = serverMetadata; + }); + + it("should include serverMedata in the response", function(done) { + var layergroup = { + version: '1.0.0', + layers: [ + { options: { + sql: 'select cartodb_id, ST_Translate(the_geom_webmercator, 5e6, 0) as the_geom_webmercator' + + ' from test_table limit 2', + cartocss: '#layer { marker-fill:red; marker-width:32; marker-allow-overlap:true; }', + cartocss_version: '2.0.1' + } } + ] + }; + + step( + function do_create_get() + { + var next = this; + assert.response(server, { + url: layergroup_url + '?config=' + encodeURIComponent(JSON.stringify(layergroup)), + method: 'GET', + headers: {host: 'localhost'} + }, {}, function(res, err) { next(err, res); }); + }, + function do_check_create(err, res) { + var parsed = JSON.parse(res.body); + keysToDelete['map_cfg|' + LayergroupToken.parse(parsed.layergroupid).token] = 0; + keysToDelete['user:localhost:mapviews:global'] = 5; + assert.ok(_.isEqual(parsed.cdn_url, global.environment.serverMetadata.cdn_url)); + done(); + } + ); + }); - step( - function do_create_get() - { - var next = this; - assert.response(server, { - url: layergroup_url + '?config=' + encodeURIComponent(JSON.stringify(layergroup)), - method: 'GET', - headers: {host: 'localhost'} - }, {}, function(res, err) { next(err, res); }); - }, - function do_check_create(err, res) { - var parsed = JSON.parse(res.body); - keysToDelete['map_cfg|' + LayergroupToken.parse(parsed.layergroupid).token] = 0; - keysToDelete['user:localhost:mapviews:global'] = 5; - assert.ok(_.isEqual(parsed.cdn_url, global.environment.serverMetadata.cdn_url)); - done(); - } - ); }); @@ -392,7 +404,8 @@ describe(suiteName, function() { ' WHERE m.tabname = any ((SELECT tablenames from querytables)::regclass[])'); } - assert.imageEqualsFile(res.body, 'test/fixtures/test_multilayer_bbox.png', IMAGE_EQUALS_TOLERANCE_PER_MIL, + var referenceImagePath = 'test/fixtures/test_multilayer_bbox.png'; + assert.imageBufferIsSimilarToFile(res.body, referenceImagePath, IMAGE_EQUALS_TOLERANCE_PER_MIL, function(err/*, similarity*/) { next(err); }); @@ -431,7 +444,8 @@ describe(suiteName, function() { ' WHERE m.tabname = any ((SELECT tablenames from querytables)::regclass[])'); } - assert.imageEqualsFile(res.body, 'test/fixtures/test_multilayer_bbox.png', IMAGE_EQUALS_TOLERANCE_PER_MIL, + var referenceImagePath = 'test/fixtures/test_multilayer_bbox.png'; + assert.imageBufferIsSimilarToFile(res.body, referenceImagePath, IMAGE_EQUALS_TOLERANCE_PER_MIL, function(err/*, similarity*/) { next(err); }); @@ -1007,7 +1021,7 @@ describe(suiteName, function() { }, {}, function(res) { assert.equal(res.statusCode, 200, res.body); assert.equal(res.headers['content-type'], "image/png"); - assert.imageEqualsFile(res.body, windshaft_fixtures + '/test_default_mapnik_point.png', + assert.imageBufferIsSimilarToFile(res.body, windshaft_fixtures + '/test_default_mapnik_point.png', IMAGE_EQUALS_TOLERANCE_PER_MIL, function(err/*, similarity*/) { next(err); } diff --git a/test/acceptance/multilayer_server.js b/test/acceptance/multilayer_server.js index 544aea6c..4d7d77b7 100644 --- a/test/acceptance/multilayer_server.js +++ b/test/acceptance/multilayer_server.js @@ -70,8 +70,7 @@ describe('tests from old api translated to multilayer', function() { }, function(res) { var parsed = JSON.parse(res.body); - assert.ok(parsed.errors[0].match(/^style0/)); - assert.ok(parsed.errors[0].match(/missing closing/)); + assert.ok(parsed.errors[0].match(/:1:1: Unclosed block/)); done(); } ); diff --git a/test/acceptance/overviews_queries.js b/test/acceptance/overviews_queries.js index 8024ba72..0434ebfc 100644 --- a/test/acceptance/overviews_queries.js +++ b/test/acceptance/overviews_queries.js @@ -30,7 +30,8 @@ describe('overviews_queries', function() { if (err) { return done(err); } - assert.imageEqualsFile(tile.body, './test/fixtures/' + fixture, IMAGE_EQUALS_TOLERANCE_PER_MIL, done); + var referenceImagePath = './test/fixtures/' + fixture; + assert.imageBufferIsSimilarToFile(tile.body, referenceImagePath, IMAGE_EQUALS_TOLERANCE_PER_MIL, done); }; } diff --git a/test/acceptance/ported/blend.js b/test/acceptance/ported/blend.js index eca436ae..1e844d80 100644 --- a/test/acceptance/ported/blend.js +++ b/test/acceptance/ported/blend.js @@ -95,10 +95,12 @@ describe('blend png renderer', function() { var zxy = [tileRequest.z, tileRequest.x, tileRequest.y]; it('tile all/' + zxy.join('/') + '.png', function (done) { testClient.getTileLayer(plainTorqueMapConfig(testScenario.plainColor), tileRequest, function(err, res) { - assert.imageEqualsFile(res.body, blendPngFixture(zxy), IMAGE_TOLERANCE_PER_MIL, function(err) { - assert.ok(!err); - done(); - }); + assert.imageBufferIsSimilarToFile(res.body, blendPngFixture(zxy), IMAGE_TOLERANCE_PER_MIL, + function(err) { + assert.ok(!err); + done(); + } + ); }); }); }); diff --git a/test/acceptance/ported/blend_filtering.js b/test/acceptance/ported/blend_filtering.js index c1b11933..dc8cd470 100644 --- a/test/acceptance/ported/blend_filtering.js +++ b/test/acceptance/ported/blend_filtering.js @@ -156,10 +156,12 @@ describe('blend layer filtering', function() { it('should filter on ' + layerFilter + '/1/0/0.png', function (done) { testClient.getTileLayer(mapConfig, tileRequest, function(err, res) { - assert.imageEqualsFile(res.body, blendPngFixture(filteredLayers), IMG_TOLERANCE_PER_MIL, function(err) { - assert.ok(!err); - done(); - }); + assert.imageBufferIsSimilarToFile(res.body, blendPngFixture(filteredLayers), IMG_TOLERANCE_PER_MIL, + function(err) { + assert.ok(!err); + done(); + } + ); }); }); }); diff --git a/test/acceptance/ported/blend_http_fallback.js b/test/acceptance/ported/blend_http_fallback.js index 3c35c5fc..91e832f6 100644 --- a/test/acceptance/ported/blend_http_fallback.js +++ b/test/acceptance/ported/blend_http_fallback.js @@ -111,10 +111,12 @@ describe('blend http fallback', function() { it('should fallback on http error while blending layers ' + layerFilter + '/1/0/0.png', function (done) { testClient.getTileLayer(mapConfig, tileRequest, function(err, res) { - assert.imageEqualsFile(res.body, blendPngFixture(filteredLayers), IMG_TOLERANCE_PER_MIL, function(err) { - assert.ok(!err, err); - done(); - }); + assert.imageBufferIsSimilarToFile(res.body, blendPngFixture(filteredLayers), IMG_TOLERANCE_PER_MIL, + function(err) { + assert.ok(!err, err); + done(); + } + ); }); }); }); diff --git a/test/acceptance/ported/external_resources.js b/test/acceptance/ported/external_resources.js index a0affa83..6f73b52e 100644 --- a/test/acceptance/ported/external_resources.js +++ b/test/acceptance/ported/external_resources.js @@ -57,7 +57,8 @@ describe('external resources', function() { if (err) { return done(err); } - assert.imageEqualsFile(res.body, './test/fixtures/' + fixture, IMAGE_EQUALS_TOLERANCE_PER_MIL, done); + var referenceImagePath = './test/fixtures/' + fixture; + assert.imageBufferIsSimilarToFile(res.body, referenceImagePath, IMAGE_EQUALS_TOLERANCE_PER_MIL, done); }; } diff --git a/test/acceptance/ported/limits.js b/test/acceptance/ported/limits.js index f032ff3f..c111c87c 100644 --- a/test/acceptance/ported/limits.js +++ b/test/acceptance/ported/limits.js @@ -84,11 +84,13 @@ describe.skip('render limits', function() { testClient.withLayergroup(slowQueryMapConfig, options, function(err, requestTile, finish) { var tileUrl = '/0/0/0.png'; requestTile(tileUrl, options, function(err, res) { - assert.imageEqualsFile(res.body, fixtureImage, IMAGE_EQUALS_TOLERANCE_PER_MIL, function(err) { - finish(function(finishErr) { - done(err || finishErr); - }); - }); + assert.imageBufferIsSimilarToFile(res.body, fixtureImage, IMAGE_EQUALS_TOLERANCE_PER_MIL, + function(err) { + finish(function(finishErr) { + done(err || finishErr); + }); + } + ); }); }); }); diff --git a/test/acceptance/ported/multilayer.js b/test/acceptance/ported/multilayer.js index 7e9b984c..eb337070 100644 --- a/test/acceptance/ported/multilayer.js +++ b/test/acceptance/ported/multilayer.js @@ -117,7 +117,8 @@ describe('multilayer', function() { assert.equal(res.statusCode, 200, res.body); assert.equal(res.headers['content-type'], "image/png"); checkCORSHeaders(res); - assert.imageEqualsFile(res.body, './test/fixtures/test_bigpoint_red.png', IMAGE_EQUALS_TOLERANCE_PER_MIL, + var referenceImagePath = './test/fixtures/test_bigpoint_red.png'; + assert.imageBufferIsSimilarToFile(res.body, referenceImagePath, IMAGE_EQUALS_TOLERANCE_PER_MIL, function(err) { next(err); }); @@ -191,7 +192,8 @@ describe('multilayer', function() { }, {}, function(res) { assert.equal(res.statusCode, 200, res.body); assert.equal(res.headers['content-type'], "image/png"); - assert.imageEqualsFile(res.body, './test/acceptance/ported/fixtures/test_table_0_0_0_multilayer1.png', + var referenceImagePath = './test/acceptance/ported/fixtures/test_table_0_0_0_multilayer1.png'; + assert.imageBufferIsSimilarToFile(res.body, referenceImagePath, IMAGE_EQUALS_TOLERANCE_PER_MIL, function(err) { next(err); }); @@ -302,7 +304,8 @@ describe('multilayer', function() { }, {}, function(res) { assert.equal(res.statusCode, 200, res.body); assert.equal(res.headers['content-type'], "image/png"); - assert.imageEqualsFile(res.body, './test/acceptance/ported/fixtures/test_table_0_0_0_multilayer1.png', + var referenceImagePath = './test/acceptance/ported/fixtures/test_table_0_0_0_multilayer1.png'; + assert.imageBufferIsSimilarToFile(res.body, referenceImagePath, IMAGE_EQUALS_TOLERANCE_PER_MIL, function(err) { next(err); }); @@ -425,7 +428,8 @@ describe('multilayer', function() { }, {}, function(res) { assert.equal(res.statusCode, 200, res.body); assert.equal(res.headers['content-type'], "image/png"); - assert.imageEqualsFile(res.body, './test/acceptance/ported/fixtures/test_table_0_0_0_multilayer1.png', + var referenceImagePath = './test/acceptance/ported/fixtures/test_table_0_0_0_multilayer1.png'; + assert.imageBufferIsSimilarToFile(res.body, referenceImagePath, IMAGE_EQUALS_TOLERANCE_PER_MIL, function(err) { next(err); }); @@ -541,7 +545,8 @@ describe('multilayer', function() { }, {}, function(res) { assert.equal(res.statusCode, 200, res.body); assert.equal(res.headers['content-type'], "image/png"); - assert.imageEqualsFile(res.body, './test/acceptance/ported/fixtures/test_table_0_0_0_multilayer1.png', + var referenceImagePath = './test/acceptance/ported/fixtures/test_table_0_0_0_multilayer1.png'; + assert.imageBufferIsSimilarToFile(res.body, referenceImagePath, IMAGE_EQUALS_TOLERANCE_PER_MIL, function(err) { next(err); }); @@ -727,7 +732,8 @@ describe('multilayer', function() { }, {}, function(res) { assert.equal(res.statusCode, 200, res.body); assert.equal(res.headers['content-type'], "image/png"); - assert.imageEqualsFile(res.body, './test/acceptance/ported/fixtures/test_table_0_0_0_multilayer2.png', + var referenceImagePath = './test/acceptance/ported/fixtures/test_table_0_0_0_multilayer2.png'; + assert.imageBufferIsSimilarToFile(res.body, referenceImagePath, IMAGE_EQUALS_TOLERANCE_PER_MIL, function(err) { next(err); }); @@ -761,7 +767,8 @@ describe('multilayer', function() { }, {}, function(res) { assert.equal(res.statusCode, 200, res.body); assert.equal(res.headers['content-type'], "image/png"); - assert.imageEqualsFile(res.body, './test/acceptance/ported/fixtures/test_table_0_0_0_multilayer3.png', + var referenceImagePath = './test/acceptance/ported/fixtures/test_table_0_0_0_multilayer3.png'; + assert.imageBufferIsSimilarToFile(res.body, referenceImagePath, IMAGE_EQUALS_TOLERANCE_PER_MIL, function(err) { next(err); }); @@ -856,7 +863,8 @@ describe('multilayer', function() { }, {}, function(res) { assert.equal(res.statusCode, 200, res.body); assert.equal(res.headers['content-type'], "image/png"); - assert.imageEqualsFile(res.body, './test/acceptance/ported/fixtures/test_table_0_0_0_multilayer4.png', + var referenceImagePath = './test/acceptance/ported/fixtures/test_table_0_0_0_multilayer4.png'; + assert.imageBufferIsSimilarToFile(res.body, referenceImagePath, IMAGE_EQUALS_TOLERANCE_PER_MIL, function(err) { next(err); }); @@ -1259,7 +1267,7 @@ describe('multilayer', function() { assert.equal(res.statusCode, 200, res.body); assert.equal(res.headers['content-type'], "image/png"); checkCORSHeaders(res); - assert.imageEqualsFile(res.body, './test/fixtures/test_bigpoint_red.png', + assert.imageBufferIsSimilarToFile(res.body, './test/fixtures/test_bigpoint_red.png', IMAGE_EQUALS_TOLERANCE_PER_MIL, function(err) { next(err); }); diff --git a/test/acceptance/ported/raster.js b/test/acceptance/ported/raster.js index 00d34509..cd3d43b9 100644 --- a/test/acceptance/ported/raster.js +++ b/test/acceptance/ported/raster.js @@ -87,7 +87,7 @@ describe('raster', function() { assert.equal(res.statusCode, 200, res.body); assert.deepEqual(res.headers['content-type'], "image/png"); var next = this; - assert.imageEqualsFile(res.body, + assert.imageBufferIsSimilarToFile(res.body, './test/fixtures/raster_gray_rect.png', IMAGE_EQUALS_TOLERANCE_PER_MIL, function(err) { try { diff --git a/test/acceptance/ported/server_gettile.js b/test/acceptance/ported/server_gettile.js index 7dad9aa3..580e8a61 100644 --- a/test/acceptance/ported/server_gettile.js +++ b/test/acceptance/ported/server_gettile.js @@ -34,7 +34,9 @@ describe('server_gettile', function() { if (err) { return done(err); } - assert.imageEqualsFile(res.body, './test/fixtures/' + fixture, IMAGE_EQUALS_TOLERANCE_PER_MIL, done); + assert.imageBufferIsSimilarToFile( + res.body, './test/fixtures/' + fixture, IMAGE_EQUALS_TOLERANCE_PER_MIL, done + ); }; } @@ -113,12 +115,13 @@ describe('server_gettile', function() { assert.ok(res.headers.hasOwnProperty('x-windshaft-cache'), "Did not hit renderer cache on second time"); assert.ok(res.headers['x-windshaft-cache'] >= 0); - assert.imageEqualsFile(res.body, imageFixture, IMAGE_EQUALS_TOLERANCE_PER_MIL, function(err) { - - finish(function(finishErr) { - done(err || finishErr); - }); - }); + assert.imageBufferIsSimilarToFile(res.body, imageFixture, IMAGE_EQUALS_TOLERANCE_PER_MIL, + function(err) { + finish(function(finishErr) { + done(err || finishErr); + }); + } + ); }); }); }); diff --git a/test/acceptance/ported/server_png8_format.js b/test/acceptance/ported/server_png8_format.js index fdd5a131..39c89c66 100644 --- a/test/acceptance/ported/server_png8_format.js +++ b/test/acceptance/ported/server_png8_format.js @@ -108,7 +108,7 @@ describe('server_png8_format', function() { assert.equal(responsePng8.headers['content-type'], "image/png"); bufferPng8 = responsePng8.body; assert.ok(bufferPng8.length < bufferPng32.length); - assert.imageBuffersAreEqual(bufferPng32, bufferPng8, IMAGE_EQUALS_TOLERANCE_PER_MIL, + assert.imageBuffersAreSimilar(bufferPng32, bufferPng8, IMAGE_EQUALS_TOLERANCE_PER_MIL, function(err, imagePaths, similarity) { keysToDelete['map_cfg|' + LayergroupToken.parse(layergroupId).token] = 0; diff --git a/test/acceptance/ported/torque_png.js b/test/acceptance/ported/torque_png.js index fef2c621..69eaadab 100644 --- a/test/acceptance/ported/torque_png.js +++ b/test/acceptance/ported/torque_png.js @@ -83,10 +83,12 @@ describe('torque png renderer', function() { var zxy = [z, x, y]; it('tile ' + zxy.join('/') + '.torque.png', function (done) { testClient.getTileLayer(torquePngPointsMapConfig, tileRequest, function(err, res) { - assert.imageEqualsFile(res.body, torquePngFixture(zxy), IMAGE_TOLERANCE_PER_MIL, function(err) { - assert.ok(!err); - done(); - }); + assert.imageBufferIsSimilarToFile(res.body, torquePngFixture(zxy), IMAGE_TOLERANCE_PER_MIL, + function(err) { + assert.ok(!err); + done(); + } + ); }); }); }); diff --git a/test/acceptance/ported/wrap.js b/test/acceptance/ported/wrap.js index 1f46b5c3..64a8e2f4 100644 --- a/test/acceptance/ported/wrap.js +++ b/test/acceptance/ported/wrap.js @@ -107,10 +107,12 @@ describe('wrap x coordinate', function() { var fixtureZxy = [testScenario.fixture.z, testScenario.fixture.x, testScenario.fixture.y]; it('tile all/' + zxy.join('/') + '.png', function (done) { testClient.getTileLayer(plainTorqueMapConfig(testScenario.plainColor), tileRequest, function(err, res) { - assert.imageEqualsFile(res.body, blendPngFixture(fixtureZxy), IMG_TOLERANCE_PER_MIL, function(err) { - assert.ok(!err); - done(); - }); + assert.imageBufferIsSimilarToFile(res.body, blendPngFixture(fixtureZxy), IMG_TOLERANCE_PER_MIL, + function(err) { + assert.ok(!err); + done(); + } + ); }); }); }); diff --git a/test/acceptance/templates.js b/test/acceptance/templates.js index 137f5ce5..b9271c97 100644 --- a/test/acceptance/templates.js +++ b/test/acceptance/templates.js @@ -313,51 +313,63 @@ describe('template_api', function() { }); }); - it("instance endpoint should return server metadata", function(done){ - global.environment.serverMetadata = { cdn_url : { http:'test', https: 'tests' } }; - var tmpl = _.clone(template_acceptance1); - tmpl.name = "rambotemplate2"; + describe('server-metadata', function() { + var serverMetadata; + beforeEach(function() { + serverMetadata = global.environment.serverMetadata; + global.environment.serverMetadata = { cdn_url : { http:'test', https: 'tests' } }; + }); - step(function postTemplate1() { - var next = this; - var post_request = { - url: '/api/v1/map/named?api_key=1234', - method: 'POST', - headers: {host: 'localhost', 'Content-Type': 'application/json' }, - data: JSON.stringify(tmpl) - }; - assert.response(server, post_request, {}, function(res) { - next(null, res); - }); - }, - function testCORS() { - var next = this; - assert.response(server, { - url: '/api/v1/map/named/' + tmpl.name, - method: 'POST', - headers: {host: 'localhost', 'Content-Type': 'application/json' } - },{ - status: 200 - }, function(res) { - var parsed = JSON.parse(res.body); - keysToDelete['map_cfg|' + LayergroupToken.parse(parsed.layergroupid).token] = 0; - keysToDelete['user:localhost:mapviews:global'] = 5; - assert.ok(_.isEqual(parsed.cdn_url, global.environment.serverMetadata.cdn_url)); - next(null); - }); - }, - function deleteTemplate(err) { - assert.ifError(err); - var del_request = { - url: '/api/v1/map/named/' + tmpl.name + '?api_key=1234', - method: 'DELETE', - headers: {host: 'localhost', 'Content-Type': 'application/json' } - }; - assert.response(server, del_request, {}, function() { - done(); - }); - } - ); + afterEach(function() { + global.environment.serverMetadata = serverMetadata; + }); + + + it("instance endpoint should return server metadata", function(done){ + var tmpl = _.clone(template_acceptance1); + tmpl.name = "rambotemplate2"; + + step(function postTemplate1() { + var next = this; + var post_request = { + url: '/api/v1/map/named?api_key=1234', + method: 'POST', + headers: {host: 'localhost', 'Content-Type': 'application/json' }, + data: JSON.stringify(tmpl) + }; + assert.response(server, post_request, {}, function(res) { + next(null, res); + }); + }, + function testCORS() { + var next = this; + assert.response(server, { + url: '/api/v1/map/named/' + tmpl.name, + method: 'POST', + headers: {host: 'localhost', 'Content-Type': 'application/json' } + },{ + status: 200 + }, function(res) { + var parsed = JSON.parse(res.body); + keysToDelete['map_cfg|' + LayergroupToken.parse(parsed.layergroupid).token] = 0; + keysToDelete['user:localhost:mapviews:global'] = 5; + assert.ok(_.isEqual(parsed.cdn_url, global.environment.serverMetadata.cdn_url)); + next(null); + }); + }, + function deleteTemplate(err) { + assert.ifError(err); + var del_request = { + url: '/api/v1/map/named/' + tmpl.name + '?api_key=1234', + method: 'DELETE', + headers: {host: 'localhost', 'Content-Type': 'application/json' } + }; + assert.response(server, del_request, {}, function() { + done(); + }); + } + ); + }); }); diff --git a/test/acceptance/widgets/named-maps.js b/test/acceptance/widgets/named-maps.js new file mode 100644 index 00000000..ee40d1ce --- /dev/null +++ b/test/acceptance/widgets/named-maps.js @@ -0,0 +1,250 @@ +var assert = require('../../support/assert'); +var step = require('step'); + +var url = require('url'); +var queue = require('queue-async'); + +var helper = require('../../support/test_helper'); + +var CartodbWindshaft = require('../../../lib/cartodb/server'); +var serverOptions = require('../../../lib/cartodb/server_options'); +var server = new CartodbWindshaft(serverOptions); + +var LayergroupToken = require('../../../lib/cartodb/models/layergroup_token'); + +describe('named-maps widgets', function() { + + var username = 'localhost'; + var widgetsTemplateName = 'widgets-template'; + + var layergroupid; + var layergroup; + var keysToDelete; + + beforeEach(function(done) { + keysToDelete = {}; + + var widgetsTemplate = { + version: '0.0.1', + name: widgetsTemplateName, + layergroup: { + version: '1.5.0', + layers: [ + { + type: 'cartodb', + options: { + sql: "select * from populated_places_simple_reduced_private", + cartocss: '#layer { marker-fill: blue; }', + cartocss_version: '2.3.0', + widgets: { + pop_max_formula_sum: { + type: 'formula', + options: { + column: 'pop_max', + operation: 'sum' + } + }, + country_places_count: { + type: 'aggregation', + options: { + column: 'adm0_a3', + aggregation: 'count' + } + }, + pop_max: { + type: 'histogram', + options: { + column: 'pop_max' + } + } + } + } + } + ] + } + }; + + var template_params = {}; + + step( + function createTemplate() + { + var next = this; + assert.response( + server, + { + url: '/api/v1/map/named?api_key=1234', + method: 'POST', + headers: { + host: username, + 'Content-Type': 'application/json' + }, + data: JSON.stringify(widgetsTemplate) + }, + { + status: 200 + }, + function(res, err) { + next(err, res); + } + ); + }, + function instantiateTemplate(err, res) { + assert.ifError(err); + + assert.deepEqual(JSON.parse(res.body), { template_id: widgetsTemplateName }); + var next = this; + assert.response( + server, + { + url: '/api/v1/map/named/' + widgetsTemplateName, + method: 'POST', + headers: { + host: username, + 'Content-Type': 'application/json' + }, + data: JSON.stringify(template_params) + }, + { + status: 200 + }, + function(res) { + next(null, res); + } + ); + }, + function fetchTile(err, res) { + assert.ifError(err); + + layergroup = JSON.parse(res.body); + assert.ok(layergroup.hasOwnProperty('layergroupid'), "Missing 'layergroupid' from: " + res.body); + layergroupid = layergroup.layergroupid; + + keysToDelete['map_cfg|' + LayergroupToken.parse(layergroup.layergroupid).token] = 0; + keysToDelete['user:localhost:mapviews:global'] = 5; + + return done(); + } + ); + + }); + + afterEach(function(done) { + step( + function deleteTemplate(err) { + assert.ifError(err); + var next = this; + assert.response( + server, + { + url: '/api/v1/map/named/' + widgetsTemplateName + '?api_key=1234', + method: 'DELETE', + headers: { + host: username + } + }, + { + status: 204 + }, + function(res, err) { + next(err, res); + } + ); + }, + function deleteRedisKeys(err) { + assert.ifError(err); + helper.deleteRedisKeys(keysToDelete, done); + } + ); + }); + + function getWidget(widgetName, callback) { + assert.response( + server, + { + url: '/api/v1/map/' + layergroupid + '/0/widget/' + widgetName, + method: 'GET', + headers: { + host: username + } + }, + { + status: 200 + }, + function(res, err) { + if (err) { + return callback(err); + } + var parsedBody = JSON.parse(res.body); + return callback(err, res, parsedBody); + } + ); + } + + it('should be able to retrieve widgets from all URLs', function(done) { + var widgetsPaths = layergroup.metadata.layers.reduce(function(paths, layer) { + var widgets = layer.widgets || {}; + Object.keys(widgets).forEach(function(widget) { + paths.push(url.parse(widgets[widget].url.http).path); + }); + + return paths; + }, []); + + var widgetsQueue = queue(widgetsPaths.length); + + widgetsPaths.forEach(function(path) { + widgetsQueue.defer(function(path, done) { + assert.response( + server, + { + url: path, + method: 'GET', + headers: { + host: username + } + }, + { + status: 200 + }, + function(res, err) { + if (err) { + return done(err); + } + var parsedBody = JSON.parse(res.body); + return done(null, parsedBody); + } + ); + }, path); + }); + + widgetsQueue.awaitAll(function(err, results) { + assert.equal(results.length, 3); + done(err); + }); + }); + + + it("should retrieve aggregation", function(done) { + getWidget('country_places_count', function(err, response, aggregation) { + assert.ok(!err, err); + + assert.equal(aggregation.type, 'aggregation'); + assert.equal(aggregation.max, 769); + + return done(); + }); + }); + + it("should retrieve histogram", function(done) { + getWidget('pop_max', function(err, response, histogram) { + assert.ok(!err, err); + + assert.equal(histogram.type, 'histogram'); + assert.equal(histogram.bin_width, 743250); + + return done(); + }); + }); + +}); diff --git a/test/support/assert.js b/test/support/assert.js index 3e66265b..a53d6fbf 100644 --- a/test/support/assert.js +++ b/test/support/assert.js @@ -1,7 +1,6 @@ // Cribbed from the ever prolific Konstantin Kaefer // https://github.com/mapbox/tilelive-mapnik/blob/master/test/support/assert.js -var exec = require('child_process').exec; var fs = require('fs'); var path = require('path'); var util = require('util'); @@ -13,7 +12,7 @@ var request = require('request'); var assert = module.exports = exports = require('assert'); /** - * Takes an image data as an input and an image path and compare them using ImageMagick fuzz algorithm, if case the + * Takes an image data as an input and an image path and compare them using mapnik.Image.compare mechanism, in case the * similarity is not within the tolerance limit it will callback with an error. * * @param buffer The image data to compare from @@ -22,70 +21,39 @@ var assert = module.exports = exports = require('assert'); * @param {function} callback Will call to home with null in case there is no error, otherwise with the error itself * @see FUZZY in http://www.imagemagick.org/script/command-line-options.php#metric */ -assert.imageEqualsFile = function(buffer, referenceImageRelativeFilePath, tolerance, callback) { +assert.imageBufferIsSimilarToFile = function(buffer, referenceImageRelativeFilePath, tolerance, callback) { callback = callback || function(err) { assert.ifError(err); }; - var referenceImageFilePath = path.resolve(referenceImageRelativeFilePath), - testImageFilePath = createImageFromBuffer(buffer, 'test'); - imageFilesAreEqual(testImageFilePath, referenceImageFilePath, tolerance, function(err) { - fs.unlinkSync(testImageFilePath); + var referenceImageFilePath = path.resolve(referenceImageRelativeFilePath); + var referenceImageBuffer = fs.readFileSync(referenceImageFilePath, { encoding: null }); + + assert.imageBuffersAreSimilar(buffer, referenceImageBuffer, tolerance, callback); +}; + +assert.imageBuffersAreSimilar = function(bufferA, bufferB, tolerance, callback) { + var testImage = mapnik.Image.fromBytes(Buffer.isBuffer(bufferA) ? bufferA : new Buffer(bufferA, 'binary')); + var referenceImage = mapnik.Image.fromBytes(Buffer.isBuffer(bufferB) ? bufferB : new Buffer(bufferB, 'binary')); + + imagesAreSimilar(testImage, referenceImage, tolerance, callback); +}; + +assert.imageIsSimilarToFile = function(testImage, referenceImageRelativeFilePath, tolerance, callback) { + callback = callback || function(err) { assert.ifError(err); }; + + var referenceImageFilePath = path.resolve(referenceImageRelativeFilePath); + + var referenceImage = mapnik.Image.fromBytes(fs.readFileSync(referenceImageFilePath, { encoding: null })); + + imagesAreSimilar(testImage, referenceImage, tolerance, function(err) { + if (err) { + var testImageFilePath = randomImagePath(); + testImage.save(testImageFilePath); + } callback(err); }); }; -assert.imageBuffersAreEqual = function(bufferA, bufferB, tolerance, callback) { - var randStr = (Math.random() * 1e16).toString().substring(0, 8); - var imageFilePathA = createImageFromBuffer(bufferA, randStr + '-a'), - imageFilePathB = createImageFromBuffer(bufferB, randStr + '-b'); - - imageFilesAreEqual(imageFilePathA, imageFilePathB, tolerance, function(err, similarity) { - callback(err, [imageFilePathA, imageFilePathB], similarity); - }); -}; - -function createImageFromBuffer(buffer, nameHint) { - var imageFilePath = path.resolve('test/results/png/image-' + nameHint + '-' + Date.now() + '.png'); - var err = fs.writeFileSync(imageFilePath, buffer, 'binary'); - assert.ifError(err); - return imageFilePath; -} - -function imageFilesAreEqual(testImageFilePath, referenceImageFilePath, tolerance, callback) { - var resultFilePath = path.resolve(util.format('/tmp/windshaft-result-%s-diff.png', Date.now())); - var imageMagickCmd = util.format( - 'compare -metric fuzz "%s" "%s" "%s"', - testImageFilePath, referenceImageFilePath, resultFilePath - ); - - exec(imageMagickCmd, function(err, stdout, stderr) { - if (err) { - fs.unlinkSync(testImageFilePath); - callback(err); - } else { - stderr = stderr.trim(); - var metrics = stderr.match(/([0-9]*) \((.*)\)/); - if ( ! metrics ) { - callback(new Error("No match for " + stderr)); - return; - } - var similarity = parseFloat(metrics[2]), - tolerancePerMil = (tolerance / 1000); - if (similarity > tolerancePerMil) { - err = new Error(util.format( - 'Images %s and %s are not equal (got %d similarity, expected %d). Result %s', - testImageFilePath, referenceImageFilePath, similarity, tolerancePerMil, resultFilePath) - ); - err.similarity = similarity; - callback(err, similarity); - } else { - fs.unlinkSync(resultFilePath); - callback(null, similarity); - } - } - }); -} - -assert.imagesAreSimilar = function(testImage, referenceImage, tolerance, callback) { +function imagesAreSimilar(testImage, referenceImage, tolerance, callback) { if (testImage.width() !== referenceImage.width() || testImage.height() !== referenceImage.height()) { return callback(new Error('Images are not the same size')); } @@ -103,27 +71,10 @@ assert.imagesAreSimilar = function(testImage, referenceImage, tolerance, callbac } else { callback(null, similarity); } -}; +} -assert.imageIsSimilarToFile = function(testImage, referenceImageRelativeFilePath, tolerance, callback) { - callback = callback || function(err) { assert.ifError(err); }; - - var referenceImageFilePath = path.resolve(referenceImageRelativeFilePath); - - var referenceImage = mapnik.Image.fromBytes(fs.readFileSync(referenceImageFilePath, { encoding: null })); - - assert.imagesAreSimilar(testImage, referenceImage, tolerance, function(err) { - if (err) { - var testImageFilePath = randomImagePath(); - testImage.save(testImageFilePath); - } - callback(err); - }); -}; - -function randomImagePath(nameHint) { - nameHint = nameHint || 'test'; - return path.resolve('test/results/png/image-' + nameHint + '-' + Date.now() + '.png'); +function randomImagePath() { + return path.resolve('test/results/png/image-test-' + Date.now() + '.png'); } // jshint maxcomplexity:9 diff --git a/test/support/sql/ported/populated_places_simple_reduced.sql b/test/support/sql/ported/populated_places_simple_reduced.sql index 34e223be..b6c749f4 100644 --- a/test/support/sql/ported/populated_places_simple_reduced.sql +++ b/test/support/sql/ported/populated_places_simple_reduced.sql @@ -7385,3 +7385,8 @@ GRANT ALL ON TABLE populated_places_simple_reduced TO :TESTUSER; GRANT SELECT ON TABLE populated_places_simple_reduced TO :PUBLICUSER; VACUUM ANALYZE populated_places_simple_reduced; + +create table populated_places_simple_reduced_private AS +select * from populated_places_simple_reduced; + +GRANT ALL ON TABLE populated_places_simple_reduced_private TO :TESTUSER; diff --git a/test/support/test_helper.js b/test/support/test_helper.js index de0f7822..de9a6e3c 100644 --- a/test/support/test_helper.js +++ b/test/support/test_helper.js @@ -74,6 +74,14 @@ function checkSurrogateKey(res, expectedKey) { assert.deepEqual(keys, expectedKeys); } +var redisClient; + +beforeEach(function() { + if (!redisClient) { + redisClient = redis.createClient(global.environment.redis.port); + } +}); + //global afterEach to capture test suites that leave keys in redis afterEach(function(done) { @@ -110,7 +118,6 @@ afterEach(function(done) { } Object.keys(databasesTasks).forEach(function(db) { - var redisClient = redis.createClient(global.environment.redis.port); redisClient.select(db, function() { // Check that we start with an empty redis db redisClient.keys("*", function(err, keys) { @@ -137,6 +144,7 @@ function deleteRedisKeys(keysToDelete, callback) { var redisClient = redis.createClient(global.environment.redis.port); redisClient.select(keysToDelete[k], function() { redisClient.del(k, function(err, deletedKeysCount) { + redisClient.quit(); assert.notStrictEqual(deletedKeysCount, 0, 'No KEYS deleted for: [db=' + keysToDelete[k] + ']' + k); taskDone(k); });