File tree Expand file tree Collapse file tree 2 files changed +20
-5
lines changed Expand file tree Collapse file tree 2 files changed +20
-5
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,11 @@ before_install:
38
38
- nvm use $NODE_VERSION
39
39
- npm install -g greenkeeper-lockfile@1
40
40
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
41
46
- node -e 'require("./lib/index.js")'
42
47
- psql -c 'create database parse_server_postgres_adapter_test_database;' -U postgres
43
48
- psql -c 'CREATE EXTENSION postgis;' -U postgres -d parse_server_postgres_adapter_test_database
Original file line number Diff line number Diff line change @@ -152,13 +152,19 @@ describe('batch', () => {
152
152
} ) ;
153
153
} ) ;
154
154
155
- if ( process . env . PARSE_SERVER_TEST_DATABASE_URI_TRANSACTIONS ) {
155
+ if (
156
+ process . env . MONGODB_VERSION === '4.0.4' ||
157
+ process . env . PARSE_SERVER_TEST_DB === 'postgres'
158
+ ) {
156
159
describe ( 'transactions' , ( ) => {
157
160
beforeAll ( async ( ) => {
158
- await reconfigureServer ( {
159
- databaseAdapter : undefined ,
160
- databaseURI : process . env . PARSE_SERVER_TEST_DATABASE_URI_TRANSACTIONS ,
161
- } ) ;
161
+ if ( process . env . MONGODB_VERSION === '4.0.4' ) {
162
+ await reconfigureServer ( {
163
+ databaseAdapter : undefined ,
164
+ databaseURI :
165
+ 'mongodb://localhost:27017/parseServerMongoAdapterTestDatabase?replicaSet=rs0' ,
166
+ } ) ;
167
+ }
162
168
} ) ;
163
169
164
170
beforeEach ( async ( ) => {
@@ -239,6 +245,10 @@ describe('batch', () => {
239
245
} ) ;
240
246
241
247
it ( 'should generate separate session for each call' , async ( ) => {
248
+ const myObject = new Parse . Object ( 'MyObject2' ) ; // This is important because transaction only works on pre-existing collections
249
+ await myObject . save ( ) ;
250
+ await myObject . destroy ( ) ;
251
+
242
252
spyOn ( databaseAdapter , 'createObject' ) . and . callThrough ( ) ;
243
253
244
254
let myObjectCalls = 0 ;
You can’t perform that action at this time.
0 commit comments