Skip to content

Bump node js #4384

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

Merged
merged 3 commits into from
Nov 25, 2017
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
7 changes: 3 additions & 4 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
{
"plugins": [
"transform-flow-strip-types"
"transform-flow-strip-types",
"transform-object-rest-spread"
],
"presets": [
"es2015",
"stage-3",
["env", {
"targets": {
"node": "4.6"
"node": "6.11.4"
}
}]
]
Expand Down
11 changes: 7 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ branches:
only:
- master
- /^[0-9]+.[0-9]+.[0-9]+(-.*)?$/
- 3.x
- /^greenkeeper/.*$/
cache:
directories:
Expand All @@ -24,13 +25,13 @@ stage: test
env:
global:
- COVERAGE_OPTION='./node_modules/.bin/nyc'
- NODE_VERSION=6.10
- NODE_VERSION=6.11.4
matrix:
- MONGODB_VERSION=3.2.13
- MONGODB_VERSION=3.4.4
- PARSE_SERVER_TEST_DB=postgres
- PARSE_SERVER_TEST_CACHE=redis
- NODE_VERSION=8.5
- NODE_VERSION=8.7
before_install:
- nvm install $NODE_VERSION
- nvm use $NODE_VERSION
Expand All @@ -47,7 +48,7 @@ jobs:
include:
# release on github latest branch
- stage: release
node_js: '4.6'
node_js: '6.11.4'
env:
before_script: skip
after_script: skip
Expand All @@ -57,7 +58,9 @@ jobs:
skip_cleanup: true
script: ./resources/npm-git.sh
on:
branch: master
branch:
- master
- 3.x
- provider: npm
skip_cleanup: true
email:
Expand Down
11 changes: 4 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@
"body-parser": "1.18.2",
"commander": "2.11.0",
"deepcopy": "0.6.3",
"express": "4.16.0",
"express": "4.16.2",
"intersect": "1.0.1",
"lodash": "4.17.4",
"lru-cache": "4.1.1",
"mime": "1.4.1",
"mime": "2.0.3",
"mongodb": "2.2.33",
"multer": "1.3.0",
"parse": "1.10.2",
Expand All @@ -48,12 +48,9 @@
"babel-cli": "6.26.0",
"babel-core": "6.26.0",
"babel-eslint": "^8.0.0",
"babel-plugin-syntax-flow": "6.18.0",
"babel-plugin-transform-flow-strip-types": "6.22.0",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-preset-env": "1.6.1",
"babel-preset-es2015": "6.24.1",
"babel-preset-stage-3": "6.24.1",
"babel-register": "6.26.0",
"bcrypt-nodejs": "0.0.3",
"cross-env": "5.1.1",
"deep-diff": "0.3.8",
Expand All @@ -80,7 +77,7 @@
"prepublish": "npm run build"
},
"engines": {
"node": ">=4.6"
"node": ">=6.11.4"
},
"bin": {
"parse-server": "./bin/parse-server"
Expand Down
10 changes: 8 additions & 2 deletions resources/npm-git.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@
# From: https://github.com/graphql/graphql-js/blob/master/resources/npm-git.sh

BUILD_DIR=latest
BRANCH="${TRAVIS_BRANCH}"
TARGET="latest"
if [ "$BRANCH" != "master" ];
then
TARGET="$BRANCH-preview"
fi

npm run build

Expand All @@ -29,5 +35,5 @@ git init
git config user.name "Travis CI"
git config user.email "[email protected]"
git add .
git commit -m "Deploy master to LATEST branch"
git push --force --quiet "https://${GH_TOKEN}@github.com/parse-community/parse-server.git" master:latest
git commit -m "Deploy $BRANCH to $TARGET branch"
git push --force --quiet "https://${GH_TOKEN}@github.com/parse-community/parse-server.git" master:$TARGET
8 changes: 7 additions & 1 deletion spec/MongoSchemaCollectionAdapter.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ describe('MongoSchemaCollection', () => {
"create":{"*":true},
"delete":{"*":true},
"addField":{"*":true},
},
"indexes": {
"name1":{"deviceToken":1}
}
},
"installationId":"string",
Expand Down Expand Up @@ -66,7 +69,10 @@ describe('MongoSchemaCollection', () => {
update: { '*': true },
delete: { '*': true },
addField: { '*': true },
}
},
indexes: {
name1: {deviceToken: 1}
},
});
done();
});
Expand Down
124 changes: 90 additions & 34 deletions spec/ParseQuery.FullTextSearch.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ const fullTextHelper = () => {
const request = {
method: "POST",
body: {
subject: subjects[i]
subject: subjects[i],
comment: subjects[i],
},
path: "/1/classes/TestObject"
};
Expand Down Expand Up @@ -280,42 +281,83 @@ describe('Parse.Query Full Text Search testing', () => {
});

describe_only_db('mongo')('Parse.Query Full Text Search testing', () => {
it('fullTextSearch: $search, only one text index', (done) => {
return reconfigureServer({
appId: 'test',
restAPIKey: 'test',
publicServerURL: 'http://localhost:8378/1',
databaseAdapter: new MongoStorageAdapter({ uri: mongoURI })
it('fullTextSearch: does not create text index if compound index exist', (done) => {
fullTextHelper().then(() => {
return databaseAdapter.dropAllIndexes('TestObject');
}).then(() => {
return rp.post({
url: 'http://localhost:8378/1/batch',
body: {
requests: [
{
method: "POST",
body: {
subject: "coffee is java"
},
path: "/1/classes/TestObject"
},
{
method: "POST",
body: {
subject: "java is coffee"
},
path: "/1/classes/TestObject"
return databaseAdapter.getIndexes('TestObject');
}).then((indexes) => {
expect(indexes.length).toEqual(1);
return databaseAdapter.createIndex('TestObject', {subject: 'text', comment: 'text'});
}).then(() => {
return databaseAdapter.getIndexes('TestObject');
}).then((indexes) => {
expect(indexes.length).toEqual(2);
const where = {
subject: {
$text: {
$search: {
$term: 'coffee'
}
]
},
json: true,
}
}
};
return rp.post({
url: 'http://localhost:8378/1/classes/TestObject',
json: { where, '_method': 'GET' },
headers: {
'X-Parse-Application-Id': 'test',
'X-Parse-REST-API-Key': 'test'
}
});
}).then((resp) => {
expect(resp.results.length).toEqual(3);
return databaseAdapter.getIndexes('TestObject');
}).then((indexes) => {
expect(indexes.length).toEqual(2);
rp.get({
url: 'http://localhost:8378/1/schemas/TestObject',
headers: {
'X-Parse-Application-Id': 'test',
'X-Parse-Master-Key': 'test',
},
json: true,
}, (error, response, body) => {
expect(body.indexes._id_).toBeDefined();
expect(body.indexes._id_._id).toEqual(1);
expect(body.indexes.subject_text_comment_text).toBeDefined();
expect(body.indexes.subject_text_comment_text.subject).toEqual('text');
expect(body.indexes.subject_text_comment_text.comment).toEqual('text');
done();
});
}).catch(done.fail);
});

it('fullTextSearch: does not create text index if schema compound index exist', (done) => {
fullTextHelper().then(() => {
return databaseAdapter.dropAllIndexes('TestObject');
}).then(() => {
return databaseAdapter.createIndex('TestObject', {random: 'text'});
return databaseAdapter.getIndexes('TestObject');
}).then((indexes) => {
expect(indexes.length).toEqual(1);
return rp.put({
url: 'http://localhost:8378/1/schemas/TestObject',
json: true,
headers: {
'X-Parse-Application-Id': 'test',
'X-Parse-REST-API-Key': 'test',
'X-Parse-Master-Key': 'test',
},
body: {
indexes: {
text_test: { subject: 'text', comment: 'text'},
},
},
});
}).then(() => {
return databaseAdapter.getIndexes('TestObject');
}).then((indexes) => {
expect(indexes.length).toEqual(2);
const where = {
subject: {
$text: {
Expand All @@ -334,12 +376,26 @@ describe_only_db('mongo')('Parse.Query Full Text Search testing', () => {
}
});
}).then((resp) => {
fail(`Should not be more than one text index: ${JSON.stringify(resp)}`);
done();
}).catch((err) => {
expect(err.error.code).toEqual(Parse.Error.INTERNAL_SERVER_ERROR);
done();
});
expect(resp.results.length).toEqual(3);
return databaseAdapter.getIndexes('TestObject');
}).then((indexes) => {
expect(indexes.length).toEqual(2);
rp.get({
url: 'http://localhost:8378/1/schemas/TestObject',
headers: {
'X-Parse-Application-Id': 'test',
'X-Parse-Master-Key': 'test',
},
json: true,
}, (error, response, body) => {
expect(body.indexes._id_).toBeDefined();
expect(body.indexes._id_._id).toEqual(1);
expect(body.indexes.text_test).toBeDefined();
expect(body.indexes.text_test.subject).toEqual('text');
expect(body.indexes.text_test.comment).toEqual('text');
done();
});
}).catch(done.fail);
});

it('fullTextSearch: $diacriticSensitive - false', (done) => {
Expand Down
5 changes: 4 additions & 1 deletion spec/Schema.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ describe('SchemaController', () => {
fooSixteen: {type: 'String'},
fooEighteen: {type: 'String'},
fooNineteen: {type: 'String'},
}, levelPermissions, config.database))
}, levelPermissions, {}, config.database))
.then(actualSchema => {
const expectedSchema = {
className: 'NewClass',
Expand Down Expand Up @@ -304,6 +304,9 @@ describe('SchemaController', () => {
fooNineteen: {type: 'String'},
},
classLevelPermissions: { ...levelPermissions },
indexes: {
_id_: { _id: 1 }
}
};

expect(dd(actualSchema, expectedSchema)).toEqual(undefined);
Expand Down
Loading