From 10609f257f1673c1e7c9b35e9298fa23feb7dd3f Mon Sep 17 00:00:00 2001 From: Peter Schmidt Date: Thu, 5 Oct 2017 14:00:33 +1100 Subject: [PATCH] [Backport 1.9] 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) CollectionsStore "before all" hook: Error: Timeout of 2000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. https://travis-ci.com/10gen/compass/jobs/93287442 --- .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 abeb101e7c5..14020b98f8f 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(); }