Skip to content
Closed
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/pr-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ on:
permissions: {}

env:
NODE_VERSION: 18.17.1
NODE_VERSION: 20.18.1
TEST_RESULTS_DIRECTORY: .
# Force a path with spaces and unicode chars to test extension works in these scenarios
special-working-directory: './🐍 🐛'
special-working-directory-relative: '🐍 🐛'
special-working-directory: './testpath'
special-working-directory-relative: 'testpath'

jobs:
build-vsix:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/push-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ on:
permissions: {}

env:
NODE_VERSION: 18.17.1
NODE_VERSION: 20.18.1
TEST_RESULTS_DIRECTORY: .
# Force a path with spaces and unicode chars to test extension works in these scenarios
special-working-directory: './🐍 🐛'
special-working-directory-relative: '🐍 🐛'
special-working-directory: './testpath'
special-working-directory-relative: 'testpath'

jobs:
build-vsix:
Expand Down
2 changes: 1 addition & 1 deletion build/azure-pipeline.pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ extends:
buildSteps:
- task: NodeTool@0
inputs:
versionSpec: '18.17.1'
versionSpec: '20.18.1'
displayName: Select Node version

- task: UsePythonVersion@0
Expand Down
2 changes: 1 addition & 1 deletion build/azure-pipeline.stable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ extends:
buildSteps:
- task: NodeTool@0
inputs:
versionSpec: '18.17.1'
versionSpec: '20.18.1'
displayName: Select Node version

- task: UsePythonVersion@0
Expand Down
8,153 changes: 2,778 additions & 5,375 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@
"@types/glob": "^7.2.0",
"@types/lodash": "^4.14.191",
"@types/mocha": "^10.0.7",
"@types/node": "18.x",
"@types/node": "^20.18.1",
"@types/semver": "^7.3.13",
"@types/sinon": "^10.0.13",
"@types/vscode": "^1.87.0",
Expand Down
62 changes: 35 additions & 27 deletions src/test/unittest/noConfigDebugInit.unit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ suite('setup for no-config debug scenario', function () {
// Arrange
const environmentVariableCollectionMock = TypeMoq.Mock.ofType<any>();
context.setup((c) => c.environmentVariableCollection).returns(() => environmentVariableCollectionMock.object);
let createFileSystemWatcherFunct = setupFileSystemWatchers();
let createFileSystemWatcherFunct: sinon.SinonStub = setupFileSystemWatchers();

// Act
await registerNoConfigDebug(context.object.environmentVariableCollection, context.object.extensionPath);
Expand Down Expand Up @@ -217,10 +217,23 @@ suite('setup for no-config debug scenario', function () {
});

// create stub of fs.readFile function
sinon.stub(fs, 'readFile').callsFake((_path: any, callback: (arg0: null, arg1: Buffer) => void) => {
console.log('reading file');
callback(null, Buffer.from(JSON.stringify({ client: { port: 5678 } })));
});
sinon
.stub(fs, 'readFile')
.callsFake(
(
_path: string | Buffer | URL | number,
_options: any,
callback?: (err: NodeJS.ErrnoException | null, data: Buffer) => void,
) => {
if (typeof _options === 'function') {
callback = _options;
}
console.log('reading file');
if (callback) {
callback(null, Buffer.from(JSON.stringify({ client: { port: 5678 } })));
}
},
);

const debugStub = sinon.stub(utils, 'debugStartDebugging').resolves(true);

Expand All @@ -233,29 +246,18 @@ suite('setup for no-config debug scenario', function () {
type: 'python',
request: 'attach',
name: 'Attach to Python',
connect: {
port: 5678,
host: 'localhost',
},
};
const optionsExpected: DebugSessionOptions = {
noDebug: false,
connect: { port: 5678, host: 'localhost' },
};
const optionsExpected: DebugSessionOptions = { noDebug: false };
const actualConfig = debugStub.getCall(0).args[1];
const actualOptions = debugStub.getCall(0).args[2];

if (JSON.stringify(actualConfig) !== JSON.stringify(expectedConfig)) {
console.log('Config diff:', {
expected: expectedConfig,
actual: actualConfig,
});
console.log('Config diff:', { expected: expectedConfig, actual: actualConfig });
}

if (JSON.stringify(actualOptions) !== JSON.stringify(optionsExpected)) {
console.log('Options diff:', {
expected: optionsExpected,
actual: actualOptions,
});
console.log('Options diff:', { expected: optionsExpected, actual: actualOptions });
}

sinon.assert.calledWith(debugStub, undefined, expectedConfig, optionsExpected);
Expand Down Expand Up @@ -297,12 +299,18 @@ function setupFileSystemWatchers(): sinon.SinonStub {
};
});
// create stub of fs.readFile function
sinon.stub(fs, 'readFile').callsFake(
(TypeMoq.It.isAny(),
TypeMoq.It.isAny(),
(err, data) => {
console.log(err, data);
}),
);
sinon
.stub(fs, 'readFile')
.callsFake(
(
_path: string | Buffer | URL | number,
_options: any,
callback?: (err: NodeJS.ErrnoException | null, data: Buffer) => void,
) => {
if (callback) {
callback(null, Buffer.from(''));
}
},
);
return createFileSystemWatcherFunct;
}
Loading