From ff6a8aed127afdc5ef5bc3be9cdc1e02d6e65278 Mon Sep 17 00:00:00 2001 From: Lucas Hrabovsky Date: Mon, 21 Mar 2016 10:13:24 -0400 Subject: [PATCH 1/5] :zap: debugging NAN compile failures --- .travis.yml | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2e85f31ee0..d52c95cd02 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,15 +1,22 @@ -branches: - only: - - master +# branches: +# only: +# - master language: node_js node_js: - "4.3" env: - global: + global: - COVERAGE_OPTION='./node_modules/babel-istanbul/lib/cli.js cover -x **/spec/**' + - CXX=g++-4.8 matrix: - MONGODB_VERSION=2.6.11 - MONGODB_VERSION=3.0.8 +addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - g++-4.8 cache: directories: - $HOME/.mongodb/versions/downloads From dcb8decd23a4ffe528f7553a2e79b895544e3e01 Mon Sep 17 00:00:00 2001 From: Lucas Hrabovsky Date: Mon, 21 Mar 2016 11:01:17 -0400 Subject: [PATCH 2/5] :zap: move from pretest/posttest hooks to before/after for mongodb-runner --- package.json | 2 -- spec/helper.js | 12 ++++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index b6a5dff0fb..8c1282100e 100644 --- a/package.json +++ b/package.json @@ -63,10 +63,8 @@ "scripts": { "dev": "npm run build && node bin/dev", "build": "./node_modules/.bin/babel src/ -d lib/", - "pretest": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=3.0.8} ./node_modules/.bin/mongodb-runner start", "test": "cross-env NODE_ENV=test TESTING=1 ./node_modules/.bin/babel-node $COVERAGE_OPTION ./node_modules/jasmine/bin/jasmine.js", "test:win": "npm run pretest && cross-env NODE_ENV=test TESTING=1 ./node_modules/.bin/babel-node ./node_modules/babel-istanbul/lib/cli.js cover -x **/spec/** ./node_modules/jasmine/bin/jasmine.js && npm run posttest", - "posttest": "./node_modules/.bin/mongodb-runner stop", "coverage": "cross-env COVERAGE_OPTION='./node_modules/babel-istanbul/lib/cli.js cover -x **/spec/**' npm test", "start": "node ./bin/parse-server", "prepublish": "npm run build" diff --git a/spec/helper.js b/spec/helper.js index e8cabbb4ea..bf5e6a23eb 100644 --- a/spec/helper.js +++ b/spec/helper.js @@ -78,6 +78,18 @@ Parse.serverURL = 'http://localhost:' + port + '/1'; // TODO: update tests to work in an A+ way Parse.Promise.disableAPlusCompliant(); +// Travis will set this environment variable so we always test against +// MongoDB 2.6.11 and 3.0.8. Set the default here so when devs just +// run `npm test` locally MongoDB@3.0.8 will be installed if needed and +// used. +if (!process.env.MONGODB_VERSION) { + process.env.MONGODB_VERSION = '3.0.8'; +} + +// Start MongoDB before running the test suite and stop it afterwards. +before(require('mongodb-runner/mocha/before')); +after(require('mongodb-runner/mocha/after')); + beforeEach(function(done) { restoreServerConfiguration(); Parse.initialize('test', 'test', 'test'); From 96ca08cf419c61811a6c957a1546671a99333bac Mon Sep 17 00:00:00 2001 From: Lucas Hrabovsky Date: Mon, 21 Mar 2016 12:55:13 -0400 Subject: [PATCH 3/5] :zap: Cache node_modules --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index d52c95cd02..2f4ab35dcf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,5 +19,5 @@ addons: - g++-4.8 cache: directories: - - $HOME/.mongodb/versions/downloads + - node_modules/ after_success: ./node_modules/.bin/codecov From 00183a567938a39f5d7767b6e96555f2e787a97c Mon Sep 17 00:00:00 2001 From: Lucas Hrabovsky Date: Tue, 29 Mar 2016 13:21:52 -0400 Subject: [PATCH 4/5] :construction: jasmine global hooks --- spec/helper.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/helper.js b/spec/helper.js index bf5e6a23eb..83e5e04c5d 100644 --- a/spec/helper.js +++ b/spec/helper.js @@ -87,8 +87,8 @@ if (!process.env.MONGODB_VERSION) { } // Start MongoDB before running the test suite and stop it afterwards. -before(require('mongodb-runner/mocha/before')); -after(require('mongodb-runner/mocha/after')); +beforeAll(require('mongodb-runner/mocha/before')); +afterAll(require('mongodb-runner/mocha/after')); beforeEach(function(done) { restoreServerConfiguration(); From cafd8ee6d2d1289669b283482bf0de7f36e484a6 Mon Sep 17 00:00:00 2001 From: Lucas Hrabovsky Date: Tue, 29 Mar 2016 14:09:23 -0400 Subject: [PATCH 5/5] :construction: enable debugging --- spec/helper.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spec/helper.js b/spec/helper.js index 83e5e04c5d..5960a9446a 100644 --- a/spec/helper.js +++ b/spec/helper.js @@ -78,6 +78,8 @@ Parse.serverURL = 'http://localhost:' + port + '/1'; // TODO: update tests to work in an A+ way Parse.Promise.disableAPlusCompliant(); +process.env.DEBUG = 'mon*'; + // Travis will set this environment variable so we always test against // MongoDB 2.6.11 and 3.0.8. Set the default here so when devs just // run `npm test` locally MongoDB@3.0.8 will be installed if needed and