[CI] test with 6.10 and 7.10, mongoDB 3.2 and 3.4 (#3787)
* Node modernization on CI * Makes sure tests dont yeild unhandled promise rejections * Adds small delay to startDB * Adds mongodb service * testing default * stupid * testing with silent nugget * proper versions * Single release step
This commit is contained in:
22
.travis.yml
22
.travis.yml
@@ -1,9 +1,10 @@
|
||||
language: node_js
|
||||
dist: trusty
|
||||
node_js:
|
||||
- '4.6'
|
||||
- '6.1'
|
||||
- '6.10'
|
||||
- '7.10'
|
||||
services:
|
||||
- mongodb
|
||||
- postgresql
|
||||
- redis-server
|
||||
- docker
|
||||
@@ -27,8 +28,8 @@ env:
|
||||
global:
|
||||
- COVERAGE_OPTION='./node_modules/.bin/nyc'
|
||||
matrix:
|
||||
- MONGODB_VERSION=3.0.8
|
||||
- MONGODB_VERSION=3.2.6
|
||||
- MONGODB_VERSION=3.2.13
|
||||
- MONGODB_VERSION=3.4.4
|
||||
- PARSE_SERVER_TEST_DB=postgres
|
||||
- PARSE_SERVER_TEST_CACHE=redis
|
||||
before_script:
|
||||
@@ -36,6 +37,7 @@ before_script:
|
||||
- psql -c 'create database parse_server_postgres_adapter_test_database;' -U postgres
|
||||
- psql -c 'CREATE EXTENSION postgis;' -U postgres -d parse_server_postgres_adapter_test_database
|
||||
- psql -c 'CREATE EXTENSION postgis_topology;' -U postgres -d parse_server_postgres_adapter_test_database
|
||||
- silent=1 mongodb-runner --start
|
||||
after_script:
|
||||
- bash <(curl -s https://codecov.io/bash)
|
||||
|
||||
@@ -43,8 +45,8 @@ jobs:
|
||||
include:
|
||||
# release on github latest branch
|
||||
- stage: release
|
||||
node_js: '6.1'
|
||||
env: RELEASE=github-latest
|
||||
node_js: '6.10'
|
||||
env:
|
||||
before_script: skip
|
||||
after_script: skip
|
||||
script: skip
|
||||
@@ -54,14 +56,6 @@ jobs:
|
||||
script: ./resources/npm-git.sh
|
||||
on:
|
||||
branch: master
|
||||
# release on npm
|
||||
- stage: release
|
||||
before_script: skip
|
||||
after_script: skip
|
||||
script: skip
|
||||
node_js: '6.1'
|
||||
env: RELEASE=npm
|
||||
deploy:
|
||||
- provider: npm
|
||||
skip_cleanup: true
|
||||
email:
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
// hungry/js/test/parse_acl_test.js
|
||||
var rest = require('../src/rest');
|
||||
var Config = require('../src/Config');
|
||||
var config = new Config('test');
|
||||
var auth = require('../src/Auth');
|
||||
|
||||
describe('Parse.ACL', () => {
|
||||
@@ -1235,6 +1234,7 @@ describe('Parse.ACL', () => {
|
||||
});
|
||||
|
||||
it('regression test #701', done => {
|
||||
const config = new Config('test');
|
||||
var anonUser = {
|
||||
authData: {
|
||||
anonymous: {
|
||||
@@ -1248,6 +1248,7 @@ describe('Parse.ACL', () => {
|
||||
var user = req.object;
|
||||
var acl = new Parse.ACL(user);
|
||||
user.setACL(acl);
|
||||
console.log('IN AFTER SAVE!');
|
||||
user.save(null, {useMasterKey: true}).then(user => {
|
||||
new Parse.Query('_User').get(user.objectId).then(() => {
|
||||
fail('should not have fetched user without public read enabled');
|
||||
@@ -1256,7 +1257,7 @@ describe('Parse.ACL', () => {
|
||||
expect(error.code).toEqual(Parse.Error.OBJECT_NOT_FOUND);
|
||||
done();
|
||||
});
|
||||
});
|
||||
}, done.fail);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ if (process.env.PARSE_SERVER_TEST_DB === 'postgres') {
|
||||
startDB = require('mongodb-runner/mocha/before').bind({
|
||||
timeout: () => {},
|
||||
slow: () => {}
|
||||
});
|
||||
})
|
||||
stopDB = require('mongodb-runner/mocha/after');
|
||||
databaseAdapter = new MongoStorageAdapter({
|
||||
uri: mongoURI,
|
||||
@@ -118,44 +118,40 @@ if (process.env.PARSE_SERVER_TEST_CACHE === 'redis') {
|
||||
const openConnections = {};
|
||||
|
||||
// Set up a default API server for testing with default configuration.
|
||||
var app = express();
|
||||
var api = new ParseServer(defaultConfiguration);
|
||||
app.use('/1', api);
|
||||
app.use('/1', () => {
|
||||
fail('should not call next');
|
||||
});
|
||||
var server = app.listen(port);
|
||||
server.on('connection', connection => {
|
||||
const key = `${connection.remoteAddress}:${connection.remotePort}`;
|
||||
openConnections[key] = connection;
|
||||
connection.on('close', () => { delete openConnections[key] });
|
||||
});
|
||||
var app;
|
||||
var api;
|
||||
var server;
|
||||
|
||||
// Allows testing specific configurations of Parse Server
|
||||
const reconfigureServer = changedConfiguration => {
|
||||
return new Promise((resolve, reject) => {
|
||||
server.close(() => {
|
||||
try {
|
||||
const newConfiguration = Object.assign({}, defaultConfiguration, changedConfiguration, {
|
||||
__indexBuildCompletionCallbackForTests: indexBuildPromise => indexBuildPromise.then(resolve, reject)
|
||||
});
|
||||
cache.clear();
|
||||
app = express();
|
||||
api = new ParseServer(newConfiguration);
|
||||
api.use(require('./testing-routes').router);
|
||||
app.use('/1', api);
|
||||
app.use('/1', () => {
|
||||
fail('should not call next');
|
||||
});
|
||||
server = app.listen(port);
|
||||
server.on('connection', connection => {
|
||||
const key = `${connection.remoteAddress}:${connection.remotePort}`;
|
||||
openConnections[key] = connection;
|
||||
connection.on('close', () => { delete openConnections[key] });
|
||||
});
|
||||
} catch(error) {
|
||||
reject(error);
|
||||
}
|
||||
});
|
||||
if (server) {
|
||||
return server.close(() => {
|
||||
server = undefined;
|
||||
reconfigureServer(changedConfiguration).then(resolve, reject);
|
||||
});
|
||||
}
|
||||
try {
|
||||
const newConfiguration = Object.assign({}, defaultConfiguration, changedConfiguration, {
|
||||
__indexBuildCompletionCallbackForTests: indexBuildPromise => indexBuildPromise.then(resolve, reject)
|
||||
});
|
||||
cache.clear();
|
||||
app = express();
|
||||
api = new ParseServer(newConfiguration);
|
||||
api.use(require('./testing-routes').router);
|
||||
app.use('/1', api);
|
||||
app.use('/1', () => {
|
||||
fail('should not call next');
|
||||
});
|
||||
server = app.listen(port);
|
||||
server.on('connection', connection => {
|
||||
const key = `${connection.remoteAddress}:${connection.remotePort}`;
|
||||
openConnections[key] = connection;
|
||||
connection.on('close', () => { delete openConnections[key] });
|
||||
});
|
||||
} catch(error) {
|
||||
reject(error);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -6,13 +6,14 @@ var Parse = require('parse/node').Parse;
|
||||
var rest = require('../src/rest');
|
||||
var request = require('request');
|
||||
|
||||
var config = new Config('test');
|
||||
const database = config.database;
|
||||
let config;
|
||||
let database;
|
||||
|
||||
describe('rest create', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
config = new Config('test');
|
||||
database = config.database;
|
||||
});
|
||||
|
||||
it('handles _id', done => {
|
||||
|
||||
@@ -5,7 +5,7 @@ var request = require('request');
|
||||
var dd = require('deep-diff');
|
||||
var Config = require('../src/Config');
|
||||
|
||||
var config = new Config('test');
|
||||
var config;
|
||||
|
||||
var hasAllPODobject = () => {
|
||||
var obj = new Parse.Object('HasAllPOD');
|
||||
@@ -131,8 +131,11 @@ var masterKeyHeaders = {
|
||||
};
|
||||
|
||||
describe('schemas', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
config = new Config('test');
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
config.database.schemaCache.clear();
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user