diff options
Diffstat (limited to 'test/smoke/src/main.ts')
-rw-r--r-- | test/smoke/src/main.ts | 48 |
1 files changed, 21 insertions, 27 deletions
diff --git a/test/smoke/src/main.ts b/test/smoke/src/main.ts index 39af65bfb0f..ece4fb9e303 100644 --- a/test/smoke/src/main.ts +++ b/test/smoke/src/main.ts @@ -45,7 +45,6 @@ const opts = minimist(args, { 'remote', 'web', 'headless', - 'legacy', 'tracing' ], default: { @@ -56,7 +55,6 @@ const opts = minimist(args, { remote?: boolean; headless?: boolean; web?: boolean; - legacy?: boolean; tracing?: boolean; build?: string; 'stable-build'?: string; @@ -64,16 +62,16 @@ const opts = minimist(args, { electronArgs?: string; }; -const logsPath = (() => { +const logsRootPath = (() => { const logsParentPath = path.join(rootPath, '.build', 'logs'); let logsName: string; if (opts.web) { logsName = 'smoke-tests-browser'; } else if (opts.remote) { - logsName = opts.legacy ? 'smoke-tests-remote-legacy' : 'smoke-tests-remote'; + logsName = 'smoke-tests-remote'; } else { - logsName = opts.legacy ? 'smoke-tests-electron-legacy' : 'smoke-tests-electron'; + logsName = 'smoke-tests-electron'; } return path.join(logsParentPath, logsName); @@ -89,12 +87,12 @@ function createLogger(): Logger { loggers.push(new ConsoleLogger()); } - // Prepare logs path - fs.rmSync(logsPath, { recursive: true, force: true, maxRetries: 3 }); - mkdirp.sync(logsPath); + // Prepare logs rot path + fs.rmSync(logsRootPath, { recursive: true, force: true, maxRetries: 3 }); + mkdirp.sync(logsRootPath); // Always log to log file - loggers.push(new FileLogger(path.join(logsPath, 'smoke-test-runner.log'))); + loggers.push(new FileLogger(path.join(logsRootPath, 'smoke-test-runner.log'))); return new MultiLogger(loggers); } @@ -109,7 +107,7 @@ const testDataPath = path.join(os.tmpdir(), 'vscsmoke'); if (fs.existsSync(testDataPath)) { rimraf.sync(testDataPath); } -fs.mkdirSync(testDataPath); +mkdirp.sync(testDataPath); process.once('exit', () => { try { rimraf.sync(testDataPath); @@ -220,18 +218,16 @@ async function setupRepository(): Promise<void> { } else { if (!fs.existsSync(workspacePath)) { logger.log('Cloning test project repository...'); - cp.spawnSync('git', ['clone', testRepoUrl, workspacePath]); + const res = cp.spawnSync('git', ['clone', testRepoUrl, workspacePath], { stdio: 'inherit' }); + if (!fs.existsSync(workspacePath)) { + throw new Error(`Clone operation failed: ${res.stderr.toString()}`); + } } else { logger.log('Cleaning test project repository...'); - cp.spawnSync('git', ['fetch'], { cwd: workspacePath }); - cp.spawnSync('git', ['reset', '--hard', 'FETCH_HEAD'], { cwd: workspacePath }); - cp.spawnSync('git', ['clean', '-xdf'], { cwd: workspacePath }); + cp.spawnSync('git', ['fetch'], { cwd: workspacePath, stdio: 'inherit' }); + cp.spawnSync('git', ['reset', '--hard', 'FETCH_HEAD'], { cwd: workspacePath, stdio: 'inherit' }); + cp.spawnSync('git', ['clean', '-xdf'], { cwd: workspacePath, stdio: 'inherit' }); } - - // None of the current smoke tests have a dependency on the packages. - // If new smoke tests are added that need the packages, uncomment this. - // logger.log('Running yarn...'); - // cp.execSync('yarn', { cwd: workspacePath, stdio: 'inherit' }); } } @@ -321,7 +317,7 @@ async function setup(): Promise<void> { logger.log('Smoketest setup done!\n'); } -// Before main suite (before all tests) +// Before all tests run setup before(async function () { this.timeout(5 * 60 * 1000); // increase since we download VSCode @@ -331,17 +327,15 @@ before(async function () { workspacePath, userDataDir, extensionsPath, - waitTime: parseInt(opts['wait-time'] || '0') || 20, logger, - logsPath, + logsPath: path.join(logsRootPath, 'suite_unknown'), verbose: opts.verbose, remote: opts.remote, web: opts.web, - legacy: opts.legacy, tracing: opts.tracing, headless: opts.headless, browser: opts.browser, - extraArgs: (opts.electronArgs || '').split(' ').map(a => a.trim()).filter(a => !!a) + extraArgs: (opts.electronArgs || '').split(' ').map(arg => arg.trim()).filter(arg => !!arg) }; await setup(); @@ -371,16 +365,16 @@ after(async function () { } }); -describe(`VSCode Smoke Tests (${opts.web ? 'Web' : opts.legacy ? 'Electron (legacy)' : 'Electron'})`, () => { +describe(`VSCode Smoke Tests (${opts.web ? 'Web' : 'Electron'})`, () => { if (!opts.web) { setupDataLossTests(() => opts['stable-build'] /* Do not change, deferred for a reason! */, logger); } setupPreferencesTests(logger); setupSearchTests(logger); setupNotebookTests(logger); setupLanguagesTests(logger); - setupTerminalTests(logger); + if (opts.web) { setupTerminalTests(logger); } // Tests require playwright driver (https://github.com/microsoft/vscode/issues/146811) setupStatusbarTests(logger); if (quality !== Quality.Dev) { setupExtensionTests(logger); } - if (!opts.web) { setupMultirootTests(logger); } + setupMultirootTests(logger); if (!opts.web && !opts.remote && quality !== Quality.Dev) { setupLocalizationTests(logger); } if (!opts.web && !opts.remote) { setupLaunchTests(logger); } }); |