MVT PostGIS limit test fixed

This commit is contained in:
David M 2017-10-09 14:46:01 +02:00
parent 10f9f61e1e
commit 28501f6b9d

View File

@ -2,6 +2,7 @@ require('../support/test_helper');
const assert = require('../support/assert');
const TestClient = require('../support/test-client');
var serverOptions = require('../../lib/cartodb/server_options');
const timeoutErrorTilePath = `${process.cwd()}/assets/render-timeout-fallback.png`;
@ -200,15 +201,21 @@ describe('user render timeout limit', function () {
});
});
describe('vector', function () {
describe('vector (PostGIS)', vector(true));
describe('vector (mapnik)', vector(false));
function vector(usePostGIS) {
const originalUsePostGIS = serverOptions.renderer.mvt.usePostGIS;
return function () {
beforeEach(function (done) {
serverOptions.renderer.mvt.usePostGIS = usePostGIS;
const mapconfig = createMapConfig();
this.testClient = new TestClient(mapconfig, 1234);
this.testClient.setUserRenderTimeoutLimit('localhost', 50, done);
this.testClient.setUserDatabaseTimeoutLimit(50, done);
});
afterEach(function (done) {
this.testClient.setUserRenderTimeoutLimit('localhost', 0, (err) => {
serverOptions.renderer.mvt.usePostGIS = originalUsePostGIS;
this.testClient.setUserDatabaseTimeoutLimit(0, (err) => {
if (err) {
return done(err);
}
@ -234,7 +241,7 @@ describe('user render timeout limit', function () {
errors: ['You are over platform\'s limits. Please contact us to know more details'],
errors_with_context: [{
type: 'limit',
subtype: 'render',
subtype: 'datasource',
message: 'You are over platform\'s limits. Please contact us to know more details'
}]
});
@ -242,7 +249,8 @@ describe('user render timeout limit', function () {
done();
});
});
});
};
}
describe('interativity', function () {
beforeEach(function (done) {