test invert option (#20649)

This commit is contained in:
Alan Ren
2022-09-22 18:19:00 -07:00
committed by GitHub
parent 37636012da
commit 508df59dfd

View File

@@ -33,8 +33,6 @@ if (process.env.BUILD_ARTIFACTSTAGINGDIRECTORY) {
};
}
const mocha = new Mocha(options);
// {{SQL CARBON EDIT}} - If grep option is specified, only run the matching test cases (local test case development/debug scenario),
// otherwise the value of 'RUN_UNSTABLE_TESTS' environment variable will be used to determine whether to run the stable test cases or the whole test suite.
// Unstable test cases have "@UNSTABLE@" in their full name (test suite name + test name).
@@ -43,12 +41,15 @@ if (!options.grep) {
console.info('running all test cases.');
} else {
console.info('running stable test cases.');
mocha.grep('@UNSTABLE@').invert();
options.grep= '@UNSTABLE@';
options.invert = true;
}
} else {
console.info('running test cases match the grep option.');
}
// {{SQL CARBON EDIT}} - end of edit.
const mocha = new Mocha(options);
mocha.addFile('out/main.js');
mocha.run(failures => process.exit(failures ? -1 : 0));