Merge branch 'master' into remove-auth-fallback

This commit is contained in:
Eneko Lakasta
2018-06-11 12:02:58 +02:00
13 changed files with 94 additions and 67 deletions
+21
View File
@@ -261,6 +261,27 @@ describe('named-maps analysis', function() {
);
});
it('should fail to retrieve static map preview via layergroup ' +
'when filtering by invalid layers', function(done) {
assert.response(
server,
{
url: '/api/v1/map/static/center/' + layergroupid + '/4/42/-3/320/240.png?layer=1',
method: 'GET',
encoding: 'binary',
headers: {
host: username
}
},
{
status: 400
},
function(res, err) {
done(err);
}
);
});
it('should return and an error requesting unsupported image format', function(done) {
assert.response(
server,
+3 -3
View File
@@ -1268,9 +1268,6 @@ TestClient.prototype.setUserDatabaseTimeoutLimit = function (timeoutLimit, callb
const dbuser = _.template(global.environment.postgres_auth_user, { user_id: 1 });
const publicuser = global.environment.postgres.user;
// we need to guarantee all new connections have the new settings
helper.cleanPGPoolConnections();
const psql = new PSQL({
user: 'postgres',
dbname: dbname,
@@ -1278,6 +1275,9 @@ TestClient.prototype.setUserDatabaseTimeoutLimit = function (timeoutLimit, callb
port: global.environment.postgres.port
});
// we need to guarantee all new connections have the new settings
psql.end();
step(
function configureTimeouts () {
const timeoutSQLs = [
+1 -8
View File
@@ -13,7 +13,6 @@ var lzmaWorker = new LZMA();
var redis = require('redis');
var log4js = require('log4js');
var pg = require('pg');
const setICUEnvVariable = require('../../lib/cartodb/utils/icu_data_env_setter');
// set environment specific variables
@@ -147,11 +146,6 @@ afterEach(function(done) {
});
});
function cleanPGPoolConnections () {
// TODO: this method will be replaced by psql.end
pg.end();
}
function deleteRedisKeys(keysToDelete, callback) {
if (Object.keys(keysToDelete).length === 0) {
@@ -214,6 +208,5 @@ module.exports = {
checkSurrogateKey: checkSurrogateKey,
checkCache: checkCache,
rmdirRecursiveSync: rmdirRecursiveSync,
configureMetadata,
cleanPGPoolConnections
configureMetadata
};