smoke - bring back stable smoke tests

This commit is contained in:
Benjamin Pasero 2021-12-09 11:05:41 +01:00
parent 27e38a8e27
commit 9c7387bb5a
No known key found for this signature in database
GPG Key ID: E6380CC4C8219E65
2 changed files with 11 additions and 10 deletions

View File

@ -6,7 +6,7 @@
import { Application, ApplicationOptions, Logger, Quality } from '../../../../automation';
import { getRandomUserDataDir, startApp, timeout, installDiagnosticsHandler, installAppAfterHandler } from '../../utils';
export function setup(stableCodePath: string | undefined, isRemote: boolean, logger: Logger) {
export function setup(ensureStableCode: () => string | undefined, logger: Logger) {
describe('Data Loss (insiders -> insiders)', () => {
let app: Application | undefined = undefined;
@ -103,7 +103,8 @@ export function setup(stableCodePath: string | undefined, isRemote: boolean, log
installAppAfterHandler(() => insidersApp ?? stableApp, async () => stableApp?.stop());
it('verifies opened editors are restored', async function () {
if (!stableCodePath || isRemote) {
const stableCodePath = ensureStableCode();
if (!stableCodePath) {
this.skip();
}
@ -160,7 +161,8 @@ export function setup(stableCodePath: string | undefined, isRemote: boolean, log
});
async function testHotExit(restartDelay: number | undefined) {
if (!stableCodePath || isRemote) {
const stableCodePath = ensureStableCode();
if (!stableCodePath) {
this.skip();
}

View File

@ -256,10 +256,6 @@ async function setupRepository(): Promise<void> {
}
async function ensureStableCode(): Promise<void> {
if (opts.web || !opts['build']) {
return;
}
let stableCodePath = opts['stable-build'];
if (!stableCodePath) {
const { major, minor } = parseVersion(version!);
@ -304,10 +300,13 @@ async function ensureStableCode(): Promise<void> {
}
async function setup(): Promise<void> {
logger.log('Test data:', testDataPath);
logger.log('Test data path:', testDataPath);
logger.log('Preparing smoketest setup...');
await measureAndLog(ensureStableCode(), 'ensureStableCode', logger);
if (!opts.web && !opts.remote && opts.build) {
// only enabled when running with --build and not in web or remote
await measureAndLog(ensureStableCode(), 'ensureStableCode', logger);
}
await measureAndLog(setupRepository(), 'setupRepository', logger);
logger.log('Smoketest setup done!\n');
@ -370,7 +369,7 @@ after(async function () {
});
describe(`VSCode Smoke Tests (${opts.web ? 'Web' : 'Electron'})`, () => {
if (!opts.web) { setupDataLossTests(opts['stable-build'], !!opts.remote, logger); }
if (!opts.web) { setupDataLossTests(() => opts['stable-build'] /* Do not change, deferred for a reason! */, logger); }
if (!opts.web) { setupPreferencesTests(logger); }
setupSearchTests(logger);
setupNotebookTests(logger);