mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-12-28 17:13:45 +03:00
Bump queue concurrency when core specs finish
This commit is contained in:
parent
a55847b03b
commit
afa03b6379
@ -7,6 +7,8 @@ async = require 'async'
|
|||||||
module.exports = (grunt) ->
|
module.exports = (grunt) ->
|
||||||
{isAtomPackage, spawn} = require('./task-helpers')(grunt)
|
{isAtomPackage, spawn} = require('./task-helpers')(grunt)
|
||||||
|
|
||||||
|
packageSpecQueue = null
|
||||||
|
|
||||||
runPackageSpecs = (callback) ->
|
runPackageSpecs = (callback) ->
|
||||||
passed = true
|
passed = true
|
||||||
rootDir = grunt.config.get('atom.shellAppDir')
|
rootDir = grunt.config.get('atom.shellAppDir')
|
||||||
@ -14,7 +16,7 @@ module.exports = (grunt) ->
|
|||||||
atomPath = path.join(appDir, 'atom.sh')
|
atomPath = path.join(appDir, 'atom.sh')
|
||||||
apmPath = path.join(appDir, 'node_modules/.bin/apm')
|
apmPath = path.join(appDir, 'node_modules/.bin/apm')
|
||||||
|
|
||||||
queue = async.queue (packagePath, callback) ->
|
packageSpecQueue = async.queue (packagePath, callback) ->
|
||||||
options =
|
options =
|
||||||
cmd: apmPath
|
cmd: apmPath
|
||||||
args: ['test', '--path', atomPath]
|
args: ['test', '--path', atomPath]
|
||||||
@ -31,10 +33,10 @@ module.exports = (grunt) ->
|
|||||||
packagePath = path.join(modulesDirectory, packageDirectory)
|
packagePath = path.join(modulesDirectory, packageDirectory)
|
||||||
continue unless grunt.file.isDir(path.join(packagePath, 'spec'))
|
continue unless grunt.file.isDir(path.join(packagePath, 'spec'))
|
||||||
continue unless isAtomPackage(packagePath)
|
continue unless isAtomPackage(packagePath)
|
||||||
queue.push(packagePath)
|
packageSpecQueue.push(packagePath)
|
||||||
|
|
||||||
queue.concurrency = 1
|
packageSpecQueue.concurrency = 1
|
||||||
queue.drain = -> callback(null, passed)
|
packageSpecQueue.drain = -> callback(null, passed)
|
||||||
|
|
||||||
runCoreSpecs = (callback) ->
|
runCoreSpecs = (callback) ->
|
||||||
contentsDir = grunt.config.get('atom.contentsDir')
|
contentsDir = grunt.config.get('atom.contentsDir')
|
||||||
@ -46,6 +48,7 @@ module.exports = (grunt) ->
|
|||||||
cmd: appPath
|
cmd: appPath
|
||||||
args: ['--test', "--resource-path=#{resourcePath}", "--spec-directory=#{coreSpecsPath}"]
|
args: ['--test', "--resource-path=#{resourcePath}", "--spec-directory=#{coreSpecsPath}"]
|
||||||
spawn options, (error, results, code) ->
|
spawn options, (error, results, code) ->
|
||||||
|
packageSpecQueue.concurrency = 2
|
||||||
callback(null, code is 0)
|
callback(null, code is 0)
|
||||||
|
|
||||||
grunt.registerTask 'run-specs', 'Run the specs', ->
|
grunt.registerTask 'run-specs', 'Run the specs', ->
|
||||||
|
Loading…
Reference in New Issue
Block a user