Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Postgres exclude failing tests #2081

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ env:
- MONGODB_VERSION=3.2.6
matrix:
fast_finish: true,
allow_failures:
- env: PARSE_SERVER_TEST_DB=postgres
branches:
only:
- master
Expand Down
1 change: 0 additions & 1 deletion spec/AdaptableController.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ MockController.prototype = Object.create(AdaptableController.prototype);
MockController.prototype.constructor = AdaptableController;

describe("AdaptableController", ()=>{

it("should use the provided adapter", (done) => {
var adapter = new FilesAdapter();
var controller = new FilesController(adapter);
Expand Down
1 change: 0 additions & 1 deletion spec/CLI.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ var definitions = {
}

describe("commander additions", () => {

afterEach((done) => {
commander.options = [];
delete commander.arg0;
Expand Down
1 change: 0 additions & 1 deletion spec/Client.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ var Client = require('../src/LiveQuery/Client').Client;
var ParseWebSocket = require('../src/LiveQuery/ParseWebSocketServer').ParseWebSocket;

describe('Client', function() {

it('can be initialized', function() {
var parseWebSocket = new ParseWebSocket({});
var client = new Client(1, parseWebSocket);
Expand Down
1 change: 0 additions & 1 deletion spec/CloudCodeLogger.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ var LoggerController = require('../src/Controllers/LoggerController').LoggerCont
var FileLoggerAdapter = require('../src/Adapters/Logger/FileLoggerAdapter').FileLoggerAdapter;

describe("Cloud Code Logger", () => {

it("should expose log to functions", (done) => {
var logController = new LoggerController(new FileLoggerAdapter());

Expand Down
1 change: 0 additions & 1 deletion spec/EventEmitterPubSub.spec.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
var EventEmitterPubSub = require('../src/LiveQuery/EventEmitterPubSub').EventEmitterPubSub;

describe('EventEmitterPubSub', function() {

it('can publish and subscribe', function() {
var publisher = EventEmitterPubSub.createPublisher();
var subscriber = EventEmitterPubSub.createSubscriber();
Expand Down
3 changes: 0 additions & 3 deletions spec/FileLoggerAdapter.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ var Parse = require('parse/node').Parse;
var request = require('request');

describe('info logs', () => {

it("Verify INFO logs", (done) => {
var fileLoggerAdapter = new FileLoggerAdapter();
fileLoggerAdapter.info('testing info logs', () => {
Expand All @@ -27,7 +26,6 @@ describe('info logs', () => {
});

describe('error logs', () => {

it("Verify ERROR logs", (done) => {
var fileLoggerAdapter = new FileLoggerAdapter();
fileLoggerAdapter.error('testing error logs', () => {
Expand All @@ -50,7 +48,6 @@ describe('error logs', () => {
});

describe('verbose logs', () => {

it("mask sensitive information in _User class", (done) => {
reconfigureServer({ verbose: true })
.then(() => createTestUser())
Expand Down
37 changes: 18 additions & 19 deletions spec/HTTPRequest.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ app.listen(13371);


describe("httpRequest", () => {

it("should do /hello", (done) => {
httpRequest({
url: httpRequestServer+"/hello"
Expand All @@ -51,7 +50,7 @@ describe("httpRequest", () => {
done();
})
});

it("should do /hello with callback and promises", (done) => {
var calls = 0;
httpRequest({
Expand All @@ -70,7 +69,7 @@ describe("httpRequest", () => {
done();
})
});

it("should do not follow redirects by default", (done) => {

httpRequest({
Expand All @@ -83,7 +82,7 @@ describe("httpRequest", () => {
done();
})
});

it("should follow redirects when set", (done) => {

httpRequest({
Expand All @@ -100,17 +99,17 @@ describe("httpRequest", () => {
done();
})
});

it("should fail on 404", (done) => {
var calls = 0;
httpRequest({
url: httpRequestServer+"/404",
success: function() {
success: function() {
calls++;
fail("should not succeed");
done();
},
error: function(httpResponse) {
error: function(httpResponse) {
calls++;
expect(calls).toBe(1);
expect(httpResponse.status).toBe(404);
Expand All @@ -121,7 +120,7 @@ describe("httpRequest", () => {
}
});
})

it("should fail on 404", (done) => {
httpRequest({
url: httpRequestServer+"/404",
Expand All @@ -136,7 +135,7 @@ describe("httpRequest", () => {
done();
})
})

it("should post on echo", (done) => {
var calls = 0;
httpRequest({
Expand All @@ -160,27 +159,27 @@ describe("httpRequest", () => {
done();
})
});

it("should encode a query string body by default", (done) => {
let options = {
body: {"foo": "bar"},
body: {"foo": "bar"},
}
let result = httpRequest.encodeBody(options);
expect(result.body).toEqual('foo=bar');
expect(result.headers['Content-Type']).toEqual('application/x-www-form-urlencoded');
done();

})

it("should encode a JSON body", (done) => {
let options = {
body: {"foo": "bar"},
body: {"foo": "bar"},
headers: {'Content-Type': 'application/json'}
}
let result = httpRequest.encodeBody(options);
expect(result.body).toEqual('{"foo":"bar"}');
done();

})
it("should encode a www-form body", (done) => {
let options = {
Expand All @@ -193,7 +192,7 @@ describe("httpRequest", () => {
});
it("should not encode a wrong content type", (done) => {
let options = {
body:{"foo": "bar", "bar": "baz"},
body:{"foo": "bar", "bar": "baz"},
headers: {'cOntent-tYpe': 'mime/jpeg'}
}
let result = httpRequest.encodeBody(options);
Expand All @@ -204,18 +203,18 @@ describe("httpRequest", () => {
it("should fail gracefully", (done) => {
httpRequest({
url: "http://not a good url",
success: function() {
success: function() {
fail("should not succeed");
done();
},
error: function(error) {
error: function(error) {
expect(error).not.toBeUndefined();
expect(error).not.toBeNull();
done();
}
});
});

it("should params object to query string", (done) => {
httpRequest({
url: httpRequestServer+"/qs",
Expand Down
4 changes: 2 additions & 2 deletions spec/InstallationsRouter.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ describe('InstallationsRouter', () => {
});
});

it('query installations with count = 1', (done) => {
it_exclude_dbs(['postgres'])('query installations with count = 1', (done) => {
var androidDeviceRequest = {
'installationId': '12345678-abcd-abcd-abcd-123456789abc',
'deviceType': 'android'
Expand Down Expand Up @@ -133,7 +133,7 @@ describe('InstallationsRouter', () => {
});
});

it('query installations with limit = 0 and count = 1', (done) => {
it_exclude_dbs(['postgres'])('query installations with limit = 0 and count = 1', (done) => {
var androidDeviceRequest = {
'installationId': '12345678-abcd-abcd-abcd-123456789abc',
'deviceType': 'android'
Expand Down
52 changes: 21 additions & 31 deletions spec/MongoTransform.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ let dd = require('deep-diff');
let mongodb = require('mongodb');

describe('parseObjectToMongoObjectForCreate', () => {

it('a basic number', (done) => {
var input = {five: 5};
var output = transform.parseObjectToMongoObjectForCreate(null, input, {
Expand Down Expand Up @@ -51,7 +50,7 @@ describe('parseObjectToMongoObjectForCreate', () => {

//TODO: object creation requests shouldn't be seeing __op delete, it makes no sense to
//have __op delete in a new object. Figure out what this should actually be testing.
notWorking('a delete op', (done) => {
xit('a delete op', (done) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

excluded for both?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, there were a handful of tests that were marked with notWorking from the start. xit is just notWorking but also adds some useful output when the tests are run.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all good then :)

var input = {deleteMe: {__op: 'Delete'}};
var output = transform.parseObjectToMongoObjectForCreate(null, input, { fields: {} });
jequal(output, {});
Expand All @@ -64,37 +63,33 @@ describe('parseObjectToMongoObjectForCreate', () => {
done();
});

describe('GeoPoints', () => {
it('plain', (done) => {
var geoPoint = {__type: 'GeoPoint', longitude: 180, latitude: -180};
var out = transform.parseObjectToMongoObjectForCreate(null, {location: geoPoint},{
fields: {location: {type: 'GeoPoint'}}
});
expect(out.location).toEqual([180, -180]);
done();
it('plain', (done) => {
var geoPoint = {__type: 'GeoPoint', longitude: 180, latitude: -180};
var out = transform.parseObjectToMongoObjectForCreate(null, {location: geoPoint},{
fields: {location: {type: 'GeoPoint'}}
});
expect(out.location).toEqual([180, -180]);
done();
});

it('in array', (done) => {
var geoPoint = {__type: 'GeoPoint', longitude: 180, latitude: -180};
var out = transform.parseObjectToMongoObjectForCreate(null, {locations: [geoPoint, geoPoint]},{
fields: {locations: {type: 'Array'}}
});
expect(out.locations).toEqual([geoPoint, geoPoint]);
done();
it('in array', (done) => {
var geoPoint = {__type: 'GeoPoint', longitude: 180, latitude: -180};
var out = transform.parseObjectToMongoObjectForCreate(null, {locations: [geoPoint, geoPoint]},{
fields: {locations: {type: 'Array'}}
});
expect(out.locations).toEqual([geoPoint, geoPoint]);
done();
});

it('in sub-object', (done) => {
var geoPoint = {__type: 'GeoPoint', longitude: 180, latitude: -180};
var out = transform.parseObjectToMongoObjectForCreate(null, { locations: { start: geoPoint }},{
fields: {locations: {type: 'Object'}}
});
expect(out).toEqual({ locations: { start: geoPoint } });
done();
it('in sub-object', (done) => {
var geoPoint = {__type: 'GeoPoint', longitude: 180, latitude: -180};
var out = transform.parseObjectToMongoObjectForCreate(null, { locations: { start: geoPoint }},{
fields: {locations: {type: 'Object'}}
});
expect(out).toEqual({ locations: { start: geoPoint } });
done();
});
});

describe('transformWhere', () => {
it('objectId', (done) => {
var out = transform.transformWhere(null, {objectId: 'foo'});
expect(out._id).toEqual('foo');
Expand All @@ -109,9 +104,7 @@ describe('transformWhere', () => {
jequal(input.objectId, output._id);
done();
});
});

describe('mongoObjectToParseObject', () => {
it('built-in timestamps', (done) => {
var input = {createdAt: new Date(), updatedAt: new Date()};
var output = transform.mongoObjectToParseObject(null, input, { fields: {} });
Expand Down Expand Up @@ -191,9 +184,6 @@ describe('mongoObjectToParseObject', () => {
expect(dd(output, input)).toEqual(undefined);
done();
});
});

describe('transform schema key changes', () => {

it('changes new pointer key', (done) => {
var input = {
Expand Down
41 changes: 19 additions & 22 deletions spec/OAuth.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ var Config = require("../src/Config");
var defaultColumns = require('../src/Controllers/SchemaController').defaultColumns;

describe('OAuth', function() {

it("Nonce should have right length", (done) => {
jequal(OAuth.nonce().length, 30);
done();
Expand Down Expand Up @@ -218,29 +217,27 @@ describe('OAuth', function() {
return request.post(options, callback);
}

it("should create user with REST API", (done) => {

it_exclude_dbs(['postgres'])("should create user with REST API", done => {
createOAuthUser((error, response, body) => {
expect(error).toBe(null);
var b = JSON.parse(body);
ok(b.sessionToken);
expect(b.objectId).not.toBeNull();
expect(b.objectId).not.toBeUndefined();
var sessionToken = b.sessionToken;
var q = new Parse.Query("_Session");
q.equalTo('sessionToken', sessionToken);
q.first({useMasterKey: true}).then((res) => {
expect(res.get("installationId")).toEqual('yolo');
done();
}).fail((err) => {
fail('should not fail fetching the session');
done();
})
});

expect(error).toBe(null);
var b = JSON.parse(body);
ok(b.sessionToken);
expect(b.objectId).not.toBeNull();
expect(b.objectId).not.toBeUndefined();
var sessionToken = b.sessionToken;
var q = new Parse.Query("_Session");
q.equalTo('sessionToken', sessionToken);
q.first({useMasterKey: true}).then((res) => {
expect(res.get("installationId")).toEqual('yolo');
done();
}).fail((err) => {
fail('should not fail fetching the session');
done();
})
});
});

it("should only create a single user with REST API", (done) => {
it_exclude_dbs(['postgres'])("should only create a single user with REST API", (done) => {
var objectId;
createOAuthUser((error, response, body) => {
expect(error).toBe(null);
Expand All @@ -260,7 +257,7 @@ describe('OAuth', function() {
});
});

it("unlink and link with custom provider", (done) => {
it_exclude_dbs(['postgres'])("unlink and link with custom provider", (done) => {
var provider = getMockMyOauthProvider();
Parse.User._registerAuthenticationProvider(provider);
Parse.User._logInWith("myoauth", {
Expand Down
Loading