Skip to content

Commit ee5fbb6

Browse files
authored
Use fully qualified paths to nodejs on CI for tests (microsoft#5308)
1 parent c3a1cf3 commit ee5fbb6

4 files changed

Lines changed: 11 additions & 3 deletions

File tree

build/ci/templates/test_phases.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,14 @@ steps:
7171
verbose: true
7272
customCommand: 'install -g npm@$(NpmVersion)'
7373

74+
# On Mac, the command `node` doesn't always point to the current node version.
75+
- script: |
76+
export NODE_PATH=`which node`
77+
echo $NODE_PATH
78+
echo '##vso[task.setvariable variable=NODE_PATH]'$NODE_PATH
79+
displayName: "Setup NODE_PATH for extension"
80+
condition: and(succeeded(), eq(variables['agent.os'], 'Darwin'))
81+
7482
# Install node_modules.
7583
# Example command line (windows pwsh):
7684
# > npm ci

src/test/debugger/misc.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ suite(`Standard Debugging - Misc tests: ${debuggerType}`, () => {
5050
* @returns {DebugClient}
5151
*/
5252
function createDebugAdapter(): DebugClient {
53-
return new DebugClient('node', testAdapterFilePath, debuggerType);
53+
return new DebugClient(process.env.NODE_PATH || 'node', testAdapterFilePath, debuggerType);
5454
}
5555
function buildLaunchArgs(pythonFile: string, stopOnEntry: boolean = false, showReturnValue: boolean = false): LaunchRequestArguments {
5656
const env = { PYTHONPATH: PTVSD_PATH };

src/test/debugger/portAndHost.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ suite(`Standard Debugging of ports and hosts: ${debuggerType}`, () => {
3131
this.skip();
3232
}
3333
await new Promise(resolve => setTimeout(resolve, 1000));
34-
debugClient = new DebugClient('node', testAdapterFilePath, debuggerType);
34+
debugClient = new DebugClient(process.env.NODE_PATH || 'node', testAdapterFilePath, debuggerType);
3535
debugClient.defaultTimeout = DEBUGGER_TIMEOUT;
3636
await debugClient.start();
3737
});

src/test/debugger/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const debuggerType = DebuggerTypeName;
2424
*/
2525
export async function createDebugAdapter(_coverageDirectory: string): Promise<DebugClient> {
2626
await new Promise(resolve => setTimeout(resolve, 1000));
27-
const debugClient = new DebugClient('node', testAdapterFilePath, debuggerType);
27+
const debugClient = new DebugClient(process.env.NODE_PATH || 'node', testAdapterFilePath, debuggerType);
2828
debugClient.defaultTimeout = DEBUGGER_TIMEOUT;
2929
await debugClient.start();
3030
return debugClient;

0 commit comments

Comments
 (0)