From 66eb074cc5662ec381dbd0073ea93d03b2c09336 Mon Sep 17 00:00:00 2001 From: Peter Schmidt Date: Thu, 5 Oct 2017 14:00:33 +1100 Subject: [PATCH 1/2] [Backport 1.8] COMPASS 2159 Switch to TravisCI container-based infrastructure (#1255) * :fire: Remove #databases dropDatabase('music') call It was not created by this test, so if it's needed it would be for earlier test runs? I don't see value in keeping it. Plus - it might be how the chain of test timeouts gets broken? Let's find out with another test. * :bug: Handle the case where app is undefined This should be the second failure in at least one of the "main failure chain" pairs, i.e. https://travis-ci.com/10gen/compass/jobs/92384423 (but not) https://travis-ci.com/10gen/compass/jobs/92384429 * :bug: Handle app null as well as undefined https://travis-ci.com/10gen/compass/jobs/92556220 * :construction: Try container-based infrastructure Just seeing if it's a cheap win today. https://blog.travis-ci.com/2014-12-17-faster-builds-with-container-based-infrastructure/ * :art: Remove clickDatabaseInSidebar/waitForSidebar calls They are redundant as they are already done by goToCollection, which is at least a code smell worthwhile removing. * noop * Revert "noop" * noop * Revert "noop" * noop * Revert "noop" * noop * Revert "noop" * noop * Revert "noop" #retry 1) #collections when creating & deleting collections when viewing the database when creating a collection when deleting a collection pressing enter on correct collection name removes collection: Error: element ("[data-test-id='drop-collection-modal']") still not visible after 8000ms https://travis-ci.com/10gen/compass/jobs/93287440 1) #schema when applying a filter in the schema tab "before all" hook: https://travis-ci.com/10gen/compass/jobs/93288256 --- .travis.yml | 2 +- test/functional/databases.test.js | 9 --------- test/functional/schema.test.js | 2 -- test/functional/support/spectron-support.js | 6 ++++-- 4 files changed, 5 insertions(+), 14 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3f77625bf24..36812e1be1d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,4 @@ -sudo: required +sudo: false dist: trusty language: node_js node_js: diff --git a/test/functional/databases.test.js b/test/functional/databases.test.js index 2c9acc110aa..c3dfea73ff2 100644 --- a/test/functional/databases.test.js +++ b/test/functional/databases.test.js @@ -39,15 +39,6 @@ describe('#databases', function() { }); }); - after(function(done) { - dataService.connect(function() { - dataService.dropDatabase('music', function() { - dataService.disconnect(); - done(); - }); - }); - }); - context('when the escape key is pressed', function() { it('closes the create databases modal', function() { return client diff --git a/test/functional/schema.test.js b/test/functional/schema.test.js index 8573631c5c8..cc02eb3c358 100644 --- a/test/functional/schema.test.js +++ b/test/functional/schema.test.js @@ -62,8 +62,6 @@ describe('#schema', function() { it('shows a schema on refresh', function() { return client - .clickDatabaseInSidebar('music') - .waitForSidebar('collection') .goToCollection('music', 'artists') .clickApplyFilterButtonFromSchemaTab() .waitForStatusBar() diff --git a/test/functional/support/spectron-support.js b/test/functional/support/spectron-support.js index 0c7fdaf0014..eac85eef431 100644 --- a/test/functional/support/spectron-support.js +++ b/test/functional/support/spectron-support.js @@ -65,11 +65,13 @@ function launchCompass() { * Call quitCompass in afterEach for all UI tests: * @param {Object} app - The running application - * @param {Function} done - The callback to execute when finished. * - * @returns {Promise} Promise that resolves when app stops. + * @returns {Promise} Promise that resolves when app stops or is undefined. */ function quitCompass(app) { + if (app === undefined || app === null) { + return Promise.resolve(); + } return app.quit(); } From d700e549f34a204680d899b90e66c0ef84f49896 Mon Sep 17 00:00:00 2001 From: Peter Schmidt Date: Fri, 21 Jul 2017 06:19:07 +1000 Subject: [PATCH 2/2] [Backport 1.8] COMPASS 1424: Resolve 'drop-collection-modal' functional test race (#1165) * :bug: Resolve 'drop-collection-modal functional test race e.g. https://travis-ci.com/10gen/compass/jobs/83567154 * noop * Revert "noop" * noop * Revert "noop" * noop * Revert "noop" * noop * Revert "noop" * noop * Revert "noop" --- test/functional/collections.test.js | 2 +- .../support/packages/spectron-collection-ddl.js | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/test/functional/collections.test.js b/test/functional/collections.test.js index 0b757968fb0..e3c7b27ecf3 100644 --- a/test/functional/collections.test.js +++ b/test/functional/collections.test.js @@ -161,7 +161,7 @@ describe('#collections', function() { return client .inputDropCollectionName('bands') .pressEnter() - .waitForDropCollectionModal() + .waitForDropCollectionModalHidden() .waitForCollectionDeletion('bands') .getCollectionsTabCollectionNames() .should.not.eventually.include('bands'); diff --git a/test/functional/support/packages/spectron-collection-ddl.js b/test/functional/support/packages/spectron-collection-ddl.js index 35645daaf12..910added1d2 100644 --- a/test/functional/support/packages/spectron-collection-ddl.js +++ b/test/functional/support/packages/spectron-collection-ddl.js @@ -37,9 +37,19 @@ function addWaitCollectionDDLCommands(client) { return this.waitForVisibleInCompass(selector('drop-collection-modal')); }); + /** + * Waits for the create collection modal to be hidden. + */ client.addCommand('waitForCreateCollectionModalHidden', function() { return this.waitForVisibleInCompass(selector('create-collection-modal'), true); }); + + /** + * Waits for the drop collection modal to be hidden. + */ + client.addCommand('waitForDropCollectionModalHidden', function() { + return this.waitForVisibleInCompass(selector('drop-collection-modal'), true); + }); }