@@ -9,7 +9,8 @@ import { env, TerminalShellExecutionCommandLineConfidence, UIKind, window, works
9
9
import { assertNoRpc } from '../utils' ;
10
10
11
11
// 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' , ( ) => {
13
14
const disposables : Disposable [ ] = [ ] ;
14
15
15
16
suiteSetup ( async ( ) => {
@@ -96,9 +97,7 @@ import { assertNoRpc } from '../utils';
96
97
await closeTerminalAsync ( terminal ) ;
97
98
} ) ;
98
99
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 ( ) => {
102
101
const { terminal, shellIntegration } = await createTerminalAndWaitForShellIntegration ( ) ;
103
102
const events : string [ ] = [ ] ;
104
103
disposables . push ( window . onDidStartTerminalShellExecution ( ( ) => events . push ( 'start' ) ) ) ;
@@ -110,9 +109,7 @@ import { assertNoRpc } from '../utils';
110
109
await closeTerminalAsync ( terminal ) ;
111
110
} ) ;
112
111
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 ( ) => {
116
113
const { terminal, shellIntegration } = await createTerminalAndWaitForShellIntegration ( ) ;
117
114
const events : string [ ] = [ ] ;
118
115
disposables . push ( window . onDidStartTerminalShellExecution ( ( ) => events . push ( 'start' ) ) ) ;
@@ -137,10 +134,10 @@ import { assertNoRpc } from '../utils';
137
134
await endEvent ;
138
135
139
136
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 ) } ` ) ;
142
139
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 ) } ` ) ;
144
141
}
145
142
146
143
await closeTerminalAsync ( terminal ) ;
@@ -197,9 +194,7 @@ import { assertNoRpc } from '../utils';
197
194
await closeTerminalAsync ( terminal ) ;
198
195
} ) ;
199
196
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 ( ) => {
203
198
const { terminal, shellIntegration } = await createTerminalAndWaitForShellIntegration ( ) ;
204
199
const { execution, endEvent } = executeCommandAsync ( shellIntegration , 'echo hello' ) ;
205
200
const executionSync = await execution ;
@@ -214,9 +209,7 @@ import { assertNoRpc } from '../utils';
214
209
await closeTerminalAsync ( terminal ) ;
215
210
} ) ;
216
211
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 ( ) => {
220
213
const { terminal, shellIntegration } = await createTerminalAndWaitForShellIntegration ( ) ;
221
214
const { execution, endEvent } = executeCommandAsync ( shellIntegration , 'echo' , [ 'hello' ] ) ;
222
215
const executionSync = await execution ;
0 commit comments