increase test timeout
This commit is contained in:
parent
2a909fadfc
commit
e75789f041
1 changed files with 30 additions and 15 deletions
|
@ -1,25 +1,40 @@
|
||||||
const fs = require('fs')
|
const fs = require('fs')
|
||||||
const path = require('path');
|
const path = require('path')
|
||||||
const spawn = require('child_process').spawn
|
const spawn = require('child_process').spawn
|
||||||
|
|
||||||
const projectRoot = path.normalize(path.join(__dirname, '..'));
|
const projectRoot = path.normalize(path.join(__dirname, '..'))
|
||||||
const outputLog = path.join(projectRoot, '.test-failures.log');
|
const outputLog = path.join(projectRoot, '.test-failures.log')
|
||||||
const collectorScript = path.join(projectRoot, 'scripts', 'test-failure-collector.js');
|
const collectorScript = path.join(projectRoot, 'scripts', 'test-failure-collector.js')
|
||||||
|
|
||||||
// Start with a fresh output log on each run.
|
// Start with a fresh output log on each run.
|
||||||
if (fs.existsSync(outputLog)) {
|
if (fs.existsSync(outputLog)) {
|
||||||
fs.unlinkSync(outputLog);
|
fs.unlinkSync(outputLog)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Run all tests, specifying the collector script.
|
// Run all tests, specifying the collector script.
|
||||||
spawn('lerna', ['run', '--no-bail', 'testci', '--stream', '--parallel', '--loglevel', 'error', '--', '--file', `${collectorScript}`, '--no-warnings'], { stdio: 'inherit' })
|
spawn(
|
||||||
.on('exit', function(code) {
|
'lerna',
|
||||||
// If a failure occurred, the log file will have been created. Print it.
|
[
|
||||||
if (fs.existsSync(outputLog)) {
|
'run',
|
||||||
console.error(fs.readFileSync(outputLog, 'utf8').trim());
|
'--no-bail',
|
||||||
}
|
'testci',
|
||||||
|
'--stream',
|
||||||
// Propagate the exit code.
|
'--parallel',
|
||||||
process.exit(code);
|
'--loglevel',
|
||||||
});
|
'error',
|
||||||
|
'--',
|
||||||
|
'--file',
|
||||||
|
`${collectorScript}`,
|
||||||
|
'--no-warnings',
|
||||||
|
'--timeout=5000',
|
||||||
|
],
|
||||||
|
{ stdio: 'inherit' }
|
||||||
|
).on('exit', function (code) {
|
||||||
|
// If a failure occurred, the log file will have been created. Print it.
|
||||||
|
if (fs.existsSync(outputLog)) {
|
||||||
|
console.error(fs.readFileSync(outputLog, 'utf8').trim())
|
||||||
|
}
|
||||||
|
|
||||||
|
// Propagate the exit code.
|
||||||
|
process.exit(code)
|
||||||
|
})
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue