diff --git a/Gruntfile.coffee b/Gruntfile.coffee index 76d86a84c..5b846b0c6 100644 --- a/Gruntfile.coffee +++ b/Gruntfile.coffee @@ -160,15 +160,6 @@ module.exports = (grunt) -> stderr: false failOnError: false - test: - command: "#{path.join(contentsDir, 'MacOS', 'Atom')} --test --resource-path=#{__dirname}" - options: - stdout: true - stderr: true - callback: (error, stdout, stderr, callback) -> - grunt.warn('Specs failed') if error? - callback() - grunt.loadNpmTasks('grunt-coffeelint') grunt.loadNpmTasks('grunt-lesslint') grunt.loadNpmTasks('grunt-cson') @@ -181,7 +172,7 @@ module.exports = (grunt) -> grunt.registerTask('compile', ['coffee', 'prebuild-less', 'cson']) grunt.registerTask('lint', ['coffeelint', 'csslint', 'lesslint']) - grunt.registerTask('test', ['shell:kill-atom', 'run-specs']) + grunt.registerTask('test', ['shell:kill-atom', 'run-core-specs', 'run-specs']) grunt.registerTask('ci', ['lint', 'update-atom-shell', 'build', 'set-development-version', 'test']) grunt.registerTask('deploy', ['partial-clean', 'update-atom-shell', 'build', 'codesign']) grunt.registerTask('docs', ['markdown:guides', 'build-docs']) diff --git a/tasks/test-task.coffee b/tasks/test-task.coffee index fb154b666..56281cdbe 100644 --- a/tasks/test-task.coffee +++ b/tasks/test-task.coffee @@ -7,11 +7,10 @@ async = require 'async' module.exports = (grunt) -> {isAtomPackage, spawn} = require('./task-helpers')(grunt) - grunt.registerTask 'run-specs', 'Run the specs', -> + runPackageSpecs = (callback) -> passed = true - done = @async() - appDir = grunt.config.get('atom.appDir') rootDir = grunt.config.get('atom.shellAppDir') + appDir = grunt.config.get('atom.appDir') atomPath = path.join(appDir, 'atom.sh') apmPath = path.join(appDir, 'node_modules/.bin/apm') @@ -34,5 +33,21 @@ module.exports = (grunt) -> continue unless isAtomPackage(packagePath) queue.push(packagePath) - queue.concurrency = 2 - queue.drain = -> done(passed) + queue.concurrency = 1 + queue.drain = -> callback(passed) + + runCoreSpecs = (callback) -> + contentsDir = grunt.config.get('atom.contentsDir') + appPath = path.join(contentsDir, 'MacOS', 'Atom') + resourcePath = process.cwd() + coreSpecsPath = path.resolve('spec') + + options = + cmd: appPath + args: ['--test', "--resource-path=#{resourcePath}", "--spec-directory=#{coreSpecsPath}"] + spawn options, (error, results, code) -> + callback(code is 0) + + grunt.registerTask 'run-specs', 'Run the specs', -> + passed = true + async.parallel([runCoreSpecs, runPackageSpecs], @async())