mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-07 17:23:56 -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:
@@ -8,9 +8,9 @@ import { join } from 'vs/base/common/path';
|
||||
import { tmpdir } from 'os';
|
||||
import { promises } from 'fs';
|
||||
import { rimraf, writeFile } from 'vs/base/node/pfs';
|
||||
import { getRandomTestPath } from 'vs/base/test/node/testUtils';
|
||||
import { flakySuite, getRandomTestPath } from 'vs/base/test/node/testUtils';
|
||||
|
||||
suite('Crypto', () => {
|
||||
flakySuite('Crypto', () => {
|
||||
|
||||
let testDir: string;
|
||||
|
||||
|
||||
@@ -10,10 +10,9 @@ import { join, sep } from 'vs/base/common/path';
|
||||
import { generateUuid } from 'vs/base/common/uuid';
|
||||
import { copy, exists, move, readdir, readDirsInDir, rimraf, RimRafMode, rimrafSync, SymlinkSupport, writeFile, writeFileSync } from 'vs/base/node/pfs';
|
||||
import { timeout } from 'vs/base/common/async';
|
||||
import { getPathFromAmdModule } from 'vs/base/common/amd';
|
||||
import { canNormalize } from 'vs/base/common/normalization';
|
||||
import { VSBuffer } from 'vs/base/common/buffer';
|
||||
import { flakySuite, getRandomTestPath } from 'vs/base/test/node/testUtils';
|
||||
import { flakySuite, getRandomTestPath, getPathFromAmdModule } from 'vs/base/test/node/testUtils';
|
||||
import { isWindows } from 'vs/base/common/platform';
|
||||
|
||||
flakySuite('PFS', function () {
|
||||
@@ -232,14 +231,19 @@ flakySuite('PFS', function () {
|
||||
assert.ok(!symbolicLink2);
|
||||
}
|
||||
|
||||
// Copy ignores dangling symlinks
|
||||
// Copy does not fail over dangling symlinks
|
||||
|
||||
await rimraf(copyTarget);
|
||||
await rimraf(symbolicLinkTarget);
|
||||
|
||||
await copy(symLink, copyTarget, { preserveSymlinks: true }); // this should not throw
|
||||
|
||||
assert.ok(!fs.existsSync(copyTarget));
|
||||
if (!isWindows) {
|
||||
const { symbolicLink } = await SymlinkSupport.stat(copyTarget);
|
||||
assert.ok(symbolicLink?.dangling);
|
||||
} else {
|
||||
assert.ok(!fs.existsSync(copyTarget));
|
||||
}
|
||||
});
|
||||
|
||||
test('copy handles symbolic links when the reference is inside source', async () => {
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
import * as assert from 'assert';
|
||||
import * as fs from 'fs';
|
||||
import * as os from 'os';
|
||||
import * as platform from 'vs/base/common/platform';
|
||||
import { enumeratePowerShellInstallations, getFirstAvailablePowerShellInstallation, IPowerShellExeDetails } from 'vs/base/node/powershell';
|
||||
|
||||
@@ -40,44 +39,20 @@ if (platform.isWindows) {
|
||||
});
|
||||
|
||||
test('Can enumerate PowerShells', async () => {
|
||||
const isOS64Bit = os.arch() === 'x64';
|
||||
const pwshs = new Array<IPowerShellExeDetails>();
|
||||
for await (const p of enumeratePowerShellInstallations()) {
|
||||
pwshs.push(p);
|
||||
}
|
||||
|
||||
const powershellLog = 'Found these PowerShells:\n' + pwshs.map(p => `${p.displayName}: ${p.exePath}`).join('\n');
|
||||
assert.strictEqual(pwshs.length >= (isOS64Bit ? 2 : 1), true, powershellLog);
|
||||
assert.strictEqual(pwshs.length >= 1, true, powershellLog);
|
||||
|
||||
for (const pwsh of pwshs) {
|
||||
checkPath(pwsh.exePath);
|
||||
}
|
||||
|
||||
|
||||
const lastIndex = pwshs.length - 1;
|
||||
const secondToLastIndex = pwshs.length - 2;
|
||||
|
||||
// 64bit process on 64bit OS
|
||||
if (process.arch === 'x64') {
|
||||
checkPath(pwshs[secondToLastIndex].exePath);
|
||||
assert.strictEqual(pwshs[secondToLastIndex].displayName, 'Windows PowerShell', powershellLog);
|
||||
|
||||
checkPath(pwshs[lastIndex].exePath);
|
||||
assert.strictEqual(pwshs[lastIndex].displayName, 'Windows PowerShell (x86)', powershellLog);
|
||||
} else if (isOS64Bit) {
|
||||
// 32bit process on 64bit OS
|
||||
|
||||
// Windows PowerShell x86 comes first if vscode is 32bit
|
||||
checkPath(pwshs[secondToLastIndex].exePath);
|
||||
assert.strictEqual(pwshs[secondToLastIndex].displayName, 'Windows PowerShell (x86)', powershellLog);
|
||||
|
||||
checkPath(pwshs[lastIndex].exePath);
|
||||
assert.strictEqual(pwshs[lastIndex].displayName, 'Windows PowerShell', powershellLog);
|
||||
} else {
|
||||
// 32bit or ARM process
|
||||
checkPath(pwshs[lastIndex].exePath);
|
||||
assert.strictEqual(pwshs[lastIndex].displayName, 'Windows PowerShell (x86)', powershellLog);
|
||||
}
|
||||
// The last one should always be Windows PowerShell.
|
||||
assert.strictEqual(pwshs[pwshs.length - 1].displayName, 'Windows PowerShell', powershellLog);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import * as cp from 'child_process';
|
||||
import * as objects from 'vs/base/common/objects';
|
||||
import * as platform from 'vs/base/common/platform';
|
||||
import * as processes from 'vs/base/node/processes';
|
||||
import { getPathFromAmdModule } from 'vs/base/common/amd';
|
||||
import { getPathFromAmdModule } from 'vs/base/test/node/testUtils';
|
||||
|
||||
function fork(id: string): cp.ChildProcess {
|
||||
const opts: any = {
|
||||
@@ -46,11 +46,11 @@ suite('Processes', () => {
|
||||
counter++;
|
||||
|
||||
if (counter === 1) {
|
||||
assert.equal(msgFromChild, msg1);
|
||||
assert.strictEqual(msgFromChild, msg1);
|
||||
} else if (counter === 2) {
|
||||
assert.equal(msgFromChild, msg2);
|
||||
assert.strictEqual(msgFromChild, msg2);
|
||||
} else if (counter === 3) {
|
||||
assert.equal(msgFromChild, msg3);
|
||||
assert.strictEqual(msgFromChild, msg3);
|
||||
|
||||
child.kill();
|
||||
done();
|
||||
|
||||
@@ -5,12 +5,17 @@
|
||||
|
||||
import type { Suite } from 'mocha';
|
||||
import { join } from 'vs/base/common/path';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { generateUuid } from 'vs/base/common/uuid';
|
||||
|
||||
export function getRandomTestPath(tmpdir: string, ...segments: string[]): string {
|
||||
return join(tmpdir, ...segments, generateUuid());
|
||||
}
|
||||
|
||||
export function getPathFromAmdModule(requirefn: typeof require, relativePath: string): string {
|
||||
return URI.parse(requirefn.toUrl(relativePath)).fsPath;
|
||||
}
|
||||
|
||||
export function flakySuite(title: string, fn: (this: Suite) => void): Suite {
|
||||
return suite(title, function () {
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
import * as assert from 'assert';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { readFileSync } from 'fs';
|
||||
import { getPathFromAmdModule } from 'vs/base/common/amd';
|
||||
import { getPathFromAmdModule } from 'vs/base/test/node/testUtils';
|
||||
|
||||
suite('URI - perf', function () {
|
||||
|
||||
|
||||
@@ -9,9 +9,8 @@ import { tmpdir } from 'os';
|
||||
import { promises } from 'fs';
|
||||
import { extract } from 'vs/base/node/zip';
|
||||
import { rimraf, exists } from 'vs/base/node/pfs';
|
||||
import { getPathFromAmdModule } from 'vs/base/common/amd';
|
||||
import { createCancelablePromise } from 'vs/base/common/async';
|
||||
import { getRandomTestPath } from 'vs/base/test/node/testUtils';
|
||||
import { getRandomTestPath, getPathFromAmdModule } from 'vs/base/test/node/testUtils';
|
||||
|
||||
suite('Zip', () => {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user