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

Add Repeat and Retry functionality to sigh test #2590

Merged
merged 5 commits into from
Jan 29, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 31 additions & 14 deletions tools/sigh.js
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,7 @@ function test(args) {
explore: ['explore'],
exceptions: ['exceptions'],
boolean: ['manual', 'all'],
repeat: ['repeat'],
alias: {g: 'grep'},
});

Expand Down Expand Up @@ -581,20 +582,36 @@ function test(args) {
}

const runner = buildTestRunner();
return saneSpawn(
'node',
[
'--experimental-modules',
'--trace-warnings',
'--no-deprecation',
...extraFlags,
'--loader',
fixPathForWindows(path.join(__dirname, 'custom-loader.mjs')),
'-r',
'source-map-support/register.js',
runner
],
{stdio: 'inherit'});
// Spawn processes as needed to repeat tests specified by 'repeat' flag.
const repeatCount = parseInt(JSON.stringify(options.repeat || 1));
const testResults = [];
const failedRuns = [];
for (let i = 1; i < repeatCount + 1; i++) {
console.log('RUN %s STARTING [%s]:', i, (new Date).toLocaleTimeString());
const testResult = saneSpawn(
'node',
[
'--experimental-modules',
'--trace-warnings',
'--no-deprecation',
...extraFlags,
'--loader',
fixPathForWindows(path.join(__dirname, 'custom-loader.mjs')),
'-r',
'source-map-support/register.js',
runner
],
{stdio: 'inherit'});
if (testResult === false) {
failedRuns.push(i);
}
testResults.push(testResult);
}
console.log('%s runs completed. %s runs failed.', repeatCount, failedRuns.length);
if (failedRuns.length > 0) {
console.log('Failed runs: ', failedRuns);
}
return testResults;
}

async function importSpotify(args) {
Expand Down