@@ -74,7 +74,7 @@ describe('pathFind', function () {
7474
7575 it ( 'only returns valid executable ssh path (CI + Local Non-Windows)' , async function ( ) {
7676 // In CI, we can assume Windows machines will have ssh.
77- if ( ! isCI ( ) ) {
77+ if ( ! isCI ( ) && isWin ( ) ) {
7878 return
7979 }
8080 // On local non-windows, we can overwrite path and create our own executable to find.
@@ -95,31 +95,31 @@ describe('pathFind', function () {
9595
9696 it ( 'caches result from previous runs (CI + Local Non-Windows)' , async function ( ) {
9797 // In CI, we can assume Windows machines will have ssh.
98- if ( ! isCI ( ) ) {
98+ if ( ! isCI ( ) && isWin ( ) ) {
9999 return
100100 }
101101 // On local non-windows, we can overwrite path and create our own executable to find.
102102 const workspace = await testutil . createTestWorkspaceFolder ( )
103103 // We move the ssh to a temp directory temporarily to test if cache works.
104104 const tempLocation = path . join ( workspace . uri . fsPath , 'temp-ssh' )
105+ const fakeSshPath = path . join ( workspace . uri . fsPath , `ssh` )
105106
106107 if ( ! isWin ( ) ) {
107- const fakeSshPath = path . join ( workspace . uri . fsPath , `ssh` )
108-
109108 testutil . setEnv ( testutil . envWithNewPath ( workspace . uri . fsPath ) )
110109
111110 await testutil . createExecutableFile ( fakeSshPath , '' )
112111 }
113112
114113 const ssh1 = await findSshPath ( true )
114+ const originalSshPath = ssh1 ! === 'ssh' ? fakeSshPath : ssh1 !
115115
116- await fs . rename ( ssh1 ! , tempLocation )
116+ await fs . rename ( originalSshPath , tempLocation )
117117
118118 const ssh2 = await findSshPath ( true )
119119
120120 assert . strictEqual ( ssh1 , ssh2 )
121121
122- await fs . rename ( tempLocation , ssh1 ! )
122+ await fs . rename ( tempLocation , originalSshPath )
123123 } )
124124 } )
125125} )
0 commit comments