From 95473c2de23d592e733f24d0c7d893e1c1a7469e Mon Sep 17 00:00:00 2001 From: Peter Schmidt Date: Tue, 8 Aug 2017 15:55:17 +1000 Subject: [PATCH 01/10] Add some debugging statements --- test/functional/collections.test.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/functional/collections.test.js b/test/functional/collections.test.js index 00a87f97df4..54e92738d5d 100644 --- a/test/functional/collections.test.js +++ b/test/functional/collections.test.js @@ -2,6 +2,8 @@ const Connection = require('mongodb-connection-model'); const DataService = require('mongodb-data-service'); const { launchCompass, quitCompass} = require('./support/spectron-support'); +const debug = require('debug')('mongodb-compass:functional:collections'); + /** * Global connection model for this test. */ @@ -14,6 +16,7 @@ describe('#collections', function() { let client = null; before(function() { + debug('1st before'); return launchCompass().then(function(application) { app = application; client = application.client; @@ -29,11 +32,15 @@ describe('#collections', function() { const dataService = new DataService(CONNECTION); before(function(done) { + debug('2nd before - pre dataService connect'); dataService.connect(function() { + debug('2nd before - dataService connected'); dataService.createCollection('music.artists', {}, function() { + debug('2nd before - collection created'); return client .clickInstanceRefreshIcon() .waitForInstanceRefresh().then(function() { + debug('2nd before - done'); done(); }); }); @@ -49,6 +56,7 @@ describe('#collections', function() { context('when viewing the database', function() { it('lists the collections in the database', function() { + debug('inside "lists the collections in the database"'); return client .clickDatabaseInSidebar('music') .waitForDatabaseView() From c17a78df3e1ff9b86b0c329d112719186ea86c65 Mon Sep 17 00:00:00 2001 From: Peter Schmidt Date: Tue, 8 Aug 2017 16:06:24 +1000 Subject: [PATCH 02/10] Add DEBUG=* to Travis --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 1702eeace9c..340713ccf1b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,7 +24,7 @@ before_script: - mkdir -p /home/travis/build/10gen/compass/node_modules/mongodb-version-manager/.mongodb/downloads/ - wget -P /home/travis/build/10gen/compass/node_modules/mongodb-version-manager/.mongodb/downloads/ http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-2.6.12.tgz - wget -P /home/travis/build/10gen/compass/node_modules/mongodb-version-manager/.mongodb/downloads/ http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.4.7.tgz -script: npm run test +script: DEBUG=* npm test cache: directories: - $HOME/.electron From 140a8f140be91cc8c779c3a0a75d84d26b1bc76a Mon Sep 17 00:00:00 2001 From: Peter Schmidt Date: Tue, 8 Aug 2017 16:20:41 +1000 Subject: [PATCH 03/10] Drop travis to just the required functional subset Should avoid the extremely verbose logs from enzyme tests as well, e.g. https://api.travis-ci.com/jobs/85808677/log.txt?deansi=true&access_token=X8EJCyqCWec556MVGCK4qg --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 340713ccf1b..7a839cc629f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,7 +24,7 @@ before_script: - mkdir -p /home/travis/build/10gen/compass/node_modules/mongodb-version-manager/.mongodb/downloads/ - wget -P /home/travis/build/10gen/compass/node_modules/mongodb-version-manager/.mongodb/downloads/ http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-2.6.12.tgz - wget -P /home/travis/build/10gen/compass/node_modules/mongodb-version-manager/.mongodb/downloads/ http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.4.7.tgz -script: DEBUG=* npm test +script: DEBUG=* npm test -- --functional -g '#launch|#collections' cache: directories: - $HOME/.electron From 9cb3b69d291eb6dadcfd3e367aece69c8849c8c6 Mon Sep 17 00:00:00 2001 From: Peter Schmidt Date: Tue, 8 Aug 2017 16:41:07 +1000 Subject: [PATCH 04/10] Add more output Very interesting Travis log from previous run: https://travis-ci.com/10gen/compass/jobs/85809471 Parallels to COMPASS 1056 as well... --- test/functional/collections.test.js | 1 + test/functional/support/packages/spectron-sidebar.js | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/test/functional/collections.test.js b/test/functional/collections.test.js index 54e92738d5d..a78d642de93 100644 --- a/test/functional/collections.test.js +++ b/test/functional/collections.test.js @@ -21,6 +21,7 @@ describe('#collections', function() { app = application; client = application.client; client.connectToCompass({ hostname: 'localhost', port: 27018 }); + }); }); diff --git a/test/functional/support/packages/spectron-sidebar.js b/test/functional/support/packages/spectron-sidebar.js index ea22c6e58d9..fc4a55af495 100644 --- a/test/functional/support/packages/spectron-sidebar.js +++ b/test/functional/support/packages/spectron-sidebar.js @@ -1,5 +1,7 @@ const { selector } = require('hadron-spectron'); +const debug = require('debug')('mongodb-compass:functional:spectron-sidebar'); + function addWaitSidebarCommands(client) { /** @@ -15,8 +17,10 @@ function addWaitSidebarCommands(client) { * Wait for the instance refresh to finish. */ client.addCommand('waitForInstanceRefresh', function() { + debug('2nd before - connection created - waitForInstanceRefresh'); const button = selector('instance-refresh-button'); const icon = `${button} i.fa-spin`; + debug('2nd before - connection created - selected button'); return this.waitForVisibleInCompass(icon, true); }); } @@ -35,7 +39,9 @@ function addClickSidebarCommands(client) { * Click the instance refresh button in the top right corner of the sidebar. */ client.addCommand('clickInstanceRefreshIcon', function() { + debug('2nd before - connection created - clickInstanceRefreshIcon'); const button = selector('instance-refresh-button'); + debug('2nd before - connection created - selected button'); return this .waitForVisibleInCompass(button).click(button); }); From c03291f04eabc24be302fd60fed58ac655f0ed8d Mon Sep 17 00:00:00 2001 From: Peter Schmidt Date: Tue, 8 Aug 2017 16:54:26 +1000 Subject: [PATCH 05/10] :shirt: --- test/functional/collections.test.js | 1 - 1 file changed, 1 deletion(-) diff --git a/test/functional/collections.test.js b/test/functional/collections.test.js index a78d642de93..54e92738d5d 100644 --- a/test/functional/collections.test.js +++ b/test/functional/collections.test.js @@ -21,7 +21,6 @@ describe('#collections', function() { app = application; client = application.client; client.connectToCompass({ hostname: 'localhost', port: 27018 }); - }); }); From 147a02852f69af3de0ad57d3bef4abf000a1ddaf Mon Sep 17 00:00:00 2001 From: Peter Schmidt Date: Tue, 8 Aug 2017 16:58:28 +1000 Subject: [PATCH 06/10] Move data service setup to before Compass starts Avoids the need to fiddle with the .clickInstanceRefreshIcon() and .waitForInstanceRefresh() entirely, but if it does work, it would probably not resolve COMPASS 1056 as that would require a similar setup refactoring. --- test/functional/collections.test.js | 46 +++++++++++------------------ 1 file changed, 18 insertions(+), 28 deletions(-) diff --git a/test/functional/collections.test.js b/test/functional/collections.test.js index 54e92738d5d..01434155892 100644 --- a/test/functional/collections.test.js +++ b/test/functional/collections.test.js @@ -15,43 +15,33 @@ describe('#collections', function() { let app = null; let client = null; - before(function() { - debug('1st before'); - return launchCompass().then(function(application) { - app = application; - client = application.client; - client.connectToCompass({ hostname: 'localhost', port: 27018 }); + const dataService = new DataService(CONNECTION); + before(function(done) { + dataService.connect(function() { + dataService.createCollection('music.artists', {}, function() { + done(); + }); }); }); - after(function() { - return quitCompass(app); + after(function(done) { + dataService.dropDatabase('music', function() { + dataService.disconnect(); + done(); + }); }); context('when creating & deleting collections', function() { - const dataService = new DataService(CONNECTION); - - before(function(done) { - debug('2nd before - pre dataService connect'); - dataService.connect(function() { - debug('2nd before - dataService connected'); - dataService.createCollection('music.artists', {}, function() { - debug('2nd before - collection created'); - return client - .clickInstanceRefreshIcon() - .waitForInstanceRefresh().then(function() { - debug('2nd before - done'); - done(); - }); - }); + before(function() { + return launchCompass().then(function(application) { + app = application; + client = application.client; + client.connectToCompass({ hostname: 'localhost', port: 27018 }); }); }); - after(function(done) { - dataService.dropDatabase('music', function() { - dataService.disconnect(); - done(); - }); + after(function() { + return quitCompass(app); }); context('when viewing the database', function() { From a8132bc1df7429230ec4b5915d5573d5a42933a7 Mon Sep 17 00:00:00 2001 From: Peter Schmidt Date: Tue, 8 Aug 2017 17:05:27 +1000 Subject: [PATCH 07/10] Reverse debugging changes --- .travis.yml | 2 +- test/functional/collections.test.js | 3 --- test/functional/support/packages/spectron-sidebar.js | 6 ------ 3 files changed, 1 insertion(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7a839cc629f..a024cea7c66 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,7 +24,7 @@ before_script: - mkdir -p /home/travis/build/10gen/compass/node_modules/mongodb-version-manager/.mongodb/downloads/ - wget -P /home/travis/build/10gen/compass/node_modules/mongodb-version-manager/.mongodb/downloads/ http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-2.6.12.tgz - wget -P /home/travis/build/10gen/compass/node_modules/mongodb-version-manager/.mongodb/downloads/ http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.4.7.tgz -script: DEBUG=* npm test -- --functional -g '#launch|#collections' +script: npm test cache: directories: - $HOME/.electron diff --git a/test/functional/collections.test.js b/test/functional/collections.test.js index 01434155892..e3c7b27ecf3 100644 --- a/test/functional/collections.test.js +++ b/test/functional/collections.test.js @@ -2,8 +2,6 @@ const Connection = require('mongodb-connection-model'); const DataService = require('mongodb-data-service'); const { launchCompass, quitCompass} = require('./support/spectron-support'); -const debug = require('debug')('mongodb-compass:functional:collections'); - /** * Global connection model for this test. */ @@ -46,7 +44,6 @@ describe('#collections', function() { context('when viewing the database', function() { it('lists the collections in the database', function() { - debug('inside "lists the collections in the database"'); return client .clickDatabaseInSidebar('music') .waitForDatabaseView() diff --git a/test/functional/support/packages/spectron-sidebar.js b/test/functional/support/packages/spectron-sidebar.js index fc4a55af495..ea22c6e58d9 100644 --- a/test/functional/support/packages/spectron-sidebar.js +++ b/test/functional/support/packages/spectron-sidebar.js @@ -1,7 +1,5 @@ const { selector } = require('hadron-spectron'); -const debug = require('debug')('mongodb-compass:functional:spectron-sidebar'); - function addWaitSidebarCommands(client) { /** @@ -17,10 +15,8 @@ function addWaitSidebarCommands(client) { * Wait for the instance refresh to finish. */ client.addCommand('waitForInstanceRefresh', function() { - debug('2nd before - connection created - waitForInstanceRefresh'); const button = selector('instance-refresh-button'); const icon = `${button} i.fa-spin`; - debug('2nd before - connection created - selected button'); return this.waitForVisibleInCompass(icon, true); }); } @@ -39,9 +35,7 @@ function addClickSidebarCommands(client) { * Click the instance refresh button in the top right corner of the sidebar. */ client.addCommand('clickInstanceRefreshIcon', function() { - debug('2nd before - connection created - clickInstanceRefreshIcon'); const button = selector('instance-refresh-button'); - debug('2nd before - connection created - selected button'); return this .waitForVisibleInCompass(button).click(button); }); From d36e7288c9c0f3515344c5089dece65a671f30a9 Mon Sep 17 00:00:00 2001 From: Peter Schmidt Date: Tue, 8 Aug 2017 17:06:53 +1000 Subject: [PATCH 08/10] noop --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index a024cea7c66..1702eeace9c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,7 +24,7 @@ before_script: - mkdir -p /home/travis/build/10gen/compass/node_modules/mongodb-version-manager/.mongodb/downloads/ - wget -P /home/travis/build/10gen/compass/node_modules/mongodb-version-manager/.mongodb/downloads/ http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-2.6.12.tgz - wget -P /home/travis/build/10gen/compass/node_modules/mongodb-version-manager/.mongodb/downloads/ http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.4.7.tgz -script: npm test +script: npm run test cache: directories: - $HOME/.electron From 5d0cd0c223d8b15841db411820de95722727a7d8 Mon Sep 17 00:00:00 2001 From: Peter Schmidt Date: Tue, 8 Aug 2017 17:18:48 +1000 Subject: [PATCH 09/10] Revert "noop" --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 1702eeace9c..a024cea7c66 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,7 +24,7 @@ before_script: - mkdir -p /home/travis/build/10gen/compass/node_modules/mongodb-version-manager/.mongodb/downloads/ - wget -P /home/travis/build/10gen/compass/node_modules/mongodb-version-manager/.mongodb/downloads/ http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-2.6.12.tgz - wget -P /home/travis/build/10gen/compass/node_modules/mongodb-version-manager/.mongodb/downloads/ http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.4.7.tgz -script: npm run test +script: npm test cache: directories: - $HOME/.electron From 60e9c2ca5bfaacf70a499feab5e19e54af6b6352 Mon Sep 17 00:00:00 2001 From: Peter Schmidt Date: Tue, 8 Aug 2017 17:06:53 +1000 Subject: [PATCH 10/10] noop --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index a024cea7c66..1702eeace9c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,7 +24,7 @@ before_script: - mkdir -p /home/travis/build/10gen/compass/node_modules/mongodb-version-manager/.mongodb/downloads/ - wget -P /home/travis/build/10gen/compass/node_modules/mongodb-version-manager/.mongodb/downloads/ http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-2.6.12.tgz - wget -P /home/travis/build/10gen/compass/node_modules/mongodb-version-manager/.mongodb/downloads/ http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.4.7.tgz -script: npm test +script: npm run test cache: directories: - $HOME/.electron