Disable tests that don't work in Postgres, and don't start a mongo for postgres tests (#2481)
* Disable tests that don't work in Postgres, and don't start a mongo for postgres tests * Remove unnecessary chages * remove more unnecessary chagnes
This commit is contained in:
@@ -42,7 +42,7 @@
|
|||||||
"redis": "2.6.2",
|
"redis": "2.6.2",
|
||||||
"request": "2.74.0",
|
"request": "2.74.0",
|
||||||
"request-promise": "4.1.0",
|
"request-promise": "4.1.0",
|
||||||
"semver": "^5.2.0",
|
"semver": "5.2.0",
|
||||||
"tv4": "1.2.7",
|
"tv4": "1.2.7",
|
||||||
"winston": "2.2.0",
|
"winston": "2.2.0",
|
||||||
"winston-daily-rotate-file": "1.2.0",
|
"winston-daily-rotate-file": "1.2.0",
|
||||||
@@ -68,7 +68,7 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "npm run build && node bin/dev",
|
"dev": "npm run build && node bin/dev",
|
||||||
"build": "babel src/ -d lib/",
|
"build": "babel src/ -d lib/",
|
||||||
"pretest": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=3.2.6} MONGODB_STORAGE_ENGINE=mmapv1 mongodb-runner start",
|
"pretest": "test -z \"$PARSE_SERVER_TEST_DB\" && cross-env MONGODB_VERSION=${MONGODB_VERSION:=3.2.6} MONGODB_STORAGE_ENGINE=mmapv1 mongodb-runner start || echo",
|
||||||
"test": "cross-env NODE_ENV=test TESTING=1 babel-node $COVERAGE_OPTION ./node_modules/jasmine/bin/jasmine.js",
|
"test": "cross-env NODE_ENV=test TESTING=1 babel-node $COVERAGE_OPTION ./node_modules/jasmine/bin/jasmine.js",
|
||||||
"test:win": "npm run pretest && cross-env NODE_ENV=test TESTING=1 babel-node ./node_modules/jasmine/bin/jasmine.js && npm run posttest",
|
"test:win": "npm run pretest && cross-env NODE_ENV=test TESTING=1 babel-node ./node_modules/jasmine/bin/jasmine.js && npm run posttest",
|
||||||
"posttest": "mongodb-runner stop",
|
"posttest": "mongodb-runner stop",
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ const databaseURI = 'mongodb://localhost:27017/parseServerMongoAdapterTestDataba
|
|||||||
|
|
||||||
// These tests are specific to the mongo storage adapter + mongo storage format
|
// These tests are specific to the mongo storage adapter + mongo storage format
|
||||||
// and will eventually be moved into their own repo
|
// and will eventually be moved into their own repo
|
||||||
describe('MongoStorageAdapter', () => {
|
describe_only_db('mongo')('MongoStorageAdapter', () => {
|
||||||
beforeEach(done => {
|
beforeEach(done => {
|
||||||
new MongoStorageAdapter({ uri: databaseURI })
|
new MongoStorageAdapter({ uri: databaseURI })
|
||||||
.deleteAllClasses()
|
.deleteAllClasses()
|
||||||
|
|||||||
@@ -1093,7 +1093,7 @@ describe('Parse.ACL', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it("acl saveAll with permissions", (done) => {
|
it_exclude_dbs(['postgres'])("acl saveAll with permissions", (done) => {
|
||||||
Parse.User.signUp("alice", "wonderland", null, {
|
Parse.User.signUp("alice", "wonderland", null, {
|
||||||
success: function(alice) {
|
success: function(alice) {
|
||||||
var acl = new Parse.ACL(alice);
|
var acl = new Parse.ACL(alice);
|
||||||
|
|||||||
@@ -348,7 +348,7 @@ describe('miscellaneous', function() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('test rest_create_app', function(done) {
|
it_exclude_dbs(['postgres'])('test rest_create_app', function(done) {
|
||||||
var appId;
|
var appId;
|
||||||
Parse._request('POST', 'rest_create_app').then((res) => {
|
Parse._request('POST', 'rest_create_app').then((res) => {
|
||||||
expect(typeof res.application_id).toEqual('string');
|
expect(typeof res.application_id).toEqual('string');
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ for (var i = 0; i < str.length; i++) {
|
|||||||
|
|
||||||
describe('Parse.File testing', () => {
|
describe('Parse.File testing', () => {
|
||||||
describe('creating files', () => {
|
describe('creating files', () => {
|
||||||
it('works with Content-Type', done => {
|
it_exclude_dbs(['postgres'])('works with Content-Type', done => {
|
||||||
var headers = {
|
var headers = {
|
||||||
'Content-Type': 'application/octet-stream',
|
'Content-Type': 'application/octet-stream',
|
||||||
'X-Parse-Application-Id': 'test',
|
'X-Parse-Application-Id': 'test',
|
||||||
@@ -37,7 +37,7 @@ describe('Parse.File testing', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
it('works with _ContentType', done => {
|
it_exclude_dbs(['postgres'])('works with _ContentType', done => {
|
||||||
|
|
||||||
request.post({
|
request.post({
|
||||||
url: 'http://localhost:8378/1/files/file',
|
url: 'http://localhost:8378/1/files/file',
|
||||||
@@ -61,7 +61,7 @@ describe('Parse.File testing', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('works without Content-Type', done => {
|
it_exclude_dbs(['postgres'])('works without Content-Type', done => {
|
||||||
var headers = {
|
var headers = {
|
||||||
'X-Parse-Application-Id': 'test',
|
'X-Parse-Application-Id': 'test',
|
||||||
'X-Parse-REST-API-Key': 'rest'
|
'X-Parse-REST-API-Key': 'rest'
|
||||||
@@ -84,7 +84,7 @@ describe('Parse.File testing', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('supports REST end-to-end file create, read, delete, read', done => {
|
it_exclude_dbs(['postgres'])('supports REST end-to-end file create, read, delete, read', done => {
|
||||||
var headers = {
|
var headers = {
|
||||||
'Content-Type': 'image/jpeg',
|
'Content-Type': 'image/jpeg',
|
||||||
'X-Parse-Application-Id': 'test',
|
'X-Parse-Application-Id': 'test',
|
||||||
@@ -128,7 +128,7 @@ describe('Parse.File testing', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('blocks file deletions with missing or incorrect master-key header', done => {
|
it_exclude_dbs(['postgres'])('blocks file deletions with missing or incorrect master-key header', done => {
|
||||||
var headers = {
|
var headers = {
|
||||||
'Content-Type': 'image/jpeg',
|
'Content-Type': 'image/jpeg',
|
||||||
'X-Parse-Application-Id': 'test',
|
'X-Parse-Application-Id': 'test',
|
||||||
@@ -173,7 +173,7 @@ describe('Parse.File testing', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('handles other filetypes', done => {
|
it_exclude_dbs(['postgres'])('handles other filetypes', done => {
|
||||||
var headers = {
|
var headers = {
|
||||||
'Content-Type': 'image/jpeg',
|
'Content-Type': 'image/jpeg',
|
||||||
'X-Parse-Application-Id': 'test',
|
'X-Parse-Application-Id': 'test',
|
||||||
@@ -196,7 +196,7 @@ describe('Parse.File testing', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it("save file", done => {
|
it_exclude_dbs(['postgres'])("save file", done => {
|
||||||
var file = new Parse.File("hello.txt", data, "text/plain");
|
var file = new Parse.File("hello.txt", data, "text/plain");
|
||||||
ok(!file.url());
|
ok(!file.url());
|
||||||
file.save(expectSuccess({
|
file.save(expectSuccess({
|
||||||
@@ -316,7 +316,7 @@ describe('Parse.File testing', () => {
|
|||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
|
|
||||||
it("saving an already saved file", done => {
|
it_exclude_dbs(['postgres'])("saving an already saved file", done => {
|
||||||
var file = new Parse.File("hello.txt", data, "text/plain");
|
var file = new Parse.File("hello.txt", data, "text/plain");
|
||||||
ok(!file.url());
|
ok(!file.url());
|
||||||
file.save(expectSuccess({
|
file.save(expectSuccess({
|
||||||
@@ -337,7 +337,7 @@ describe('Parse.File testing', () => {
|
|||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
|
|
||||||
it("two saves at the same time", done => {
|
it_exclude_dbs(['postgres'])("two saves at the same time", done => {
|
||||||
var file = new Parse.File("hello.txt", data, "text/plain");
|
var file = new Parse.File("hello.txt", data, "text/plain");
|
||||||
|
|
||||||
var firstName;
|
var firstName;
|
||||||
@@ -369,7 +369,7 @@ describe('Parse.File testing', () => {
|
|||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
|
|
||||||
it("content-type used with no extension", done => {
|
it_exclude_dbs(['postgres'])("content-type used with no extension", done => {
|
||||||
var headers = {
|
var headers = {
|
||||||
'Content-Type': 'text/html',
|
'Content-Type': 'text/html',
|
||||||
'X-Parse-Application-Id': 'test',
|
'X-Parse-Application-Id': 'test',
|
||||||
@@ -390,7 +390,7 @@ describe('Parse.File testing', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it("filename is url encoded", done => {
|
it_exclude_dbs(['postgres'])("filename is url encoded", done => {
|
||||||
var headers = {
|
var headers = {
|
||||||
'Content-Type': 'text/html',
|
'Content-Type': 'text/html',
|
||||||
'X-Parse-Application-Id': 'test',
|
'X-Parse-Application-Id': 'test',
|
||||||
|
|||||||
@@ -1698,7 +1698,7 @@ describe('Parse.User testing', () => {
|
|||||||
bob.setPassword('meower');
|
bob.setPassword('meower');
|
||||||
return bob.save();
|
return bob.save();
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
return Parse.User.logIn('bob', 'meower');
|
return Parse.User.logIn('bob', 'meower');
|
||||||
}).then((bob) => {
|
}).then((bob) => {
|
||||||
expect(bob.getUsername()).toEqual('bob');
|
expect(bob.getUsername()).toEqual('bob');
|
||||||
done();
|
done();
|
||||||
|
|||||||
@@ -342,6 +342,16 @@ global.fit_exclude_dbs = excluded => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
global.describe_only_db = db => {
|
||||||
|
if (process.env.PARSE_SERVER_TEST_DB == db) {
|
||||||
|
return describe;
|
||||||
|
} else if (!process.env.PARSE_SERVER_TEST_DB && db == 'mongo') {
|
||||||
|
return describe;
|
||||||
|
} else {
|
||||||
|
return () => {};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// LiveQuery test setting
|
// LiveQuery test setting
|
||||||
require('../src/LiveQuery/PLog').logLevel = 'NONE';
|
require('../src/LiveQuery/PLog').logLevel = 'NONE';
|
||||||
var libraryCache = {};
|
var libraryCache = {};
|
||||||
|
|||||||
Reference in New Issue
Block a user