Vscode merge (#4582)

* Merge from vscode 37cb23d3dd4f9433d56d4ba5ea3203580719a0bd

* fix issues with merges

* bump node version in azpipe

* replace license headers

* remove duplicate launch task

* fix build errors

* fix build errors

* fix tslint issues

* working through package and linux build issues

* more work

* wip

* fix packaged builds

* working through linux build errors

* wip

* wip

* wip

* fix mac and linux file limits

* iterate linux pipeline

* disable editor typing

* revert series to parallel

* remove optimize vscode from linux

* fix linting issues

* revert testing change

* add work round for new node

* readd packaging for extensions

* fix issue with angular not resolving decorator dependencies
This commit is contained in:
Anthony Dresser
2019-03-19 17:44:35 -07:00
committed by GitHub
parent 833d197412
commit 87765e8673
1879 changed files with 54505 additions and 38058 deletions

View File

@@ -1,5 +1,7 @@
# VS Code Smoke Test
Make sure you are on **Node v10.x**.
### Run
```bash
@@ -7,7 +9,7 @@
yarn smoketest
# Build
yarn smoketest --build PATH_TO_BUILD
yarn smoketest --build PATH_TO_BUILD --stable-build PATH_TO_STABLE_BUILD
```
### Run for a release
@@ -17,7 +19,7 @@ You must always run the smoketest version which matches the release you are test
```bash
git checkout release/1.22
yarn
yarn smoketest --build PATH_TO_RELEASE_BUILD
yarn smoketest --build PATH_TO_RELEASE_BUILD --stable-build PATH_TO_STABLE_BUILD
```
### Debug

View File

@@ -22,7 +22,7 @@
"@types/webdriverio": "4.6.1",
"concurrently": "^3.5.1",
"cpx": "^1.5.0",
"electron": "3.1.2",
"electron": "3.1.6",
"htmlparser2": "^3.9.2",
"mkdirp": "^0.5.1",
"mocha": "^5.2.0",

View File

@@ -60,7 +60,7 @@ export class Application {
return this.options.userDataDir;
}
async start(): Promise<any> {
async start(expectWalkthroughPart = true): Promise<any> {
await this._start();
//{{SQL CARBON EDIT}}
await this.code.waitForElement('.object-explorer-view');
@@ -68,9 +68,12 @@ export class Application {
//Original
/*
await this.code.waitForElement('.explorer-folders-view');
await this.code.waitForActiveElement(`.editor-instance[id="workbench.editor.walkThroughPart"] > div > div[tabIndex="0"]`);
*/
//{{END}}
if (expectWalkthroughPart) {
await this.code.waitForActiveElement(`.editor-instance[id="workbench.editor.walkThroughPart"] > div > div[tabIndex="0"]`);
}
*/
//{{SQL CARBON EDIT}}
}
async restart(options: { workspaceOrFolder?: string, extraArgs?: string[] }): Promise<any> {

View File

@@ -27,13 +27,13 @@ export function setup() {
await app.workbench.editor.waitForTypeInEditor('app.js', '.foo{}');
await app.workbench.editors.saveOpenedFile();
await app.workbench.quickopen.openFile('index.jade');
await app.workbench.editor.waitForTypeInEditor('index.jade', 'hello world');
await app.workbench.quickopen.openFile('index.pug');
await app.workbench.editor.waitForTypeInEditor('index.pug', 'hello world');
await app.workbench.editors.saveOpenedFile();
await app.workbench.scm.refreshSCMViewlet();
await app.workbench.scm.waitForChange('app.js', 'Modified');
await app.workbench.scm.waitForChange('index.jade', 'Modified');
await app.workbench.scm.waitForChange('index.pug', 'Modified');
});
it('opens diff editor', async function () {
@@ -66,7 +66,7 @@ export function setup() {
await app.code.waitForTextContent(SYNC_STATUSBAR, ' 0↓ 1↑');
await app.workbench.quickopen.runCommand('Git: Stage All Changes');
await app.workbench.scm.waitForChange('index.jade', 'Index Modified');
await app.workbench.scm.waitForChange('index.pug', 'Index Modified');
await app.workbench.scm.commit('second commit');
await app.code.waitForTextContent(SYNC_STATUSBAR, ' 0↓ 2↑');

View File

@@ -19,7 +19,7 @@ export function setup() {
await app.workbench.search.openSearchViewlet();
await app.workbench.search.searchFor('body');
await app.workbench.search.waitForResultText('21 results in 6 files');
await app.workbench.search.waitForResultText('16 results in 5 files');
});
it('searches only for *.js files & checks for correct result number', async function () {
@@ -38,7 +38,7 @@ export function setup() {
const app = this.app as Application;
await app.workbench.search.searchFor('body');
await app.workbench.search.removeFileMatch('app.js');
await app.workbench.search.waitForResultText('17 results in 5 files');
await app.workbench.search.waitForResultText('12 results in 4 files');
});
it('replaces first search result with a replace term', async function () {
@@ -48,7 +48,7 @@ export function setup() {
await app.workbench.search.expandReplace();
await app.workbench.search.setReplaceText('ydob');
await app.workbench.search.replaceFileMatch('app.js');
await app.workbench.search.waitForResultText('17 results in 5 files');
await app.workbench.search.waitForResultText('16 results in 5 files');
await app.workbench.search.searchFor('ydob');
await app.workbench.search.setReplaceText('body');

View File

@@ -6,7 +6,7 @@
import { Viewlet } from '../workbench/viewlet';
import { Code } from '../../vscode/code';
const VIEWLET = 'div[id="workbench.view.search"].search-view';
const VIEWLET = '.search-view';
const INPUT = `${VIEWLET} .search-widget .search-container .monaco-inputbox textarea`;
const INCLUDE_INPUT = `${VIEWLET} .query-details .file-types.includes .monaco-inputbox input`;
const FILE_MATCH = filename => `${VIEWLET} .results .filematch[data-resource$="${filename}"]`;

View File

@@ -3,109 +3,93 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { Application, Quality } from '../../application';
import * as rimraf from 'rimraf';
import { Application, ApplicationOptions } from '../../application';
import { join } from 'path';
export interface ICreateAppFn {
(quality: Quality): Application;
}
export function setup(stableCodePath: string, testDataPath: string) {
export function setup(userDataDir: string, createApp: ICreateAppFn) {
describe('Data Migration', () => {
describe('Data Migration: This test MUST run before releasing by providing the --stable-build command line argument', () => {
it(`verifies opened editors are restored`, async function () {
if (!stableCodePath) {
this.skip();
}
afterEach(async function () {
await new Promise((c, e) => rimraf(userDataDir, { maxBusyTries: 10 }, err => err ? e(err) : c()));
const userDataDir = join(testDataPath, 'd2'); // different data dir from the other tests
const stableOptions: ApplicationOptions = Object.assign({}, this.defaultOptions);
stableOptions.codePath = stableCodePath;
stableOptions.userDataDir = userDataDir;
const stableApp = new Application(stableOptions);
await stableApp!.start();
// Open 3 editors and pin 2 of them
await stableApp.workbench.quickopen.openFile('www');
await stableApp.workbench.quickopen.runCommand('View: Keep Editor');
await stableApp.workbench.quickopen.openFile('app.js');
await stableApp.workbench.quickopen.runCommand('View: Keep Editor');
await stableApp.workbench.editors.newUntitledFile();
await stableApp.stop();
const insiderOptions: ApplicationOptions = Object.assign({}, this.defaultOptions);
insiderOptions.userDataDir = userDataDir;
const insidersApp = new Application(insiderOptions);
await insidersApp!.start(false /* not expecting walkthrough parth */);
// Verify 3 editors are open
await insidersApp.workbench.editors.waitForEditorFocus('Untitled-1');
await insidersApp.workbench.editors.selectTab('app.js');
await insidersApp.workbench.editors.selectTab('www');
await insidersApp.stop();
});
// it('checks if the Untitled file is restored migrating from stable to latest', async function () {
// const stableApp = createApp(Quality.Stable);
it(`verifies that 'hot exit' works for dirty files`, async function () {
if (!stableCodePath) {
this.skip();
}
// if (!stableApp) {
// this.skip();
// return;
// }
const userDataDir = join(testDataPath, 'd3'); // different data dir from the other tests
// await stableApp.start();
const stableOptions: ApplicationOptions = Object.assign({}, this.defaultOptions);
stableOptions.codePath = stableCodePath;
stableOptions.userDataDir = userDataDir;
// const textToType = 'Very dirty file';
const stableApp = new Application(stableOptions);
await stableApp!.start();
// await stableApp.workbench.editors.newUntitledFile();
// await stableApp.workbench.editor.waitForTypeInEditor('Untitled-1', textToType);
await stableApp.workbench.editors.newUntitledFile();
// await stableApp.stop();
// await new Promise(c => setTimeout(c, 500)); // wait until all resources are released (e.g. locked local storage)
const untitled = 'Untitled-1';
const textToTypeInUntitled = 'Hello, Unitled Code';
await stableApp.workbench.editor.waitForTypeInEditor(untitled, textToTypeInUntitled);
// // Checking latest version for the restored state
// const app = createApp(Quality.Insiders);
const readmeMd = 'readme.md';
const textToType = 'Hello, Code';
await stableApp.workbench.quickopen.openFile(readmeMd);
await stableApp.workbench.editor.waitForTypeInEditor(readmeMd, textToType);
// await app.start(false);
await stableApp.stop();
// await app.workbench.editors.waitForActiveTab('Untitled-1', true);
// await app.workbench.editor.waitForEditorContents('Untitled-1', c => c.indexOf(textToType) > -1);
const insiderOptions: ApplicationOptions = Object.assign({}, this.defaultOptions);
insiderOptions.userDataDir = userDataDir;
// await app.stop();
// });
const insidersApp = new Application(insiderOptions);
await insidersApp!.start(false /* not expecting walkthrough parth */);
// it('checks if the newly created dirty file is restored migrating from stable to latest', async function () {
// const stableApp = createApp(Quality.Stable);
await insidersApp.workbench.editors.waitForActiveTab(readmeMd, true);
await insidersApp.workbench.editor.waitForEditorContents(readmeMd, c => c.indexOf(textToType) > -1);
// if (!stableApp) {
// this.skip();
// return;
// }
await insidersApp.workbench.editors.waitForTab(untitled, true);
await insidersApp.workbench.editors.selectTab(untitled, true);
await insidersApp.workbench.editor.waitForEditorContents(untitled, c => c.indexOf(textToTypeInUntitled) > -1);
// await stableApp.start();
// const fileName = 'app.js';
// const textPart = 'This is going to be an unsaved file';
// await stableApp.workbench.quickopen.openFile(fileName);
// await stableApp.workbench.editor.waitForTypeInEditor(fileName, textPart);
// await stableApp.stop();
// await new Promise(c => setTimeout(c, 500)); // wait until all resources are released (e.g. locked local storage)
// // Checking latest version for the restored state
// const app = createApp(Quality.Insiders);
// await app.start(false);
// await app.workbench.editors.waitForActiveTab(fileName);
// await app.workbench.editor.waitForEditorContents(fileName, c => c.indexOf(textPart) > -1);
// await app.stop();
// });
// it('checks if opened tabs are restored migrating from stable to latest', async function () {
// const stableApp = createApp(Quality.Stable);
// if (!stableApp) {
// this.skip();
// return;
// }
// await stableApp.start();
// const fileName1 = 'app.js', fileName2 = 'jsconfig.json', fileName3 = 'readme.md';
// await stableApp.workbench.quickopen.openFile(fileName1);
// await stableApp.workbench.runCommand('View: Keep Editor');
// await stableApp.workbench.quickopen.openFile(fileName2);
// await stableApp.workbench.runCommand('View: Keep Editor');
// await stableApp.workbench.quickopen.openFile(fileName3);
// await stableApp.stop();
// const app = createApp(Quality.Insiders);
// await app.start(false);
// await app.workbench.editors.waitForTab(fileName1);
// await app.workbench.editors.waitForTab(fileName2);
// await app.workbench.editors.waitForTab(fileName3);
// await app.stop();
// });
await insidersApp.stop();
});
});
}

View File

@@ -12,11 +12,12 @@ import * as rimraf from 'rimraf';
import * as mkdirp from 'mkdirp';
import { ncp } from 'ncp';
import { Application, Quality, ApplicationOptions } from './application';
//{{SQL CARBON EDIT}}
import { setup as runProfilerTests } from './sql/profiler/profiler.test';
//Original
/*
// import { setup as setupDataMigrationTests } from './areas/workbench/data-migration.test';
import { setup as setupDataMigrationTests } from './areas/workbench/data-migration.test';
import { setup as setupDataLossTests } from './areas/workbench/data-loss.test';
import { setup as setupDataExplorerTests } from './areas/explorer/explorer.test';
import { setup as setupDataPreferencesTests } from './areas/preferences/preferences.test';
@@ -35,6 +36,11 @@ import { setup as setupLaunchTests } from './areas/workbench/launch.test';
//{{END}}
import { MultiLogger, Logger, ConsoleLogger, FileLogger } from './logger';
if (!/^v10/.test(process.version)) {
console.error('Error: Smoketest must be run using Node 10. Currently running', process.version);
process.exit(1);
}
const tmpDir = tmp.dirSync({ prefix: 't' }) as { name: string; removeCallback: Function; };
const testDataPath = tmpDir.name;
process.once('exit', () => rimraf.sync(testDataPath));
@@ -113,16 +119,16 @@ function getBuildElectronPath(root: string): string {
}
let testCodePath = opts.build;
// let stableCodePath = opts['stable-build'];
let stableCodePath = opts['stable-build'];
let electronPath: string;
// let stablePath: string;
let stablePath: string | undefined = undefined;
if (testCodePath) {
electronPath = getBuildElectronPath(testCodePath);
// if (stableCodePath) {
// stablePath = getBuildElectronPath(stableCodePath);
// }
if (stableCodePath) {
stablePath = getBuildElectronPath(stableCodePath);
}
} else {
testCodePath = getDevElectronPath();
electronPath = testCodePath;
@@ -135,6 +141,10 @@ if (!fs.existsSync(electronPath || '')) {
fail(`Can't find Code at ${electronPath}.`);
}
if (typeof stablePath === 'string' && !fs.existsSync(stablePath)) {
fail(`Can't find Stable Code at ${stablePath}.`);
}
const userDataDir = path.join(testDataPath, 'd');
let quality: Quality;
@@ -223,10 +233,6 @@ after(async function () {
await new Promise((c, e) => rimraf(testDataPath, { maxBusyTries: 10 }, err => err ? e(err) : c()));
});
// describe('Data Migration', () => {
// setupDataMigrationTests(userDataDir, createApp);
// });
describe('Running Code', () => {
before(async function () {
const app = new Application(this.defaultOptions);
@@ -295,4 +301,4 @@ describe('Running Code', () => {
});
// {{SQL CARBON EDIT}}
// setupLaunchTests();
// setupLaunchTests();

View File

@@ -596,10 +596,10 @@ electron-download@^4.1.0:
semver "^5.4.1"
sumchecker "^2.0.2"
electron@3.1.2:
version "3.1.2"
resolved "https://registry.yarnpkg.com/electron/-/electron-3.1.2.tgz#e410b976c56fc2f783c3b0fb6d757e02eaeab902"
integrity sha512-B/mXRCN8jGBBx8dvtIgLyW+nE8i9y7K9G6wijU+cLoneqF5al9BgZA1l5xgZEiUrwTtt0cgXIWNwhStt7EDoQQ==
electron@3.1.6:
version "3.1.6"
resolved "https://registry.yarnpkg.com/electron/-/electron-3.1.6.tgz#f6222e1964838b31c5806dd041b1b58a941998f6"
integrity sha512-elEKKlFMnR0bhR/Uttk0TI496ZadxYsecyKgj2tZgrWx/F/anzfxbEYNcv134vT+qMFC/BXvoaeaIIj2YYdVuA==
dependencies:
"@types/node" "^8.0.24"
electron-download "^4.1.0"