mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-01 09:35:41 -05:00
Merge from vscode a348d103d1256a06a2c9b3f9b406298a9fef6898 (#15681)
* Merge from vscode a348d103d1256a06a2c9b3f9b406298a9fef6898 * Fixes and cleanup * Distro * Fix hygiene yarn * delete no yarn lock changes file * Fix hygiene * Fix layer check * Fix CI * Skip lib checks * Remove tests deleted in vs code * Fix tests * Distro * Fix tests and add removed extension point * Skip failing notebook tests for now * Disable broken tests and cleanup build folder * Update yarn.lock and fix smoke tests * Bump sqlite * fix contributed actions and file spacing * Fix user data path * Update yarn.locks Co-authored-by: ADS Merger <karlb@microsoft.com>
This commit is contained in:
@@ -16,13 +16,13 @@ suite('formatOptions', () => {
|
||||
}
|
||||
|
||||
test('Text should display small columns correctly', () => {
|
||||
assert.deepEqual(
|
||||
assert.deepStrictEqual(
|
||||
formatOptions({
|
||||
'add': o('bar')
|
||||
}, 80),
|
||||
[' --add bar']
|
||||
);
|
||||
assert.deepEqual(
|
||||
assert.deepStrictEqual(
|
||||
formatOptions({
|
||||
'add': o('bar'),
|
||||
'wait': o('ba'),
|
||||
@@ -36,7 +36,7 @@ suite('formatOptions', () => {
|
||||
});
|
||||
|
||||
test('Text should wrap', () => {
|
||||
assert.deepEqual(
|
||||
assert.deepStrictEqual(
|
||||
formatOptions({
|
||||
'add': o((<any>'bar ').repeat(9))
|
||||
}, 40),
|
||||
@@ -47,7 +47,7 @@ suite('formatOptions', () => {
|
||||
});
|
||||
|
||||
test('Text should revert to the condensed view when the terminal is too narrow', () => {
|
||||
assert.deepEqual(
|
||||
assert.deepStrictEqual(
|
||||
formatOptions({
|
||||
'add': o((<any>'bar ').repeat(9))
|
||||
}, 30),
|
||||
@@ -58,11 +58,11 @@ suite('formatOptions', () => {
|
||||
});
|
||||
|
||||
test('addArg', () => {
|
||||
assert.deepEqual(addArg([], 'foo'), ['foo']);
|
||||
assert.deepEqual(addArg([], 'foo', 'bar'), ['foo', 'bar']);
|
||||
assert.deepEqual(addArg(['foo'], 'bar'), ['foo', 'bar']);
|
||||
assert.deepEqual(addArg(['--wait'], 'bar'), ['--wait', 'bar']);
|
||||
assert.deepEqual(addArg(['--wait', '--', '--foo'], 'bar'), ['--wait', 'bar', '--', '--foo']);
|
||||
assert.deepEqual(addArg(['--', '--foo'], 'bar'), ['bar', '--', '--foo']);
|
||||
assert.deepStrictEqual(addArg([], 'foo'), ['foo']);
|
||||
assert.deepStrictEqual(addArg([], 'foo', 'bar'), ['foo', 'bar']);
|
||||
assert.deepStrictEqual(addArg(['foo'], 'bar'), ['foo', 'bar']);
|
||||
assert.deepStrictEqual(addArg(['--wait'], 'bar'), ['--wait', 'bar']);
|
||||
assert.deepStrictEqual(addArg(['--wait', '--', '--foo'], 'bar'), ['--wait', 'bar', '--', '--foo']);
|
||||
assert.deepStrictEqual(addArg(['--', '--foo'], 'bar'), ['bar', '--', '--foo']);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -4,9 +4,10 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as assert from 'assert';
|
||||
import * as path from 'vs/base/common/path';
|
||||
import { parseArgs, OPTIONS } from 'vs/platform/environment/node/argv';
|
||||
import { parseExtensionHostPort, parseUserDataDir } from 'vs/platform/environment/node/environmentService';
|
||||
import { parseExtensionHostPort } from 'vs/platform/environment/common/environmentService';
|
||||
import { NativeEnvironmentService } from 'vs/platform/environment/node/environmentService';
|
||||
import product from 'vs/platform/product/common/product';
|
||||
|
||||
suite('EnvironmentService', () => {
|
||||
|
||||
@@ -44,15 +45,6 @@ suite('EnvironmentService', () => {
|
||||
assert.deepStrictEqual(parse(['--inspect-extensions=1234', '--inspect-brk-extensions=5678', '--debugId=7']), { port: 5678, break: true, debugId: '7' });
|
||||
});
|
||||
|
||||
test('userDataPath', () => {
|
||||
const parse = (a: string[], b: { cwd: () => string, env: { [key: string]: string } }) => parseUserDataDir(parseArgs(a, OPTIONS), <any>b);
|
||||
|
||||
assert.equal(parse(['--user-data-dir', './dir'], { cwd: () => '/foo', env: {} }), path.resolve('/foo/dir'),
|
||||
'should use cwd when --user-data-dir is specified');
|
||||
assert.equal(parse(['--user-data-dir', './dir'], { cwd: () => '/foo', env: { 'VSCODE_CWD': '/bar' } }), path.resolve('/bar/dir'),
|
||||
'should use VSCODE_CWD as the cwd when --user-data-dir is specified');
|
||||
});
|
||||
|
||||
// https://github.com/microsoft/vscode/issues/78440
|
||||
test('careful with boolean file names', function () {
|
||||
let actual = parseArgs(['-r', 'arg.txt'], OPTIONS);
|
||||
@@ -63,4 +55,15 @@ suite('EnvironmentService', () => {
|
||||
assert(actual['reuse-window']);
|
||||
assert.deepStrictEqual(actual._, ['true.txt']);
|
||||
});
|
||||
|
||||
test('userDataDir', () => {
|
||||
const service1 = new NativeEnvironmentService(parseArgs(process.argv, OPTIONS), { _serviceBrand: undefined, ...product });
|
||||
assert.ok(service1.userDataPath.length > 0);
|
||||
|
||||
const args = parseArgs(process.argv, OPTIONS);
|
||||
args['user-data-dir'] = '/userDataDir/folder';
|
||||
|
||||
const service2 = new NativeEnvironmentService(args, { _serviceBrand: undefined, ...product });
|
||||
assert.notStrictEqual(service1.userDataPath, service2.userDataPath);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -37,9 +37,9 @@ suite('Native Modules (all platforms)', () => {
|
||||
assert.ok(typeof spdlog.createRotatingLogger === 'function', testErrorMessage('spdlog'));
|
||||
});
|
||||
|
||||
test('vscode-nsfw', async () => {
|
||||
const nsfWatcher = await import('vscode-nsfw');
|
||||
assert.ok(typeof nsfWatcher === 'function', testErrorMessage('vscode-nsfw'));
|
||||
test('nsfw', async () => {
|
||||
const nsfWatcher = await import('nsfw');
|
||||
assert.ok(typeof nsfWatcher === 'function', testErrorMessage('nsfw'));
|
||||
});
|
||||
|
||||
test('vscode-sqlite3', async () => {
|
||||
|
||||
59
src/vs/platform/environment/test/node/userDataPath.test.ts
Normal file
59
src/vs/platform/environment/test/node/userDataPath.test.ts
Normal file
@@ -0,0 +1,59 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as assert from 'assert';
|
||||
import { OPTIONS, parseArgs } from 'vs/platform/environment/node/argv';
|
||||
import { getUserDataPath } from 'vs/platform/environment/node/userDataPath';
|
||||
|
||||
suite('User data path', () => {
|
||||
|
||||
test('getUserDataPath - default', () => {
|
||||
const path = getUserDataPath(parseArgs(process.argv, OPTIONS));
|
||||
assert.ok(path.length > 0);
|
||||
});
|
||||
|
||||
test('getUserDataPath - portable mode', () => {
|
||||
const origPortable = process.env['VSCODE_PORTABLE'];
|
||||
try {
|
||||
const portableDir = 'portable-dir';
|
||||
process.env['VSCODE_PORTABLE'] = portableDir;
|
||||
|
||||
const path = getUserDataPath(parseArgs(process.argv, OPTIONS));
|
||||
assert.ok(path.includes(portableDir));
|
||||
} finally {
|
||||
if (typeof origPortable === 'string') {
|
||||
process.env['VSCODE_PORTABLE'] = origPortable;
|
||||
} else {
|
||||
delete process.env['VSCODE_PORTABLE'];
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
test('getUserDataPath - --user-data-dir', () => {
|
||||
const cliUserDataDir = 'cli-data-dir';
|
||||
const args = parseArgs(process.argv, OPTIONS);
|
||||
args['user-data-dir'] = cliUserDataDir;
|
||||
|
||||
const path = getUserDataPath(args);
|
||||
assert.ok(path.includes(cliUserDataDir));
|
||||
});
|
||||
|
||||
test('getUserDataPath - VSCODE_APPDATA', () => {
|
||||
const origAppData = process.env['VSCODE_APPDATA'];
|
||||
try {
|
||||
const appDataDir = 'appdata-dir';
|
||||
process.env['VSCODE_APPDATA'] = appDataDir;
|
||||
|
||||
const path = getUserDataPath(parseArgs(process.argv, OPTIONS));
|
||||
assert.ok(path.includes(appDataDir));
|
||||
} finally {
|
||||
if (typeof origAppData === 'string') {
|
||||
process.env['VSCODE_APPDATA'] = origAppData;
|
||||
} else {
|
||||
delete process.env['VSCODE_APPDATA'];
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user