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

@@ -17,8 +17,7 @@ app.use(bodyParser.json({ 'type': '*/*' }))
app.listen(12345);
describe('Hooks', () => {
it("should have no hooks registered", (done) => {
it_exclude_dbs(['postgres'])("should have no hooks registered", (done) => {
Parse.Hooks.getFunctions().then((res) => {
expect(res.constructor).toBe(Array.prototype.constructor);
done();
@@ -28,7 +27,7 @@ describe('Hooks', () => {
});
});
it("should have no triggers registered", (done) => {
it_exclude_dbs(['postgres'])("should have no triggers registered", (done) => {
Parse.Hooks.getTriggers().then( (res) => {
expect(res.constructor).toBe(Array.prototype.constructor);
done();
@@ -38,7 +37,7 @@ describe('Hooks', () => {
});
});
it("should CRUD a function registration", (done) => {
it_exclude_dbs(['postgres'])("should CRUD a function registration", (done) => {
// Create
Parse.Hooks.createFunction("My-Test-Function", "http://someurl")
.then(response => {
@@ -79,7 +78,7 @@ describe('Hooks', () => {
})
});
it("should CRUD a trigger registration", (done) => {
it_exclude_dbs(['postgres'])("should CRUD a trigger registration", (done) => {
// Create
Parse.Hooks.createTrigger("MyClass","beforeDelete", "http://someurl").then((res) => {
expect(res.className).toBe("MyClass");
@@ -141,7 +140,7 @@ describe('Hooks', () => {
})
});
it("should fail trying to create two times the same function", (done) => {
it_exclude_dbs(['postgres'])("should fail trying to create two times the same function", (done) => {
Parse.Hooks.createFunction("my_new_function", "http://url.com").then( () => {
return Parse.Hooks.createFunction("my_new_function", "http://url.com")
}, () => {
@@ -162,7 +161,7 @@ describe('Hooks', () => {
})
});
it("should fail trying to create two times the same trigger", (done) => {
it_exclude_dbs(['postgres'])("should fail trying to create two times the same trigger", (done) => {
Parse.Hooks.createTrigger("MyClass", "beforeSave", "http://url.com").then( () => {
return Parse.Hooks.createTrigger("MyClass", "beforeSave", "http://url.com")
}, () => {
@@ -181,7 +180,7 @@ describe('Hooks', () => {
})
});
it("should fail trying to update a function that don't exist", (done) => {
it_exclude_dbs(['postgres'])("should fail trying to update a function that don't exist", (done) => {
Parse.Hooks.updateFunction("A_COOL_FUNCTION", "http://url.com").then( () => {
fail("Should not succeed")
}, (err) => {
@@ -198,7 +197,7 @@ describe('Hooks', () => {
});
});
it("should fail trying to update a trigger that don't exist", (done) => {
it_exclude_dbs(['postgres'])("should fail trying to update a trigger that don't exist", (done) => {
Parse.Hooks.updateTrigger("AClassName","beforeSave", "http://url.com").then( () => {
fail("Should not succeed")
}, (err) => {
@@ -242,7 +241,7 @@ describe('Hooks', () => {
});
it("should create hooks and properly preload them", (done) => {
it_exclude_dbs(['postgres'])("should create hooks and properly preload them", (done) => {
var promises = [];
for (var i = 0; i<5; i++) {
@@ -277,7 +276,7 @@ describe('Hooks', () => {
})
});
it("should run the function on the test server", (done) => {
it_exclude_dbs(['postgres'])("should run the function on the test server", (done) => {
app.post("/SomeFunction", function(req, res) {
res.json({success:"OK!"});
@@ -299,7 +298,7 @@ describe('Hooks', () => {
});
});
it("should run the function on the test server", (done) => {
it_exclude_dbs(['postgres'])("should run the function on the test server", (done) => {
app.post("/SomeFunctionError", function(req, res) {
res.json({error: {code: 1337, error: "hacking that one!"}});
@@ -322,7 +321,7 @@ describe('Hooks', () => {
});
});
it("should provide X-Parse-Webhook-Key when defined", (done) => {
it_exclude_dbs(['postgres'])("should provide X-Parse-Webhook-Key when defined", (done) => {
app.post("/ExpectingKey", function(req, res) {
if (req.get('X-Parse-Webhook-Key') === 'hook') {
res.json({success: "correct key provided"});
@@ -347,7 +346,7 @@ describe('Hooks', () => {
});
});
it("should not pass X-Parse-Webhook-Key if not provided", (done) => {
it_exclude_dbs(['postgres'])("should not pass X-Parse-Webhook-Key if not provided", (done) => {
reconfigureServer({ webhookKey: undefined })
.then(() => {
app.post("/ExpectingKeyAlso", function(req, res) {
@@ -376,7 +375,7 @@ describe('Hooks', () => {
});
it("should run the beforeSave hook on the test server", (done) => {
it_exclude_dbs(['postgres'])("should run the beforeSave hook on the test server", (done) => {
var triggerCount = 0;
app.post("/BeforeSaveSome", function(req, res) {
triggerCount++;
@@ -403,7 +402,7 @@ describe('Hooks', () => {
});
});
it("beforeSave hooks should correctly handle responses containing entire object", (done) => {
it_exclude_dbs(['postgres'])("beforeSave hooks should correctly handle responses containing entire object", (done) => {
app.post("/BeforeSaveSome2", function(req, res) {
var object = Parse.Object.fromJSON(req.body.object);
object.set('hello', "world");
@@ -423,7 +422,7 @@ describe('Hooks', () => {
});
});
it("should run the afterSave hook on the test server", (done) => {
it_exclude_dbs(['postgres'])("should run the afterSave hook on the test server", (done) => {
var triggerCount = 0;
var newObjectId;
app.post("/AfterSaveSome", function(req, res) {