add --quiet flag to test runner
This commit is contained in:
parent
5df7ddba97
commit
a7c1f7d012
@ -886,11 +886,15 @@ testCli
|
|||||||
.flag("dryRun", ["--dry"], {
|
.flag("dryRun", ["--dry"], {
|
||||||
help: "Only print tests that will be selected to run.",
|
help: "Only print tests that will be selected to run.",
|
||||||
})
|
})
|
||||||
|
.flag("quiet", ["--quiet"], {
|
||||||
|
help: "Produce less output.",
|
||||||
|
})
|
||||||
.action(async (args) => {
|
.action(async (args) => {
|
||||||
await runTests({
|
await runTests({
|
||||||
includePattern: args.runIntegrationtests.pattern,
|
includePattern: args.runIntegrationtests.pattern,
|
||||||
suiteSpec: args.runIntegrationtests.suites,
|
suiteSpec: args.runIntegrationtests.suites,
|
||||||
dryRun: args.runIntegrationtests.dryRun,
|
dryRun: args.runIntegrationtests.dryRun,
|
||||||
|
verbosity: args.runIntegrationtests.quiet ? 0 : 1,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -138,6 +138,7 @@ export interface TestRunSpec {
|
|||||||
includePattern?: string;
|
includePattern?: string;
|
||||||
suiteSpec?: string;
|
suiteSpec?: string;
|
||||||
dryRun?: boolean;
|
dryRun?: boolean;
|
||||||
|
verbosity: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface TestInfo {
|
export interface TestInfo {
|
||||||
@ -244,8 +245,10 @@ export async function runTests(spec: TestRunSpec) {
|
|||||||
const harnessLogFilename = path.join(testRootDir, testName, "harness.log");
|
const harnessLogFilename = path.join(testRootDir, testName, "harness.log");
|
||||||
const harnessLogStream = fs.createWriteStream(harnessLogFilename);
|
const harnessLogStream = fs.createWriteStream(harnessLogFilename);
|
||||||
|
|
||||||
currentChild.stderr?.pipe(process.stderr);
|
if (spec.verbosity > 0) {
|
||||||
currentChild.stdout?.pipe(process.stdout);
|
currentChild.stderr?.pipe(process.stderr);
|
||||||
|
currentChild.stdout?.pipe(process.stdout);
|
||||||
|
}
|
||||||
|
|
||||||
currentChild.stdout?.pipe(harnessLogStream);
|
currentChild.stdout?.pipe(harnessLogStream);
|
||||||
currentChild.stderr?.pipe(harnessLogStream);
|
currentChild.stderr?.pipe(harnessLogStream);
|
||||||
|
Loading…
Reference in New Issue
Block a user