From 50010a55b94ce4d13da905f5ff03b54ca17dbfa9 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Thu, 16 Apr 2015 09:52:41 +0200 Subject: [PATCH] Use a guard clause to disable integration specs --- build/tasks/spec-task.coffee | 14 ++++++-------- spec/integration/startup-spec.coffee | 3 +++ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/build/tasks/spec-task.coffee b/build/tasks/spec-task.coffee index 09a062ac9..da5b24685 100644 --- a/build/tasks/spec-task.coffee +++ b/build/tasks/spec-task.coffee @@ -86,25 +86,23 @@ module.exports = (grunt) -> resourcePath = process.cwd() coreSpecsPath = path.resolve('spec') - # Integration tests require a fast machine and, for now, we cannot afford to - # run them on Travis. - env = _.extend({}, process.env, - ATOM_INTEGRATION_TESTS_ENABLED: not process.env.TRAVIS - ) - if process.platform in ['darwin', 'linux'] options = cmd: appPath args: ['--test', "--resource-path=#{resourcePath}", "--spec-directory=#{coreSpecsPath}"] opts: - env: env + env: _.extend({}, process.env, + ATOM_INTEGRATION_TESTS_ENABLED: true + ) else if process.platform is 'win32' options = cmd: process.env.comspec args: ['/c', appPath, '--test', "--resource-path=#{resourcePath}", "--spec-directory=#{coreSpecsPath}", "--log-file=ci.log"] opts: - env: env + env: _.extend({}, process.env, + ATOM_INTEGRATION_TESTS_ENABLED: true + ) grunt.log.ok "Launching core specs." spawn options, (error, results, code) -> diff --git a/spec/integration/startup-spec.coffee b/spec/integration/startup-spec.coffee index 2dcf6ba38..b20427954 100644 --- a/spec/integration/startup-spec.coffee +++ b/spec/integration/startup-spec.coffee @@ -2,6 +2,9 @@ # # ATOM_INTEGRATION_TESTS_ENABLED=true apm test return unless process.env.ATOM_INTEGRATION_TESTS_ENABLED +# Integration tests require a fast machine and, for now, we cannot afford to +# run them on Travis. +return if process.env.TRAVIS fs = require "fs" path = require "path"