Postgres exclude failing tests (#2081)

* reload the right data

More passing postgres tests

Handle schema updates, and $in for non array columns

remove authdata from user and implement ensureUniqueness

Make some tests work, detect existing classes

Throw proper error for unique index violation

fix findOneAndUpdate

Support more types

support more type

Support boolean, fix _rperm/_wperm, add TODO

Support string types and also simplify tests

Move operator flattening into Parse Server and out of mongo adapters

Move authdata transform for create into Parse Server

Move authdata transforms completely in to Parse Server

Fix test setup

inline addSchema

Inject default schema to response from DB adapter

* Mark tests that don't work in Postgres

* Exclude one more test

* Exclude some more failing tests

* Exclude more tests
This commit is contained in:
Drew
2016-06-17 09:59:16 -07:00
committed by Florent Vilmart
parent 7da4debbe0
commit ab06055369
47 changed files with 817 additions and 801 deletions

View File

@@ -9,7 +9,7 @@ var express = require('express');
const MongoStorageAdapter = require('../src/Adapters/Storage/Mongo/MongoStorageAdapter');
describe('server', () => {
it('requires a master key and app id', done => {
it_exclude_dbs(['postgres'])('requires a master key and app id', done => {
reconfigureServer({ appId: undefined })
.catch(error => {
expect(error).toEqual('You must provide an appId!');
@@ -25,7 +25,7 @@ describe('server', () => {
});
});
it('support http basic authentication with masterkey', done => {
it_exclude_dbs(['postgres'])('support http basic authentication with masterkey', done => {
request.get({
url: 'http://localhost:8378/1/classes/TestObject',
headers: {
@@ -37,7 +37,7 @@ describe('server', () => {
});
});
it('support http basic authentication with javascriptKey', done => {
it_exclude_dbs(['postgres'])('support http basic authentication with javascriptKey', done => {
request.get({
url: 'http://localhost:8378/1/classes/TestObject',
headers: {
@@ -49,7 +49,7 @@ describe('server', () => {
});
});
it('fails if database is unreachable', done => {
it_exclude_dbs(['postgres'])('fails if database is unreachable', done => {
reconfigureServer({ databaseAdapter: new MongoStorageAdapter({ uri: 'mongodb://fake:fake@localhost:43605/drew3' }) })
.catch(() => {
//Need to use rest api because saving via JS SDK results in fail() not getting called
@@ -70,7 +70,7 @@ describe('server', () => {
});
});
it('can load email adapter via object', done => {
it_exclude_dbs(['postgres'])('can load email adapter via object', done => {
reconfigureServer({
appName: 'unused',
verifyUserEmails: true,
@@ -83,7 +83,7 @@ describe('server', () => {
}).then(done, fail);
});
it('can load email adapter via class', done => {
it_exclude_dbs(['postgres'])('can load email adapter via class', done => {
reconfigureServer({
appName: 'unused',
verifyUserEmails: true,
@@ -99,7 +99,7 @@ describe('server', () => {
}).then(done, fail);
});
it('can load email adapter via module name', done => {
it_exclude_dbs(['postgres'])('can load email adapter via module name', done => {
reconfigureServer({
appName: 'unused',
verifyUserEmails: true,
@@ -115,7 +115,7 @@ describe('server', () => {
}).then(done, fail);
});
it('can load email adapter via only module name', done => {
it_exclude_dbs(['postgres'])('can load email adapter via only module name', done => {
reconfigureServer({
appName: 'unused',
verifyUserEmails: true,
@@ -128,7 +128,7 @@ describe('server', () => {
});
});
it('throws if you initialize email adapter incorrecly', done => {
it_exclude_dbs(['postgres'])('throws if you initialize email adapter incorrecly', done => {
reconfigureServer({
appName: 'unused',
verifyUserEmails: true,
@@ -146,7 +146,7 @@ describe('server', () => {
});
});
it('can report the server version', done => {
it_exclude_dbs(['postgres'])('can report the server version', done => {
request.get({
url: 'http://localhost:8378/1/serverInfo',
headers: {
@@ -160,7 +160,7 @@ describe('server', () => {
})
});
it('can create a parse-server v1', done => {
it_exclude_dbs(['postgres'])('can create a parse-server v1', done => {
var parseServer = new ParseServer.default(Object.assign({},
defaultConfiguration, {
appId: "aTestApp",
@@ -191,7 +191,7 @@ describe('server', () => {
);
});
it('can create a parse-server v2', done => {
it_exclude_dbs(['postgres'])('can create a parse-server v2', done => {
let objId;
let server
let parseServer = ParseServer.ParseServer(Object.assign({},
@@ -227,7 +227,7 @@ describe('server', () => {
));
});
it('has createLiveQueryServer', done => {
it_exclude_dbs(['postgres'])('has createLiveQueryServer', done => {
// original implementation through the factory
expect(typeof ParseServer.ParseServer.createLiveQueryServer).toEqual('function');
// For import calls
@@ -235,14 +235,14 @@ describe('server', () => {
done();
});
it('core adapters are not exposed anymore', done => {
it_exclude_dbs(['postgres'])('core adapters are not exposed anymore', done => {
expect(ParseServer.S3Adapter).toThrow();
expect(ParseServer.GCSAdapter).toThrow('GCSAdapter is not provided by parse-server anymore; please install parse-server-gcs-adapter');
expect(ParseServer.FileSystemAdapter).toThrow();
done();
});
it('properly gives publicServerURL when set', done => {
it_exclude_dbs(['postgres'])('properly gives publicServerURL when set', done => {
reconfigureServer({ publicServerURL: 'https://myserver.com/1' })
.then(() => {
var config = new Config('test', 'http://localhost:8378/1');
@@ -251,7 +251,7 @@ describe('server', () => {
});
});
it('properly removes trailing slash in mount', done => {
it_exclude_dbs(['postgres'])('properly removes trailing slash in mount', done => {
reconfigureServer({})
.then(() => {
var config = new Config('test', 'http://localhost:8378/1/');
@@ -260,7 +260,7 @@ describe('server', () => {
});
});
it('should throw when getting invalid mount', done => {
it_exclude_dbs(['postgres'])('should throw when getting invalid mount', done => {
reconfigureServer({ publicServerURL: 'blabla:/some' })
.catch(error => {
expect(error).toEqual('publicServerURL should be a valid HTTPS URL starting with https://')
@@ -268,7 +268,7 @@ describe('server', () => {
})
});
it('fails if the session length is not a number', done => {
it_exclude_dbs(['postgres'])('fails if the session length is not a number', done => {
reconfigureServer({ sessionLength: 'test' })
.catch(error => {
expect(error).toEqual('Session length must be a valid number.');
@@ -276,7 +276,7 @@ describe('server', () => {
});
});
it('fails if the session length is less than or equal to 0', done => {
it_exclude_dbs(['postgres'])('fails if the session length is less than or equal to 0', done => {
reconfigureServer({ sessionLength: '-33' })
.catch(error => {
expect(error).toEqual('Session length must be a value greater than 0.');
@@ -288,7 +288,7 @@ describe('server', () => {
});
});
it('ignores the session length when expireInactiveSessions set to false', (done) => {
it_exclude_dbs(['postgres'])('ignores the session length when expireInactiveSessions set to false', (done) => {
reconfigureServer({
sessionLength: '-33',
expireInactiveSessions: false
@@ -300,7 +300,7 @@ describe('server', () => {
.then(done);
})
it('fails if you try to set revokeSessionOnPasswordReset to non-boolean', done => {
it_exclude_dbs(['postgres'])('fails if you try to set revokeSessionOnPasswordReset to non-boolean', done => {
reconfigureServer({ revokeSessionOnPasswordReset: 'non-bool' })
.catch(done);
});