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] 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); }); }); }); }); - } + }); }