Skip to content

Commit 762cbd6

Browse files
committed
More logging, disable on Windows
1 parent f18f406 commit 762cbd6

File tree

1 file changed

+9
-16
lines changed

1 file changed

+9
-16
lines changed

extensions/vscode-api-tests/src/singlefolder-tests/terminal.shellIntegration.test.ts

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ import { env, TerminalShellExecutionCommandLineConfidence, UIKind, window, works
99
import { assertNoRpc } from '../utils';
1010

1111
// Terminal integration tests are disabled on web https://github.com/microsoft/vscode/issues/92826
12-
(env.uiKind === UIKind.Web ? suite.skip : suite)('vscode API - Terminal.shellIntegration', () => {
12+
// Windows images will often not have functional shell integration
13+
(env.uiKind === UIKind.Web || platform() === 'win32' ? suite.skip : suite)('vscode API - Terminal.shellIntegration', () => {
1314
const disposables: Disposable[] = [];
1415

1516
suiteSetup(async () => {
@@ -96,9 +97,7 @@ import { assertNoRpc } from '../utils';
9697
await closeTerminalAsync(terminal);
9798
});
9899

99-
// TODO: Exit code and command line in end events is flaky currently, marker adjustments are
100-
// likely the cause which make end events fire with undefined command line and exit codes
101-
(platform() === 'win32' ? test.skip : test)('end execution event should report zero exit code for successful commands', async () => {
100+
test('end execution event should report zero exit code for successful commands', async () => {
102101
const { terminal, shellIntegration } = await createTerminalAndWaitForShellIntegration();
103102
const events: string[] = [];
104103
disposables.push(window.onDidStartTerminalShellExecution(() => events.push('start')));
@@ -110,9 +109,7 @@ import { assertNoRpc } from '../utils';
110109
await closeTerminalAsync(terminal);
111110
});
112111

113-
// TODO: Exit code and command line in end events is flaky currently, marker adjustments are
114-
// likely the cause which make end events fire with undefined command line and exit codes
115-
(platform() === 'win32' ? test.skip : test)('end execution event should report non-zero exit code for failed commands', async () => {
112+
test('end execution event should report non-zero exit code for failed commands', async () => {
116113
const { terminal, shellIntegration } = await createTerminalAndWaitForShellIntegration();
117114
const events: string[] = [];
118115
disposables.push(window.onDidStartTerminalShellExecution(() => events.push('start')));
@@ -137,10 +134,10 @@ import { assertNoRpc } from '../utils';
137134
await endEvent;
138135

139136
ok(events.length >= 3, `should have at least 3 events ${JSON.stringify(events)}`);
140-
strictEqual(events[0], 'start');
141-
strictEqual(events.at(-1), 'end');
137+
strictEqual(events[0], 'start', `first event should be 'start' ${JSON.stringify(events)}`);
138+
strictEqual(events.at(-1), 'end', `last event should be 'end' ${JSON.stringify(events)}`);
142139
for (let i = 1; i < events.length - 1; i++) {
143-
strictEqual(events[i], 'data', 'all middle events should be data');
140+
strictEqual(events[i], 'data', `all middle events should be 'data' ${JSON.stringify(events)}`);
144141
}
145142

146143
await closeTerminalAsync(terminal);
@@ -197,9 +194,7 @@ import { assertNoRpc } from '../utils';
197194
await closeTerminalAsync(terminal);
198195
});
199196

200-
// TODO: Exit code and command line in end events is flaky currently, marker adjustments are
201-
// likely the cause which make end events fire with undefined command line and exit codes
202-
(platform() === 'win32' ? test.skip : test)('executeCommand(commandLine)', async () => {
197+
test('executeCommand(commandLine)', async () => {
203198
const { terminal, shellIntegration } = await createTerminalAndWaitForShellIntegration();
204199
const { execution, endEvent } = executeCommandAsync(shellIntegration, 'echo hello');
205200
const executionSync = await execution;
@@ -214,9 +209,7 @@ import { assertNoRpc } from '../utils';
214209
await closeTerminalAsync(terminal);
215210
});
216211

217-
// TODO: Exit code and command line in end events is flaky currently, marker adjustments are
218-
// likely the cause which make end events fire with undefined command line and exit codes
219-
(platform() === 'win32' ? test.skip : test)('executeCommand(executable, args)', async () => {
212+
test('executeCommand(executable, args)', async () => {
220213
const { terminal, shellIntegration } = await createTerminalAndWaitForShellIntegration();
221214
const { execution, endEvent } = executeCommandAsync(shellIntegration, 'echo', ['hello']);
222215
const executionSync = await execution;

0 commit comments

Comments
 (0)