From 7a525e810bbc62b5f3940b4c225a93be0c83c1f4 Mon Sep 17 00:00:00 2001 From: Peter Schmidt Date: Fri, 25 Nov 2016 15:25:31 +1100 Subject: [PATCH 1/3] Standardise mongodb-runner CI https://github.com/mongodb-js/connection-model/pull/138 NOTE: `npm run check && npm run test-unit` passes for me locally on macOS, but the functional tests `npm test ` still error with results: 177 passing (50s) 2 pending 10 failing 1) Compass #spectron when working with the application when working with collections when selecting a collection renders the sample collection in the title: Error: element (button[data-hook=start-button]) still not visible after 5000ms at elements("button[data-hook=start-button]") - isVisible.js:54:17 at isVisible("button[data-hook=start-button]") - waitForVisible.js:37:22 2) Compass #spectron when working with the application when working with collections when selecting a collection renders the schema tab: Error: An element could not be located on the page using the given search parameters. at element("li#SCHEMA") - click.js:12:17 at elementIdDisplayed("0.9192226665154364-7") - isVisible.js:71:55 3) Compass #spectron when working with the application when working with collections when selecting a collection when applying a filter the text in refine bar matches query: Error: Promise was rejected with the following reason: Error: An element could not be located on the page using the given search parameters ("input#refine_input"). at elements("input#refine_input") - getValue.js:18:17 at getValue("input#refine_input") - waitForValue.js:37:22 4) Compass #spectron when working with the application when working with collections when selecting a collection when applying a filter samples the matching documents: Error: element (div.sampling-message) still not visible after 15000ms at elements("div.sampling-message") - isVisible.js:54:17 at isVisible("div.sampling-message") - waitForVisible.js:37:22 5) Compass #spectron when working with the application when working with collections when selecting a collection when applying a filter updates the schema view: Error: An element could not be located on the page using the given search parameters ("li.bubble code.selectable"). at elements("li.bubble code.selectable") - getText.js:18:17 at getText("li.bubble code.selectable") - compass-functional.test.js:120:16 6) Compass #spectron when working with the application when working with collections when selecting a collection when applying a filter filters out non-matches from the document list: Error: An element could not be located on the page using the given search parameters. at element("li#DOCUMENTS") - click.js:12:17 at elementIdDisplayed("0.9192226665154364-7") - isVisible.js:71:55 7) Compass #spectron when working with the application when working with collections when selecting a collection when applying a filter includes documents that match the filter: Error: An element could not be located on the page using the given search parameters ("div.element-value-is-string"). at elements("div.element-value-is-string") - getText.js:18:17 at getText("div.element-value-is-string") - compass-functional.test.js:138:16 8) Compass #spectron when working with the application when working with collections when working in the documents tab when viewing documents renders the documents in the list: Error: An element could not be located on the page using the given search parameters. at element("li#DOCUMENTS") - click.js:12:17 at elementIdDisplayed("0.9192226665154364-7") - isVisible.js:71:55 9) Compass #spectron when working with the application when working with collections when working in the explain tab when viewing the explain tab renders the stages: Error: An element could not be located on the page using the given search parameters. at element("li#EXPLAIN_PLAN") - click.js:12:17 at elementIdDisplayed("0.9192226665154364-7") - isVisible.js:71:55 10) Compass #spectron when working with the application when working with collections when working in the indexes tab when viewing the indexes tab renders the indexes: Error: An element could not be located on the page using the given search parameters. at element("li#INDEXES") - click.js:12:17 at elementIdDisplayed("0.9192226665154364-7") - isVisible.js:71:55 --- .travis.yml | 4 +++- package.json | 3 +-- test/compass-functional.test.js | 10 ++++++++++ 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 17e65571b4b..3741f36085c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,8 @@ +sudo: required language: node_js node_js: -- 6.3.1 + - 6.3.1 + - lts/boron env: matrix: - CXX=g++-4.8 CI=1 diff --git a/package.json b/package.json index 074949d9464..37b95b1100b 100644 --- a/package.json +++ b/package.json @@ -53,9 +53,8 @@ }, "scripts": { "start": "hadron-build develop", - "pretest": "mongodb-runner install && mongodb-runner start --topology=standalone --port 27018", + "pretest": "mongodb-runner install", "test": "hadron-build test", - "posttest": "mongodb-runner stop --topology=standalone --port 27018", "check": "mongodb-js-precommit ./src/app/*.js ./src/app/**/**/*.js ./src/{app/**/*.js,main/**/*.js} ./test/*.js ./src/internal-packages/**/*.js ./src/internal-packages/**/**/*{.js,.jsx} ./src/internal-packages/**/**/**/*{.js,.jsx} ./src/internal-packages/**/**/**/**/*{.js,.jsx}", "ci": "npm run check && npm run test", "clean": "hadron-build clean", diff --git a/test/compass-functional.test.js b/test/compass-functional.test.js index 9b34134d2d0..a68b2a4345c 100644 --- a/test/compass-functional.test.js +++ b/test/compass-functional.test.js @@ -19,6 +19,16 @@ var DOCUMENTS = [ ]; describe('Compass #spectron', function() { + before(require('mongodb-runner/mocha/before')({ + port: 27018, + topology: 'standalone' + })); + + after(require('mongodb-runner/mocha/after')({ + port: 27018, + topology: 'standalone' + })); + this.slow(30000); this.timeout(60000); var app = null; From 8383109e7ba25858b9ef4e070f6cc11343077747 Mon Sep 17 00:00:00 2001 From: Peter Schmidt Date: Fri, 25 Nov 2016 16:04:13 +1100 Subject: [PATCH 2/3] Go back to the full pretest and post test hooks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Annoying as we can’t test multiple topologies, but probably a decent idea for Compass itself as we should delegate as much as possible to each public mongodb-js dependency. Note: Needed as otherwise TravisCI hangs for 10 minutes then kills the job even though it completes with exit code 0, i.e. successfully. e.g. https://travis-ci.com/10gen/compass/jobs/57691028 --- package.json | 3 ++- test/compass-functional.test.js | 10 ---------- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index 37b95b1100b..074949d9464 100644 --- a/package.json +++ b/package.json @@ -53,8 +53,9 @@ }, "scripts": { "start": "hadron-build develop", - "pretest": "mongodb-runner install", + "pretest": "mongodb-runner install && mongodb-runner start --topology=standalone --port 27018", "test": "hadron-build test", + "posttest": "mongodb-runner stop --topology=standalone --port 27018", "check": "mongodb-js-precommit ./src/app/*.js ./src/app/**/**/*.js ./src/{app/**/*.js,main/**/*.js} ./test/*.js ./src/internal-packages/**/*.js ./src/internal-packages/**/**/*{.js,.jsx} ./src/internal-packages/**/**/**/*{.js,.jsx} ./src/internal-packages/**/**/**/**/*{.js,.jsx}", "ci": "npm run check && npm run test", "clean": "hadron-build clean", diff --git a/test/compass-functional.test.js b/test/compass-functional.test.js index a68b2a4345c..9b34134d2d0 100644 --- a/test/compass-functional.test.js +++ b/test/compass-functional.test.js @@ -19,16 +19,6 @@ var DOCUMENTS = [ ]; describe('Compass #spectron', function() { - before(require('mongodb-runner/mocha/before')({ - port: 27018, - topology: 'standalone' - })); - - after(require('mongodb-runner/mocha/after')({ - port: 27018, - topology: 'standalone' - })); - this.slow(30000); this.timeout(60000); var app = null; From 7f36af940fa82ec833d8549292c022cb6c5ff54f Mon Sep 17 00:00:00 2001 From: Peter Schmidt Date: Fri, 25 Nov 2016 16:18:31 +1100 Subject: [PATCH 3/3] Drop lts/boron We can add it in when we decide we actually want to switch, as our private Travis seems to be a little under-powered at this time (build queues backing up). --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 3741f36085c..20e50e7ec92 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,6 @@ sudo: required language: node_js node_js: - 6.3.1 - - lts/boron env: matrix: - CXX=g++-4.8 CI=1