From 1f5dc6a5729795f80b92f6de5a76d78462640662 Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Wed, 15 Jun 2022 06:59:40 -0700 Subject: [PATCH 1/9] Run shell integration tests 100 times in CI Part of #150478 --- .../terminal-shellIntegration.test.ts | 59 ++++++++++--------- 1 file changed, 30 insertions(+), 29 deletions(-) diff --git a/test/smoke/src/areas/terminal/terminal-shellIntegration.test.ts b/test/smoke/src/areas/terminal/terminal-shellIntegration.test.ts index 47d624633f2..0bc30da5b58 100644 --- a/test/smoke/src/areas/terminal/terminal-shellIntegration.test.ts +++ b/test/smoke/src/areas/terminal/terminal-shellIntegration.test.ts @@ -28,38 +28,39 @@ export function setup() { await terminal.runCommandWithValue(TerminalCommandIdWithValue.NewWithProfile, process.platform === 'win32' ? 'PowerShell' : 'bash'); } - // TODO: These are currently flaky https://github.com/microsoft/vscode/issues/150478 - describe.skip('Shell integration', function () { - describe('Decorations', function () { - describe('Should show default icons', function () { - it('Placeholder', async () => { - await createShellIntegrationProfile(); - await terminal.assertCommandDecorations({ placeholder: 1, success: 0, error: 0 }); + for (let i = 0; i < 100; i++) { + describe(`Shell integration ${i}`, function () { + describe('Decorations', function () { + describe('Should show default icons', function () { + it('Placeholder', async () => { + await createShellIntegrationProfile(); + await terminal.assertCommandDecorations({ placeholder: 1, success: 0, error: 0 }); + }); + it('Success', async () => { + await createShellIntegrationProfile(); + await terminal.runCommandInTerminal(`ls`); + await terminal.assertCommandDecorations({ placeholder: 1, success: 1, error: 0 }); + }); + it('Error', async () => { + await createShellIntegrationProfile(); + await terminal.runCommandInTerminal(`fsdkfsjdlfksjdkf`); + await terminal.assertCommandDecorations({ placeholder: 1, success: 0, error: 1 }); + }); }); - it('Success', async () => { - await createShellIntegrationProfile(); - await terminal.runCommandInTerminal(`ls`); - await terminal.assertCommandDecorations({ placeholder: 1, success: 1, error: 0 }); - }); - it('Error', async () => { - await createShellIntegrationProfile(); - await terminal.runCommandInTerminal(`fsdkfsjdlfksjdkf`); - await terminal.assertCommandDecorations({ placeholder: 1, success: 0, error: 1 }); - }); - }); - describe('Custom configuration', function () { - it('Should update and show custom icons', async () => { - await createShellIntegrationProfile(); - await terminal.assertCommandDecorations({ placeholder: 1, success: 0, error: 0 }); - await terminal.runCommandInTerminal(`ls`); - await terminal.runCommandInTerminal(`fsdkfsjdlfksjdkf`); - await settingsEditor.addUserSetting('terminal.integrated.shellIntegration.decorationIcon', '"zap"'); - await settingsEditor.addUserSetting('terminal.integrated.shellIntegration.decorationIconSuccess', '"zap"'); - await settingsEditor.addUserSetting('terminal.integrated.shellIntegration.decorationIconError', '"zap"'); - await terminal.assertCommandDecorations(undefined, { updatedIcon: "zap", count: 3 }); + describe('Custom configuration', function () { + it('Should update and show custom icons', async () => { + await createShellIntegrationProfile(); + await terminal.assertCommandDecorations({ placeholder: 1, success: 0, error: 0 }); + await terminal.runCommandInTerminal(`ls`); + await terminal.runCommandInTerminal(`fsdkfsjdlfksjdkf`); + await settingsEditor.addUserSetting('terminal.integrated.shellIntegration.decorationIcon', '"zap"'); + await settingsEditor.addUserSetting('terminal.integrated.shellIntegration.decorationIconSuccess', '"zap"'); + await settingsEditor.addUserSetting('terminal.integrated.shellIntegration.decorationIconError', '"zap"'); + await terminal.assertCommandDecorations(undefined, { updatedIcon: "zap", count: 3 }); + }); }); }); }); - }); + } }); } From e4c3bca7a29fbe2c7c1cca47022fdf93811346ce Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Wed, 15 Jun 2022 11:28:46 -0700 Subject: [PATCH 2/9] Kill all terminals after each shell integration test --- .../smoke/src/areas/terminal/terminal-shellIntegration.test.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/smoke/src/areas/terminal/terminal-shellIntegration.test.ts b/test/smoke/src/areas/terminal/terminal-shellIntegration.test.ts index 0bc30da5b58..0e90b784815 100644 --- a/test/smoke/src/areas/terminal/terminal-shellIntegration.test.ts +++ b/test/smoke/src/areas/terminal/terminal-shellIntegration.test.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Application, Terminal, SettingsEditor, TerminalCommandIdWithValue } from '../../../../automation'; +import { Application, Terminal, SettingsEditor, TerminalCommandIdWithValue, TerminalCommandId } from '../../../../automation'; import { setTerminalTestSettings } from './terminal-helpers'; export function setup() { @@ -21,6 +21,7 @@ export function setup() { }); after(async function () { + await app.workbench.terminal.runCommand(TerminalCommandId.KillAll); await settingsEditor.clearUserSettings(); }); From 7548fed110e06d127f522a794e77083ebc87508f Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Wed, 15 Jun 2022 11:30:24 -0700 Subject: [PATCH 3/9] after -> afterEach --- test/smoke/src/areas/terminal/terminal-shellIntegration.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/smoke/src/areas/terminal/terminal-shellIntegration.test.ts b/test/smoke/src/areas/terminal/terminal-shellIntegration.test.ts index 0e90b784815..720c0df2177 100644 --- a/test/smoke/src/areas/terminal/terminal-shellIntegration.test.ts +++ b/test/smoke/src/areas/terminal/terminal-shellIntegration.test.ts @@ -20,7 +20,7 @@ export function setup() { await setTerminalTestSettings(app); }); - after(async function () { + afterEach(async function () { await app.workbench.terminal.runCommand(TerminalCommandId.KillAll); await settingsEditor.clearUserSettings(); }); From 18408b909006d18e2e08e8b1c50d20b31854b644 Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Wed, 15 Jun 2022 12:35:53 -0700 Subject: [PATCH 4/9] Allow tests to run multiple times --- .../terminal-shellIntegration.test.ts | 51 ++++++++++--------- 1 file changed, 27 insertions(+), 24 deletions(-) diff --git a/test/smoke/src/areas/terminal/terminal-shellIntegration.test.ts b/test/smoke/src/areas/terminal/terminal-shellIntegration.test.ts index 720c0df2177..24dc769beb8 100644 --- a/test/smoke/src/areas/terminal/terminal-shellIntegration.test.ts +++ b/test/smoke/src/areas/terminal/terminal-shellIntegration.test.ts @@ -7,29 +7,32 @@ import { Application, Terminal, SettingsEditor, TerminalCommandIdWithValue, Term import { setTerminalTestSettings } from './terminal-helpers'; export function setup() { - describe('Terminal Shell Integration', () => { - let terminal: Terminal; - let settingsEditor: SettingsEditor; - let app: Application; - // Acquire automation API - before(async function () { - app = this.app as Application; - terminal = app.workbench.terminal; - settingsEditor = app.workbench.settingsEditor; - await settingsEditor.addUserSetting('terminal.integrated.shellIntegration.enabled', 'true'); - await setTerminalTestSettings(app); - }); + for (let i = 0; i < 100; i++) { + describe(`Terminal Shell Integration ${i}`, () => { + let terminal: Terminal; + let settingsEditor: SettingsEditor; + let app: Application; + // Acquire automation API + before(async function () { + app = this.app as Application; + terminal = app.workbench.terminal; + settingsEditor = app.workbench.settingsEditor; + await settingsEditor.addUserSetting('terminal.integrated.shellIntegration.enabled', 'true'); + await setTerminalTestSettings(app); + }); - afterEach(async function () { - await app.workbench.terminal.runCommand(TerminalCommandId.KillAll); - await settingsEditor.clearUserSettings(); - }); + after(async function () { + await settingsEditor.clearUserSettings(); + }); - async function createShellIntegrationProfile() { - await terminal.runCommandWithValue(TerminalCommandIdWithValue.NewWithProfile, process.platform === 'win32' ? 'PowerShell' : 'bash'); - } + afterEach(async function () { + await app.workbench.terminal.runCommand(TerminalCommandId.KillAll); + }); + + async function createShellIntegrationProfile() { + await terminal.runCommandWithValue(TerminalCommandIdWithValue.NewWithProfile, process.platform === 'win32' ? 'PowerShell' : 'bash'); + } - for (let i = 0; i < 100; i++) { describe(`Shell integration ${i}`, function () { describe('Decorations', function () { describe('Should show default icons', function () { @@ -39,7 +42,7 @@ export function setup() { }); it('Success', async () => { await createShellIntegrationProfile(); - await terminal.runCommandInTerminal(`ls`); + await terminal.runCommandInTerminal(`echo "success"`); await terminal.assertCommandDecorations({ placeholder: 1, success: 1, error: 0 }); }); it('Error', async () => { @@ -52,7 +55,7 @@ export function setup() { it('Should update and show custom icons', async () => { await createShellIntegrationProfile(); await terminal.assertCommandDecorations({ placeholder: 1, success: 0, error: 0 }); - await terminal.runCommandInTerminal(`ls`); + await terminal.runCommandInTerminal(`echo "success"`); await terminal.runCommandInTerminal(`fsdkfsjdlfksjdkf`); await settingsEditor.addUserSetting('terminal.integrated.shellIntegration.decorationIcon', '"zap"'); await settingsEditor.addUserSetting('terminal.integrated.shellIntegration.decorationIconSuccess', '"zap"'); @@ -62,6 +65,6 @@ export function setup() { }); }); }); - } - }); + }); + } } From 87a99dba093285e9cc88151d1b47808c6e578ed7 Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Wed, 15 Jun 2022 18:50:34 -0700 Subject: [PATCH 5/9] Speed up shell integration tests and improve reliability --- test/automation/src/settings.ts | 20 +++++++++++++++++++ test/automation/src/terminal.ts | 12 +++++++++-- .../src/areas/terminal/terminal-helpers.ts | 18 +++++++++++------ .../terminal-shellIntegration.test.ts | 19 +++++++++--------- 4 files changed, 52 insertions(+), 17 deletions(-) diff --git a/test/automation/src/settings.ts b/test/automation/src/settings.ts index cda80632998..49cd35a5daa 100644 --- a/test/automation/src/settings.ts +++ b/test/automation/src/settings.ts @@ -12,6 +12,12 @@ export class SettingsEditor { constructor(private code: Code, private editors: Editors, private editor: Editor, private quickaccess: QuickAccess) { } + /** + * Write a single setting key value pair. + * + * Warning: You may need to set `editor.wordWrap` to `"on"` if this is called with a really long + * setting. + */ async addUserSetting(setting: string, value: string): Promise { await this.openUserSettingsFile(); @@ -20,6 +26,20 @@ export class SettingsEditor { await this.editors.saveOpenedFile(); } + /** + * Write several settings faster than multiple calls to {@link addUserSetting}. + * + * Warning: You will likely also need to set `editor.wordWrap` to `"on"` if `addUserSetting` is + * called after this in the test. + */ + async addUserSettings(settings: [key: string, value: string][]): Promise { + await this.openUserSettingsFile(); + + await this.code.dispatchKeybinding('right'); + await this.editor.waitForTypeInEditor('settings.json', settings.map(v => `"${v[0]}": ${v[1]},`).join('')); + await this.editors.saveOpenedFile(); + } + async clearUserSettings(): Promise { await this.openUserSettingsFile(); await this.quickaccess.runCommand('editor.action.selectAll'); diff --git a/test/automation/src/terminal.ts b/test/automation/src/terminal.ts index 1dfeac42aeb..dfb24636716 100644 --- a/test/automation/src/terminal.ts +++ b/test/automation/src/terminal.ts @@ -83,8 +83,16 @@ export class Terminal { await this.code.dispatchKeybinding('enter'); await this.quickinput.waitForQuickInputClosed(); } - if (commandId === TerminalCommandId.Show || commandId === TerminalCommandId.CreateNewEditor || commandId === TerminalCommandId.CreateNew || commandId === TerminalCommandId.NewWithProfile) { - return await this._waitForTerminal(expectedLocation === 'editor' || commandId === TerminalCommandId.CreateNewEditor ? 'editor' : 'panel'); + switch (commandId) { + case TerminalCommandId.Show: + case TerminalCommandId.CreateNewEditor: + case TerminalCommandId.CreateNew: + case TerminalCommandId.NewWithProfile: + await this._waitForTerminal(expectedLocation === 'editor' || commandId === TerminalCommandId.CreateNewEditor ? 'editor' : 'panel'); + break; + case TerminalCommandId.KillAll: + await this.code.waitForElements(Selector.Xterm, true, e => e.length === 0); + break; } } diff --git a/test/smoke/src/areas/terminal/terminal-helpers.ts b/test/smoke/src/areas/terminal/terminal-helpers.ts index 24eccb0c2db..c333df0bc5a 100644 --- a/test/smoke/src/areas/terminal/terminal-helpers.ts +++ b/test/smoke/src/areas/terminal/terminal-helpers.ts @@ -5,12 +5,18 @@ import { Application } from '../../../../automation'; -export async function setTerminalTestSettings(app: Application) { - // Always show tabs to make getting terminal groups easier - await app.workbench.settingsEditor.addUserSetting('terminal.integrated.tabs.hideCondition', '"never"'); - // Use the DOM renderer for smoke tests so they can be inspected in the playwright trace - // viewer - await app.workbench.settingsEditor.addUserSetting('terminal.integrated.gpuAcceleration', '"off"'); +export async function setTerminalTestSettings(app: Application, additionalSettings: [key: string, value: string][] = []) { + await app.workbench.settingsEditor.addUserSettings([ + // Work wrap is required when calling settingsEditor.addUserSetting multiple times or the + // click to focus will fail + ['editor.wordWrap', '"on"'], + // Always show tabs to make getting terminal groups easier + ['terminal.integrated.tabs.hideCondition', '"never"'], + // Use the DOM renderer for smoke tests so they can be inspected in the playwright trace + // viewer + ['terminal.integrated.gpuAcceleration', '"off"'], + ...additionalSettings + ]); // Close the settings editor await app.workbench.quickaccess.runCommand('workbench.action.closeAllEditors'); diff --git a/test/smoke/src/areas/terminal/terminal-shellIntegration.test.ts b/test/smoke/src/areas/terminal/terminal-shellIntegration.test.ts index 24dc769beb8..75fa3ca8a65 100644 --- a/test/smoke/src/areas/terminal/terminal-shellIntegration.test.ts +++ b/test/smoke/src/areas/terminal/terminal-shellIntegration.test.ts @@ -17,18 +17,17 @@ export function setup() { app = this.app as Application; terminal = app.workbench.terminal; settingsEditor = app.workbench.settingsEditor; - await settingsEditor.addUserSetting('terminal.integrated.shellIntegration.enabled', 'true'); - await setTerminalTestSettings(app); - }); - - after(async function () { - await settingsEditor.clearUserSettings(); + await setTerminalTestSettings(app, [['terminal.integrated.shellIntegration.enabled', 'true']]); }); afterEach(async function () { await app.workbench.terminal.runCommand(TerminalCommandId.KillAll); }); + after(async function () { + await settingsEditor.clearUserSettings(); + }); + async function createShellIntegrationProfile() { await terminal.runCommandWithValue(TerminalCommandIdWithValue.NewWithProfile, process.platform === 'win32' ? 'PowerShell' : 'bash'); } @@ -36,6 +35,7 @@ export function setup() { describe(`Shell integration ${i}`, function () { describe('Decorations', function () { describe('Should show default icons', function () { + it('Placeholder', async () => { await createShellIntegrationProfile(); await terminal.assertCommandDecorations({ placeholder: 1, success: 0, error: 0 }); @@ -47,7 +47,7 @@ export function setup() { }); it('Error', async () => { await createShellIntegrationProfile(); - await terminal.runCommandInTerminal(`fsdkfsjdlfksjdkf`); + await terminal.runCommandInTerminal(`false`); await terminal.assertCommandDecorations({ placeholder: 1, success: 0, error: 1 }); }); }); @@ -55,12 +55,13 @@ export function setup() { it('Should update and show custom icons', async () => { await createShellIntegrationProfile(); await terminal.assertCommandDecorations({ placeholder: 1, success: 0, error: 0 }); - await terminal.runCommandInTerminal(`echo "success"`); - await terminal.runCommandInTerminal(`fsdkfsjdlfksjdkf`); + await terminal.runCommandInTerminal(`echo "foo"`); + await terminal.runCommandInTerminal(`bar`); await settingsEditor.addUserSetting('terminal.integrated.shellIntegration.decorationIcon', '"zap"'); await settingsEditor.addUserSetting('terminal.integrated.shellIntegration.decorationIconSuccess', '"zap"'); await settingsEditor.addUserSetting('terminal.integrated.shellIntegration.decorationIconError', '"zap"'); await terminal.assertCommandDecorations(undefined, { updatedIcon: "zap", count: 3 }); + await app.workbench.terminal.runCommand(TerminalCommandId.KillAll); }); }); }); From 1b0d0d00d49527d291c82441da323d8be4a9ebc5 Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Wed, 15 Jun 2022 19:22:40 -0700 Subject: [PATCH 6/9] Enable terminal tests on desktop --- test/smoke/src/main.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/smoke/src/main.ts b/test/smoke/src/main.ts index 42175985f48..3836601534f 100644 --- a/test/smoke/src/main.ts +++ b/test/smoke/src/main.ts @@ -400,7 +400,7 @@ describe(`VSCode Smoke Tests (${opts.web ? 'Web' : 'Electron'})`, () => { setupSearchTests(logger); setupNotebookTests(logger); setupLanguagesTests(logger); - if (opts.web) { setupTerminalTests(logger); } // Tests require playwright driver (https://github.com/microsoft/vscode/issues/146811) + setupTerminalTests(logger); setupStatusbarTests(logger); if (quality !== Quality.Dev && quality !== Quality.OSS) { setupExtensionTests(logger); } setupMultirootTests(logger); From b77fecfa101022c3fa0478a62dd429fe1f04224d Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Wed, 15 Jun 2022 20:25:34 -0700 Subject: [PATCH 7/9] Increase darwin timeout temporarily --- build/azure-pipelines/darwin/product-build-darwin-test.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build/azure-pipelines/darwin/product-build-darwin-test.yml b/build/azure-pipelines/darwin/product-build-darwin-test.yml index 6257382d7a3..a01e8951aaf 100644 --- a/build/azure-pipelines/darwin/product-build-darwin-test.yml +++ b/build/azure-pipelines/darwin/product-build-darwin-test.yml @@ -103,7 +103,7 @@ steps: set -e VSCODE_REMOTE_SERVER_PATH="$(agent.builddirectory)/vscode-reh-web-darwin-$(VSCODE_ARCH)" \ yarn smoketest-no-compile --web --tracing --headless - timeoutInMinutes: 20 + timeoutInMinutes: 30 displayName: Run smoke tests (Browser, Chromium) - ${{ if eq(parameters.VSCODE_RUN_SMOKE_TESTS, true) }}: @@ -112,7 +112,7 @@ steps: APP_ROOT=$(agent.builddirectory)/VSCode-darwin-$(VSCODE_ARCH) APP_NAME="`ls $APP_ROOT | head -n 1`" yarn smoketest-no-compile --tracing --build "$APP_ROOT/$APP_NAME" - timeoutInMinutes: 20 + timeoutInMinutes: 30 displayName: Run smoke tests (Electron) - ${{ if eq(parameters.VSCODE_RUN_SMOKE_TESTS, true) }}: @@ -123,7 +123,7 @@ steps: APP_NAME="`ls $APP_ROOT | head -n 1`" VSCODE_REMOTE_SERVER_PATH="$(agent.builddirectory)/vscode-reh-darwin-$(VSCODE_ARCH)" \ yarn smoketest-no-compile --tracing --remote --build "$APP_ROOT/$APP_NAME" - timeoutInMinutes: 20 + timeoutInMinutes: 30 displayName: Run smoke tests (Remote) - ${{ if eq(parameters.VSCODE_RUN_SMOKE_TESTS, true) }}: From d4e06aaa2b49ca03d9d18b4408a106168a050d5c Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Wed, 15 Jun 2022 20:29:32 -0700 Subject: [PATCH 8/9] Disable windows shell integration tests only --- .../smoke/src/areas/terminal/terminal-shellIntegration.test.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/smoke/src/areas/terminal/terminal-shellIntegration.test.ts b/test/smoke/src/areas/terminal/terminal-shellIntegration.test.ts index 75fa3ca8a65..cfa5cefe7fd 100644 --- a/test/smoke/src/areas/terminal/terminal-shellIntegration.test.ts +++ b/test/smoke/src/areas/terminal/terminal-shellIntegration.test.ts @@ -32,7 +32,8 @@ export function setup() { await terminal.runCommandWithValue(TerminalCommandIdWithValue.NewWithProfile, process.platform === 'win32' ? 'PowerShell' : 'bash'); } - describe(`Shell integration ${i}`, function () { + // TODO: Some agents may not have pwsh installed? + (process.platform === 'win32' ? describe.skip : describe)(`Shell integration`, function () { describe('Decorations', function () { describe('Should show default icons', function () { From 463a1e57657dc1eba790516b8fda5d621bd9a9a7 Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Wed, 15 Jun 2022 20:59:19 -0700 Subject: [PATCH 9/9] Run shell integration tests a single time and revert timeout --- .../darwin/product-build-darwin-test.yml | 6 +- .../terminal-shellIntegration.test.ts | 102 +++++++++--------- 2 files changed, 53 insertions(+), 55 deletions(-) diff --git a/build/azure-pipelines/darwin/product-build-darwin-test.yml b/build/azure-pipelines/darwin/product-build-darwin-test.yml index a01e8951aaf..6257382d7a3 100644 --- a/build/azure-pipelines/darwin/product-build-darwin-test.yml +++ b/build/azure-pipelines/darwin/product-build-darwin-test.yml @@ -103,7 +103,7 @@ steps: set -e VSCODE_REMOTE_SERVER_PATH="$(agent.builddirectory)/vscode-reh-web-darwin-$(VSCODE_ARCH)" \ yarn smoketest-no-compile --web --tracing --headless - timeoutInMinutes: 30 + timeoutInMinutes: 20 displayName: Run smoke tests (Browser, Chromium) - ${{ if eq(parameters.VSCODE_RUN_SMOKE_TESTS, true) }}: @@ -112,7 +112,7 @@ steps: APP_ROOT=$(agent.builddirectory)/VSCode-darwin-$(VSCODE_ARCH) APP_NAME="`ls $APP_ROOT | head -n 1`" yarn smoketest-no-compile --tracing --build "$APP_ROOT/$APP_NAME" - timeoutInMinutes: 30 + timeoutInMinutes: 20 displayName: Run smoke tests (Electron) - ${{ if eq(parameters.VSCODE_RUN_SMOKE_TESTS, true) }}: @@ -123,7 +123,7 @@ steps: APP_NAME="`ls $APP_ROOT | head -n 1`" VSCODE_REMOTE_SERVER_PATH="$(agent.builddirectory)/vscode-reh-darwin-$(VSCODE_ARCH)" \ yarn smoketest-no-compile --tracing --remote --build "$APP_ROOT/$APP_NAME" - timeoutInMinutes: 30 + timeoutInMinutes: 20 displayName: Run smoke tests (Remote) - ${{ if eq(parameters.VSCODE_RUN_SMOKE_TESTS, true) }}: diff --git a/test/smoke/src/areas/terminal/terminal-shellIntegration.test.ts b/test/smoke/src/areas/terminal/terminal-shellIntegration.test.ts index cfa5cefe7fd..200ab28b019 100644 --- a/test/smoke/src/areas/terminal/terminal-shellIntegration.test.ts +++ b/test/smoke/src/areas/terminal/terminal-shellIntegration.test.ts @@ -7,66 +7,64 @@ import { Application, Terminal, SettingsEditor, TerminalCommandIdWithValue, Term import { setTerminalTestSettings } from './terminal-helpers'; export function setup() { - for (let i = 0; i < 100; i++) { - describe(`Terminal Shell Integration ${i}`, () => { - let terminal: Terminal; - let settingsEditor: SettingsEditor; - let app: Application; - // Acquire automation API - before(async function () { - app = this.app as Application; - terminal = app.workbench.terminal; - settingsEditor = app.workbench.settingsEditor; - await setTerminalTestSettings(app, [['terminal.integrated.shellIntegration.enabled', 'true']]); - }); + describe('Terminal Shell Integration', () => { + let terminal: Terminal; + let settingsEditor: SettingsEditor; + let app: Application; + // Acquire automation API + before(async function () { + app = this.app as Application; + terminal = app.workbench.terminal; + settingsEditor = app.workbench.settingsEditor; + await setTerminalTestSettings(app, [['terminal.integrated.shellIntegration.enabled', 'true']]); + }); - afterEach(async function () { - await app.workbench.terminal.runCommand(TerminalCommandId.KillAll); - }); + afterEach(async function () { + await app.workbench.terminal.runCommand(TerminalCommandId.KillAll); + }); - after(async function () { - await settingsEditor.clearUserSettings(); - }); + after(async function () { + await settingsEditor.clearUserSettings(); + }); - async function createShellIntegrationProfile() { - await terminal.runCommandWithValue(TerminalCommandIdWithValue.NewWithProfile, process.platform === 'win32' ? 'PowerShell' : 'bash'); - } + async function createShellIntegrationProfile() { + await terminal.runCommandWithValue(TerminalCommandIdWithValue.NewWithProfile, process.platform === 'win32' ? 'PowerShell' : 'bash'); + } - // TODO: Some agents may not have pwsh installed? - (process.platform === 'win32' ? describe.skip : describe)(`Shell integration`, function () { - describe('Decorations', function () { - describe('Should show default icons', function () { + // TODO: Some agents may not have pwsh installed? + (process.platform === 'win32' ? describe.skip : describe)(`Shell integration`, function () { + describe('Decorations', function () { + describe('Should show default icons', function () { - it('Placeholder', async () => { - await createShellIntegrationProfile(); - await terminal.assertCommandDecorations({ placeholder: 1, success: 0, error: 0 }); - }); - it('Success', async () => { - await createShellIntegrationProfile(); - await terminal.runCommandInTerminal(`echo "success"`); - await terminal.assertCommandDecorations({ placeholder: 1, success: 1, error: 0 }); - }); - it('Error', async () => { - await createShellIntegrationProfile(); - await terminal.runCommandInTerminal(`false`); - await terminal.assertCommandDecorations({ placeholder: 1, success: 0, error: 1 }); - }); + it('Placeholder', async () => { + await createShellIntegrationProfile(); + await terminal.assertCommandDecorations({ placeholder: 1, success: 0, error: 0 }); }); - describe('Custom configuration', function () { - it('Should update and show custom icons', async () => { - await createShellIntegrationProfile(); - await terminal.assertCommandDecorations({ placeholder: 1, success: 0, error: 0 }); - await terminal.runCommandInTerminal(`echo "foo"`); - await terminal.runCommandInTerminal(`bar`); - await settingsEditor.addUserSetting('terminal.integrated.shellIntegration.decorationIcon', '"zap"'); - await settingsEditor.addUserSetting('terminal.integrated.shellIntegration.decorationIconSuccess', '"zap"'); - await settingsEditor.addUserSetting('terminal.integrated.shellIntegration.decorationIconError', '"zap"'); - await terminal.assertCommandDecorations(undefined, { updatedIcon: "zap", count: 3 }); - await app.workbench.terminal.runCommand(TerminalCommandId.KillAll); - }); + it('Success', async () => { + await createShellIntegrationProfile(); + await terminal.runCommandInTerminal(`echo "success"`); + await terminal.assertCommandDecorations({ placeholder: 1, success: 1, error: 0 }); + }); + it('Error', async () => { + await createShellIntegrationProfile(); + await terminal.runCommandInTerminal(`false`); + await terminal.assertCommandDecorations({ placeholder: 1, success: 0, error: 1 }); + }); + }); + describe('Custom configuration', function () { + it('Should update and show custom icons', async () => { + await createShellIntegrationProfile(); + await terminal.assertCommandDecorations({ placeholder: 1, success: 0, error: 0 }); + await terminal.runCommandInTerminal(`echo "foo"`); + await terminal.runCommandInTerminal(`bar`); + await settingsEditor.addUserSetting('terminal.integrated.shellIntegration.decorationIcon', '"zap"'); + await settingsEditor.addUserSetting('terminal.integrated.shellIntegration.decorationIconSuccess', '"zap"'); + await settingsEditor.addUserSetting('terminal.integrated.shellIntegration.decorationIconError', '"zap"'); + await terminal.assertCommandDecorations(undefined, { updatedIcon: "zap", count: 3 }); + await app.workbench.terminal.runCommand(TerminalCommandId.KillAll); }); }); }); }); - } + }); }