From 5d9c5c51d35adb0b0047ba8b309611c8d978bbf4 Mon Sep 17 00:00:00 2001 From: joshaber Date: Tue, 16 Feb 2016 10:16:10 -0500 Subject: [PATCH 1/3] We might wanna log the output. --- build/tasks/spec-task.coffee | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/build/tasks/spec-task.coffee b/build/tasks/spec-task.coffee index 892c92696..19b553412 100644 --- a/build/tasks/spec-task.coffee +++ b/build/tasks/spec-task.coffee @@ -86,7 +86,7 @@ module.exports = (grunt) -> packageSpecQueue.concurrency = Math.max(1, concurrency - 1) packageSpecQueue.drain = -> callback(null, failedPackages) - runCoreSpecs = (callback) -> + runCoreSpecs = (callback, logOutput = false) -> appPath = getAppPath() resourcePath = process.cwd() coreSpecsPath = path.resolve('spec') @@ -130,11 +130,17 @@ module.exports = (grunt) -> else async.parallel + # If we're just running the core specs then we won't have any output to + # indicate the tests actually *are* running. This upsets Travis: + # https://github.com/atom/atom/issues/10837. So pass the test output + # through. + runCoreSpecsWithLogging = (callback) -> runCoreSpecs(callback, true) + specs = if process.env.ATOM_SPECS_TASK is 'packages' [runPackageSpecs] else if process.env.ATOM_SPECS_TASK is 'core' - [runCoreSpecs] + [runCoreSpecsWithLogging] else [runCoreSpecs, runPackageSpecs] From a89257d4749403f3f6b42f3b2cc4040749b8d52c Mon Sep 17 00:00:00 2001 From: joshaber Date: Tue, 16 Feb 2016 10:16:21 -0500 Subject: [PATCH 2/3] Just inherit stdio if we're logging. --- build/tasks/spec-task.coffee | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build/tasks/spec-task.coffee b/build/tasks/spec-task.coffee index 19b553412..e3fa105ac 100644 --- a/build/tasks/spec-task.coffee +++ b/build/tasks/spec-task.coffee @@ -109,6 +109,9 @@ module.exports = (grunt) -> ATOM_INTEGRATION_TESTS_ENABLED: true ) + if logOutput + options.opts.stdio = 'inherit' + grunt.log.ok "Launching core specs." spawn options, (error, results, code) -> if process.platform is 'win32' From 7f239560f8efafaed1514fde181b215cb226963e Mon Sep 17 00:00:00 2001 From: joshaber Date: Tue, 16 Feb 2016 10:16:39 -0500 Subject: [PATCH 3/3] Depending on the options passed through, we might not have stdout and stderr. --- build/tasks/task-helpers.coffee | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/build/tasks/task-helpers.coffee b/build/tasks/task-helpers.coffee index d24cdec77..b42b4dd15 100644 --- a/build/tasks/task-helpers.coffee +++ b/build/tasks/task-helpers.coffee @@ -52,8 +52,10 @@ module.exports = (grunt) -> stderr = [] error = null proc = childProcess.spawn(options.cmd, options.args, options.opts) - proc.stdout.on 'data', (data) -> stdout.push(data.toString()) - proc.stderr.on 'data', (data) -> stderr.push(data.toString()) + if proc.stdout? + proc.stdout.on 'data', (data) -> stdout.push(data.toString()) + if proc.stderr? + proc.stderr.on 'data', (data) -> stderr.push(data.toString()) proc.on 'error', (processError) -> error ?= processError proc.on 'close', (exitCode, signal) -> error ?= new Error(signal) if exitCode isnt 0