Skip to content

Commit 73cdbf1

Browse files
authored
Update extension to node 16 (#21161)
For #21144
1 parent 4b5cc8d commit 73cdbf1

File tree

12 files changed

+47
-62
lines changed

12 files changed

+47
-62
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
- 'release-*'
1010

1111
env:
12-
NODE_VERSION: 14.18.2
12+
NODE_VERSION: 16.17.1
1313
PYTHON_VERSION: '3.10' # YML treats 3.10 the number as 3.1, so quotes around 3.10
1414
# Force a path with spaces and to test extension works in these scenarios
1515
# Unicode characters are causing 2.7 failures so skip that for now.

.github/workflows/pr-check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
- release*
99

1010
env:
11-
NODE_VERSION: 14.18.2
11+
NODE_VERSION: 16.17.1
1212
PYTHON_VERSION: '3.10' # YML treats 3.10 the number as 3.1, so quotes around 3.10
1313
MOCHA_REPORTER_JUNIT: true # Use the mocha-multi-reporters and send output to both console (spec) and JUnit (mocha-junit-reporter). Also enables a reporter which exits the process running the tests if it haven't already.
1414
ARTIFACT_NAME_VSIX: ms-python-insiders-vsix

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v14.18.2
1+
v16.17.1

package-lock.json

Lines changed: 15 additions & 38 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1915,7 +1915,7 @@
19151915
"@types/md5": "^2.1.32",
19161916
"@types/mocha": "^9.1.0",
19171917
"@types/nock": "^10.0.3",
1918-
"@types/node": "^14.18.0",
1918+
"@types/node": "^16.17.0",
19191919
"@types/semver": "^5.5.0",
19201920
"@types/shortid": "^0.0.29",
19211921
"@types/sinon": "^10.0.11",

src/client/common/process/logger.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ export class ProcessLogger implements IProcessLogger {
2828
: fileOrCommand;
2929
const info = [`> ${this.getDisplayCommands(command)}`];
3030
if (options?.cwd) {
31-
info.push(`cwd: ${this.getDisplayCommands(options.cwd)}`);
31+
const cwd: string = typeof options?.cwd === 'string' ? options?.cwd : options?.cwd?.toString();
32+
info.push(`cwd: ${this.getDisplayCommands(cwd)}`);
3233
}
3334
if (typeof options?.shell === 'string') {
3435
info.push(`shell: ${identifyShellFromShellPath(options?.shell)}`);

src/client/common/process/rawProcessApis.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ export function execObservable(
192192
let procExited = false;
193193
const disposable: IDisposable = {
194194
dispose() {
195-
if (proc && !proc.killed && !procExited) {
195+
if (proc && proc.pid && !proc.killed && !procExited) {
196196
killPid(proc.pid);
197197
}
198198
if (proc) {

src/test/common/installer/poetryInstaller.unit.test.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,14 @@ suite('Module Installer - Poetry', () => {
5050
switch (command) {
5151
case 'poetry env list --full-path':
5252
return Promise.resolve<ExecutionResult<string>>({ stdout: '' });
53-
case 'poetry env info -p':
54-
if (options.cwd && externalDependencies.arePathsSame(options.cwd, project1)) {
53+
case 'poetry env info -p': {
54+
const cwd = typeof options.cwd === 'string' ? options.cwd : options.cwd?.toString();
55+
if (cwd && externalDependencies.arePathsSame(cwd, project1)) {
5556
return Promise.resolve<ExecutionResult<string>>({
5657
stdout: `${path.join(project1, '.venv')} \n`,
5758
});
5859
}
60+
}
5961
}
6062
return Promise.reject(new Error('Command failed'));
6163
});

src/test/common/process/proc.unit.test.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,18 @@ suite('Process - Process Service', function () {
3636

3737
test('Process is killed', async () => {
3838
const proc = spawnProc();
39-
40-
ProcessService.kill(proc.proc.pid);
39+
expect(proc.proc.pid !== undefined).to.equal(true, 'invalid pid');
40+
if (proc.proc.pid) {
41+
ProcessService.kill(proc.proc.pid);
42+
}
4143

4244
expect(await proc.exited.promise).to.equal(true, 'process did not die');
4345
});
4446
test('Process is alive', async () => {
4547
const proc = spawnProc();
46-
47-
expect(ProcessService.isAlive(proc.proc.pid)).to.equal(true, 'process is not alive');
48+
expect(proc.proc.pid !== undefined).to.equal(true, 'invalid pid');
49+
if (proc.proc.pid) {
50+
expect(ProcessService.isAlive(proc.proc.pid)).to.equal(true, 'process is not alive');
51+
}
4852
});
4953
});

src/test/proc.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export class Proc {
5454
this.raw = (raw as unknown) as IRawProc;
5555
this.output = output;
5656
}
57-
public get pid(): number {
57+
public get pid(): number | undefined {
5858
return this.raw.pid;
5959
}
6060
public get exited(): boolean {

0 commit comments

Comments
 (0)