chore: hide watch mode, it is not ready (#20905)

This commit is contained in:
Pavel Feldman 2023-02-14 13:22:44 -08:00 committed by GitHub
parent 798696a18a
commit 7f0763d789
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 4 deletions

View File

@ -60,7 +60,6 @@ function addTestCommand(program: Command) {
command.option('--project <project-name...>', `Only run tests from the specified list of projects (default: run all projects)`); command.option('--project <project-name...>', `Only run tests from the specified list of projects (default: run all projects)`);
command.option('--timeout <timeout>', `Specify test timeout threshold in milliseconds, zero for unlimited (default: ${defaultTimeout})`); command.option('--timeout <timeout>', `Specify test timeout threshold in milliseconds, zero for unlimited (default: ${defaultTimeout})`);
command.option('--trace <mode>', `Force tracing mode, can be ${kTraceModes.map(mode => `"${mode}"`).join(', ')}`); command.option('--trace <mode>', `Force tracing mode, can be ${kTraceModes.map(mode => `"${mode}"`).join(', ')}`);
command.option('--watch', `Run watch mode`);
command.option('-u, --update-snapshots', `Update snapshots with actual results (default: only create missing snapshots)`); command.option('-u, --update-snapshots', `Update snapshots with actual results (default: only create missing snapshots)`);
command.option('-x', `Stop after the first failure`); command.option('-x', `Stop after the first failure`);
command.action(async (args, opts) => { command.action(async (args, opts) => {
@ -167,7 +166,7 @@ async function runTests(args: string[], opts: { [key: string]: any }) {
config._internal.passWithNoTests = !!opts.passWithNoTests; config._internal.passWithNoTests = !!opts.passWithNoTests;
const runner = new Runner(config); const runner = new Runner(config);
const status = opts.watch ? await runner.watchAllTests() : await runner.runAllTests(); const status = process.env.PWTEST_WATCH ? await runner.watchAllTests() : await runner.runAllTests();
await stopProfiling(undefined); await stopProfiling(undefined);
if (status === 'interrupted') if (status === 'interrupted')
process.exit(130); process.exit(130);

View File

@ -195,7 +195,6 @@ function watchPlaywrightTest(childProcess: CommonFixtures['childProcess'], baseD
const outputDir = path.join(baseDir, 'test-results'); const outputDir = path.join(baseDir, 'test-results');
const args = ['test']; const args = ['test'];
args.push('--output=' + outputDir); args.push('--output=' + outputDir);
args.push('--watch');
args.push('--workers=2', ...paramList); args.push('--workers=2', ...paramList);
if (options.additionalArgs) if (options.additionalArgs)
args.push(...options.additionalArgs); args.push(...options.additionalArgs);
@ -205,7 +204,7 @@ function watchPlaywrightTest(childProcess: CommonFixtures['childProcess'], baseD
command.push(...args); command.push(...args);
const testProcess = childProcess({ const testProcess = childProcess({
command, command,
env: cleanEnv(env), env: cleanEnv({ PWTEST_WATCH: '1', ...env }),
cwd, cwd,
}); });
return testProcess; return testProcess;