Skip to content

Commit a1dab28

Browse files
committed
print the used testCommand for failed tests
1 parent d56fef6 commit a1dab28

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

script/test

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ function runCoreMainProcessTests (callback) {
9494
console.log('##[command] Executing core main process tests'.bold.green)
9595
const cp = childProcess.spawn(executablePath, testArguments, {stdio: 'inherit', env: testEnv})
9696
cp.on('error', error => { callback(error) })
97-
cp.on('close', exitCode => { callback(null, {exitCode, step: 'core-main-process'}) })
97+
cp.on('close', exitCode => { callback(null, {exitCode, step: 'core-main-process', testCommand: `You can run the test again using: \n\t ${executablePath} ${testArguments.join(' ')}`}) })
9898
}
9999

100100
// Build an array of functions, each running tests for a different rendering test
@@ -112,7 +112,7 @@ for (let testFile of testFiles) {
112112
]
113113
const cp = childProcess.spawn(executablePath, testArguments, {stdio: 'inherit', env: testEnv})
114114
cp.on('error', error => { callback(error) })
115-
cp.on('close', exitCode => { callback(null, {exitCode, step: `core-render-process for ${testFile}`}) })
115+
cp.on('close', exitCode => { callback(null, {exitCode, step: `core-render-process for ${testFile}.`, testCommand: `You can run the test again using: \n\t ${executablePath} ${testArguments.join(' ')}`}) })
116116
})
117117
}
118118

@@ -173,7 +173,7 @@ for (let packageName in CONFIG.appMetadata.packageDependencies) {
173173
console.log(stderrOutput)
174174
}
175175
finalize()
176-
callback(null, {exitCode, step: `package-${packageName}`})
176+
callback(null, {exitCode, step: `package-${packageName}.`, testCommand: `You can run the test again using: \n\t ${executablePath} ${testArguments.join(' ')}`})
177177
})
178178
})
179179
}
@@ -186,7 +186,7 @@ function runBenchmarkTests (callback) {
186186
console.log('##[command] Executing benchmark tests'.bold.green)
187187
const cp = childProcess.spawn(executablePath, testArguments, {stdio: 'inherit', env: testEnv})
188188
cp.on('error', error => { callback(error) })
189-
cp.on('close', exitCode => { callback(null, {exitCode, step: 'core-benchmarks'}) })
189+
cp.on('close', exitCode => { callback(null, {exitCode, step: 'core-benchmarks', testCommand: `You can run the test again using: \n\t ${executablePath} ${testArguments.join(' ')}`}) })
190190
}
191191

192192
let testSuitesToRun = requestedTestSuites(process.platform)
@@ -278,8 +278,8 @@ async.parallel(testSuitesToRun, function (err, results) {
278278

279279
if (failedSteps.length > 0) {
280280
console.warn("##[error] \n \n *** Reporting the errors that happened in all of the tests: *** \n \n")
281-
for (const {step} of failedSteps) {
282-
console.error(`##[error] The '${step}' test step finished with a non-zero exit code`)
281+
for (const {step, testCommand} of failedSteps) {
282+
console.error(`##[error] The '${step}' test step finished with a non-zero exit code \n ${testCommand}`)
283283
}
284284
process.exit(1)
285285
}

0 commit comments

Comments
 (0)