Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
4 changes: 0 additions & 4 deletions build/conda-nonconda-test-requirements.txt

This file was deleted.

1 change: 0 additions & 1 deletion build/venv-smoke-test-requirements.txt

This file was deleted.

11 changes: 0 additions & 11 deletions build/venv-test-ipywidgets7-requirements.txt

This file was deleted.

16 changes: 15 additions & 1 deletion build/venv-test-ipywidgets8-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# List of requirements for ipython tests
numpy
numpy>=1.22.2
pandas
# Install jupyter itself so we end up with a kernel
jupyter
Expand All @@ -8,3 +8,17 @@ ipywidgets
anywidget
matplotlib
ipympl

# Security updates for transitive dependencies
pillow>=10.2.0
setuptools>=78.1.1
zipp>=3.19.1
tornado>=6.4.1
anyio>=4.4.0
requests>=2.32.4
fonttools>=4.43.0
jupyter-server>=2.14.1
jupyter-core>=5.8.0
ipython>=8.10.0
urllib3>=2.2.2
jupyterlab>=4.4.8
1,040 changes: 540 additions & 500 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2196,7 +2196,7 @@
"fast-deep-equal": "^2.0.1",
"format-util": "^1.0.5",
"fs-extra": "^4.0.3",
"glob": "^7.1.2",
"glob": "^9.3.5",
"iconv-lite": "^0.6.3",
"immer": "^10.1.3",
"inversify": "^6.0.1",
Expand Down Expand Up @@ -2230,7 +2230,6 @@
"slickgrid": "^2.4.17",
"stack-trace": "0.0.10",
"strip-comments": "^2.0.1",
"styled-components": "^5.2.1",
"svg-to-pdfkit": "^0.1.8",
"tailwind-merge": "^3.3.1",
"tcp-port-used": "^1.0.1",
Expand Down Expand Up @@ -2309,6 +2308,7 @@
"@vscode/zeromq": "^0.2.3",
"acorn": "^8.9.0",
"autoprefixer": "^10.4.21",
"bare-events": "^2.8.1",
"buffer": "^6.0.3",
"bufferutil": "^4.0.6",
"chai": "^4.3.10",
Expand Down
9 changes: 3 additions & 6 deletions src/platform/common/platform/fileSystem.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@

import * as path from '../../../platform/vscode-path/path';
import * as fs from 'fs-extra';
import glob from 'glob';
import { glob } from 'glob';
import { injectable } from 'inversify';
import * as tmp from 'tmp';
import { promisify } from 'util';
import { TemporaryFile } from './types';
import { IFileSystemNode } from './types.node';
import { ENCODING, FileSystem as FileSystemBase } from './fileSystem';
Expand All @@ -19,10 +18,8 @@ import { getFilePath } from './fs-paths';
*/
@injectable()
export class FileSystem extends FileSystemBase implements IFileSystemNode {
private globFiles: (pat: string, options?: { cwd: string; dot?: boolean }) => Promise<string[]>;
constructor() {
super();
this.globFiles = promisify(glob);
private async globFiles(pat: string, options?: { cwd: string; dot?: boolean }): Promise<string[]> {
return glob(pat, options || {});
}

public createLocalWriteStream(path: string): fs.WriteStream {
Expand Down
10 changes: 1 addition & 9 deletions src/telemetryGenerator.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -771,15 +771,7 @@ function generateTelemetryGdpr(output: TelemetryEntry[]) {
}

async function generateTelemetryOutput() {
const files = await new Promise<string[]>((resolve, reject) => {
glob(path.join(EXTENSION_ROOT_DIR_FOR_TESTS, 'src/**/*.ts'), (ex, res) => {
if (ex) {
reject(ex);
} else {
resolve(res);
}
});
});
const files = await glob(path.join(EXTENSION_ROOT_DIR_FOR_TESTS, 'src/**/*.ts'));
// Print out the source tree
return generateDocumentation(files);
}
Expand Down
12 changes: 2 additions & 10 deletions src/test/extension.serviceRegistry.vscode.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,16 +114,8 @@ async function getInjectableClasses(fileNames: string[], options: ts.CompilerOpt
}

async function getSourceFiles() {
const files = await new Promise<string[]>((resolve, reject) => {
const globPattern = path.join(__dirname, '..', '..', 'src', '**', '*.ts').replace(/\\/g, '/');
glob(globPattern, (ex, res) => {
if (ex) {
reject(ex);
} else {
resolve(res);
}
});
});
const globPattern = path.join(__dirname, '..', '..', 'src', '**', '*.ts').replace(/\\/g, '/');
const files = await glob(globPattern);
return files;
}

Expand Down
22 changes: 7 additions & 15 deletions src/test/index.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,21 +187,13 @@ export async function run(): Promise<void> {
default:
break;
}
const testFiles = await new Promise<string[]>((resolve, reject) => {
// If we have mulitple patterns, then turn into regex from `a,b,c` to `(a|b|c)`
const pattern = options.testFilesSuffix.includes(',')
? `(${options.testFilesSuffix.split(',').join('|')})`
: options.testFilesSuffix;
glob(
`**/*${pattern}.js`,
{ ignore: ['**/**.unit.test.js'].concat(ignoreGlob), cwd: testsRoot },
(error, files) => {
if (error) {
return reject(error);
}
resolve(files);
}
);
// If we have mulitple patterns, then turn into regex from `a,b,c` to `(a|b|c)`
const pattern = options.testFilesSuffix.includes(',')
? `(${options.testFilesSuffix.split(',').join('|')})`
: options.testFilesSuffix;
const testFiles = await glob(`**/*${pattern}.js`, {
ignore: ['**/**.unit.test.js'].concat(ignoreGlob),
cwd: testsRoot
});

// Setup test files that need to be run.
Expand Down
7 changes: 3 additions & 4 deletions src/test/interpreters/condaService.node.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

import glob from 'glob';
import { glob } from 'glob';
import * as path from '../../platform/vscode-path/path';
import { parse, SemVer } from 'semver';
import { promisify } from 'util';
import { logger } from '../../platform/logging';
import { arePathsSame } from '../../platform/common/platform/fileUtils.node';
import { ProcessService } from '../../platform/common/process/proc.node';
Expand Down Expand Up @@ -65,14 +64,14 @@ const CondaLocationsGlobWin = `{${condaGlobPathsForWindows.join(',')}}`;
*/
async function getCondaFileFromKnownLocations(): Promise<string> {
const globPattern = getOSType() === OSType.Windows ? CondaLocationsGlobWin : CondaLocationsGlob;
const condaFiles = await promisify(glob)(globPattern).catch<string[]>((failReason) => {
const condaFiles = await glob(globPattern, {}).catch<string[]>((failReason) => {
logger.warn(
'Default conda location search failed.',
`Searching for default install locations for conda results in error: ${failReason}`
);
return [];
});
const validCondaFiles = condaFiles.filter((condaPath) => condaPath.length > 0);
const validCondaFiles = condaFiles.filter((condaPath: string) => condaPath.length > 0);
return validCondaFiles.length === 0 ? 'conda' : validCondaFiles[0];
}

Expand Down
16 changes: 7 additions & 9 deletions src/test/package.nls.json.unit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,20 @@

import { expect } from 'chai';
import * as fs from 'fs';
import glob from 'glob';
import { globSync } from 'glob';
import * as path from '../platform/vscode-path/path';
import { EXTENSION_ROOT_DIR_FOR_TESTS } from './constants.node';

suite('Extension localization files', () => {
test('Load localization file', () => {
const filesFailed: string[] = [];
glob.sync('package.nls.*.json', { sync: true, cwd: EXTENSION_ROOT_DIR_FOR_TESTS }).forEach(
(localizationFile) => {
try {
JSON.parse(fs.readFileSync(path.join(EXTENSION_ROOT_DIR_FOR_TESTS, localizationFile)).toString());
} catch {
filesFailed.push(localizationFile);
}
globSync('package.nls.*.json', { cwd: EXTENSION_ROOT_DIR_FOR_TESTS }).forEach((localizationFile) => {
try {
JSON.parse(fs.readFileSync(path.join(EXTENSION_ROOT_DIR_FOR_TESTS, localizationFile)).toString());
} catch {
filesFailed.push(localizationFile);
}
);
});

expect(filesFailed).to.be.lengthOf(0, `Failed to load JSON for ${filesFailed.join(', ')}`);
});
Expand Down
31 changes: 11 additions & 20 deletions src/test/testRunner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,26 +71,17 @@ export async function run(): Promise<void> {
return promise;
}
// Run the tests.
const files = await glob(`**/**.${testFilesGlob}.js`, { ignore: ['**/**.unit.test.js'], cwd: testsRoot });
files.forEach((file) => mocha.addFile(path.join(testsRoot, file)));

await new Promise<void>((resolve, reject) => {
glob(`**/**.${testFilesGlob}.js`, { ignore: ['**/**.unit.test.js'], cwd: testsRoot }, (error, files) => {
if (error) {
return reject(error);
}
try {
files.forEach((file) => mocha.addFile(path.join(testsRoot, file)));
initializationScript()
.then(() =>
mocha.run((failures) =>
failures > 0 ? reject(new Error(`${failures} total failures`)) : resolve()
)
)
.finally(() => {
stopJupyterServer().catch(noop);
})
.catch(reject);
} catch (error) {
return reject(error);
}
});
initializationScript()
.then(() =>
mocha.run((failures) => (failures > 0 ? reject(new Error(`${failures} total failures`)) : resolve()))
)
.finally(() => {
stopJupyterServer().catch(noop);
})
.catch(reject);
});
}