Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use .zuulrc credentials for Sauce Labs tests #619

Merged
merged 6 commits into from Feb 19, 2016

bin/test.js: npmRun() exits process if no callback

  • Loading branch information
josephfrazier committed Feb 15, 2016
commit 89b6d15096d43dd6a37a713de3c3d76ea56dc8d8
@@ -11,20 +11,18 @@ var zuulrcPath = findNearestFile('.zuulrc') || path.join(userHome, '.zuulrc')
var hasSauceLabEnvVars = process.env.SAUCE_USERNAME && process.env.SAUCE_ACCESS_KEY
var runSauceLabs = hasSauceLabEnvVars || pathExists.sync(zuulrcPath)

npmRun('test-node', function (code) {
npmRun('test-browser-headless', function (code) {
npmRun('test-node', function () {
npmRun('test-browser-headless', function () {
if (runSauceLabs) {
npmRun('test-browser', process.exit)
} else {
process.exit(code)
npmRun('test-browser')
}
})
})

function npmRun (scriptName, onClose) {
function npmRun (scriptName, onSuccess) {
spawn('npm', ['run', scriptName], { stdio: 'inherit' }).on('close', function (code) {
if (code === 0) {
onClose(code)
if (code === 0 && onSuccess) {
onSuccess(code)
} else {
process.exit(code)
}
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.