Get core specs ready to run in parallel w/ package specs

This commit is contained in:
Nathan Sobo 2016-07-29 12:00:34 -06:00
parent c47c380ff8
commit 3d71112d75
2 changed files with 18 additions and 3 deletions

View File

@ -2,6 +2,7 @@
"name": "atom-build-scripts",
"description": "Atom build scripts",
"dependencies": {
"async": "^2.0.1",
"babel-core": "5.8.38",
"coffee-script": "1.8.0",
"colors": "1.1.2",

View File

@ -2,6 +2,7 @@
'use strict'
const async = require('async')
require('colors')
const path = require('path')
@ -18,6 +19,19 @@ const testArguments = [
'--test', testPath
]
console.log('Executing core specs...'.bold.green)
const exitStatus = childProcess.spawnSync(executablePath, testArguments, {stdio: 'inherit'}).status
process.exit(exitStatus)
function runCoreSpecs (callback) {
console.log('Executing core specs...'.bold.green)
const cp = childProcess.spawn(executablePath, testArguments, {stdio: 'inherit'})
cp.on('error', error => { callback(error) })
cp.on('close', exitCode => { callback(null, exitCode) })
}
async.parallelLimit([runCoreSpecs], 2, function (err, exitCodes) {
if (err) {
console.error(err)
process.exit(1)
} else {
const testsPassed = exitCodes.every(exitCode => exitCode === 0)
process.exit(testsPassed ? 0 : 1)
}
})