Skip to content

Commit 142acde

Browse files
committed
Fix travis to restart mongodb
1 parent e1dbd71 commit 142acde

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

.travis.yml

+1-6
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ env:
2525
global:
2626
- COVERAGE_OPTION='./node_modules/.bin/nyc'
2727
matrix:
28-
- MONGODB_VERSION=4.0.4
28+
- MONGODB_VERSION=4.0.4 MONGODB_TOPOLOGY=replicaset
2929
- MONGODB_VERSION=3.6.9
3030
- PARSE_SERVER_TEST_DB=postgres
3131
- PARSE_SERVER_TEST_CACHE=redis
@@ -38,11 +38,6 @@ before_install:
3838
- nvm use $NODE_VERSION
3939
- npm install -g greenkeeper-lockfile@1
4040
before_script:
41-
- echo "replSet = rs0" | sudo tee -a /etc/mongodb.conf
42-
- sudo service mongodb restart
43-
- sleep 20
44-
- mongo --eval 'rs.initiate()'
45-
- sleep 20
4641
- node -e 'require("./lib/index.js")'
4742
- psql -c 'create database parse_server_postgres_adapter_test_database;' -U postgres
4843
- psql -c 'CREATE EXTENSION postgis;' -U postgres -d parse_server_postgres_adapter_test_database

spec/batch.spec.js

+7-3
Original file line numberDiff line numberDiff line change
@@ -153,16 +153,20 @@ describe('batch', () => {
153153
});
154154

155155
if (
156-
process.env.MONGODB_VERSION === '4.0.4' ||
156+
(process.env.MONGODB_VERSION === '4.0.4' &&
157+
process.env.MONGODB_TOPOLOGY === 'replicaset') ||
157158
process.env.PARSE_SERVER_TEST_DB === 'postgres'
158159
) {
159160
describe('transactions', () => {
160161
beforeAll(async () => {
161-
if (process.env.MONGODB_VERSION === '4.0.4') {
162+
if (
163+
process.env.MONGODB_VERSION === '4.0.4' &&
164+
process.env.MONGODB_TOPOLOGY === 'replicaset'
165+
) {
162166
await reconfigureServer({
163167
databaseAdapter: undefined,
164168
databaseURI:
165-
'mongodb://localhost:27017/parseServerMongoAdapterTestDatabase?replicaSet=rs0',
169+
'mongodb://localhost:27017/parseServerMongoAdapterTestDatabase?replicaSet=replicaset',
166170
});
167171
}
168172
});

0 commit comments

Comments
 (0)