From e00884c2af8f302297d44c61d697caa2bf7a7567 Mon Sep 17 00:00:00 2001 From: Eric Snow Date: Wed, 1 Jan 2020 11:27:36 -0700 Subject: [PATCH 1/6] Disable problematic tests on OSX. --- .../common/platform/filesystem.functional.test.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/test/common/platform/filesystem.functional.test.ts b/src/test/common/platform/filesystem.functional.test.ts index d3759d69c301..f454c2de6c3c 100644 --- a/src/test/common/platform/filesystem.functional.test.ts +++ b/src/test/common/platform/filesystem.functional.test.ts @@ -10,6 +10,7 @@ import { convertStat, FileSystem } from '../../../client/common/platform/fileSys import { PlatformService } from '../../../client/common/platform/platformService'; import { FileType, TemporaryFile } from '../../../client/common/platform/types'; import { sleep } from '../../../client/common/utils/async'; +import { getOSType, OSType } from '../../../client/common/utils/platform'; import { assertDoesNotExist, assertExists, DOES_NOT_EXIST, fixPath, FSFixture, SUPPORTS_SYMLINKS, WINDOWS @@ -20,6 +21,8 @@ const assertArrays = require('chai-arrays'); use(require('chai-as-promised')); use(assertArrays); +const platform = getOSType(); + suite('FileSystem', () => { let fileSystem: FileSystem; let fix: FSFixture; @@ -87,7 +90,14 @@ suite('FileSystem', () => { suite('getRealPath', () => { const prevCwd = process.cwd(); let cwd: string; - setup(async () => { + setup(async function() { + if (platform === OSType.OSX) { + // tslint:disable-next-line:no-suspicious-comment + // TODO(GH-8995) This test is failing on Mac, so we are + // temporarily disabling it. + // tslint:disable-next-line:no-invalid-this + return this.skip(); + } cwd = await fix.createDirectory('x/y/z'); process.chdir(cwd); }); From d2a17122a242b01049c0f89ff21d9018d730ec73 Mon Sep 17 00:00:00 2001 From: Eric Snow Date: Wed, 1 Jan 2020 11:31:13 -0700 Subject: [PATCH 2/6] Disable problematic tests on Windows. --- .../common/platform/filesystem.functional.test.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/test/common/platform/filesystem.functional.test.ts b/src/test/common/platform/filesystem.functional.test.ts index f454c2de6c3c..ce098040d273 100644 --- a/src/test/common/platform/filesystem.functional.test.ts +++ b/src/test/common/platform/filesystem.functional.test.ts @@ -93,8 +93,8 @@ suite('FileSystem', () => { setup(async function() { if (platform === OSType.OSX) { // tslint:disable-next-line:no-suspicious-comment - // TODO(GH-8995) This test is failing on Mac, so we are - // temporarily disabling it. + // TODO(GH-8995) These tests are failing on Mac, so + // we are temporarily disabling it. // tslint:disable-next-line:no-invalid-this return this.skip(); } @@ -312,6 +312,15 @@ suite('FileSystem', () => { }); suite('listdir', () => { + setup(function() { + if (WINDOWS) { + // tslint:disable-next-line:no-suspicious-comment + // TODO(GH-8995) These tests are failing on Windows, + // so we are // temporarily disabling it. + // tslint:disable-next-line:no-invalid-this + return this.skip(); + } + }); if (SUPPORTS_SYMLINKS) { test('mixed', async () => { // Create the target directory and its contents. From b873ff9cff945a0a1dbfea104bd022e34720fd88 Mon Sep 17 00:00:00 2001 From: Eric Snow Date: Wed, 1 Jan 2020 12:07:23 -0700 Subject: [PATCH 3/6] Address a couple other failures on OSX and Windows. --- .../platform/filesystem.functional.test.ts | 78 ++++++++++++++----- src/test/common/platform/utils.ts | 6 ++ 2 files changed, 63 insertions(+), 21 deletions(-) diff --git a/src/test/common/platform/filesystem.functional.test.ts b/src/test/common/platform/filesystem.functional.test.ts index ce098040d273..691ba84a5558 100644 --- a/src/test/common/platform/filesystem.functional.test.ts +++ b/src/test/common/platform/filesystem.functional.test.ts @@ -10,10 +10,9 @@ import { convertStat, FileSystem } from '../../../client/common/platform/fileSys import { PlatformService } from '../../../client/common/platform/platformService'; import { FileType, TemporaryFile } from '../../../client/common/platform/types'; import { sleep } from '../../../client/common/utils/async'; -import { getOSType, OSType } from '../../../client/common/utils/platform'; import { assertDoesNotExist, assertExists, DOES_NOT_EXIST, fixPath, FSFixture, - SUPPORTS_SYMLINKS, WINDOWS + OSX, SUPPORTS_SOCKETS, SUPPORTS_SYMLINKS, WINDOWS } from './utils'; // tslint:disable:no-require-imports no-var-requires @@ -21,8 +20,6 @@ const assertArrays = require('chai-arrays'); use(require('chai-as-promised')); use(assertArrays); -const platform = getOSType(); - suite('FileSystem', () => { let fileSystem: FileSystem; let fix: FSFixture; @@ -91,7 +88,7 @@ suite('FileSystem', () => { const prevCwd = process.cwd(); let cwd: string; setup(async function() { - if (platform === OSType.OSX) { + if (OSX) { // tslint:disable-next-line:no-suspicious-comment // TODO(GH-8995) These tests are failing on Mac, so // we are temporarily disabling it. @@ -312,15 +309,6 @@ suite('FileSystem', () => { }); suite('listdir', () => { - setup(function() { - if (WINDOWS) { - // tslint:disable-next-line:no-suspicious-comment - // TODO(GH-8995) These tests are failing on Windows, - // so we are // temporarily disabling it. - // tslint:disable-next-line:no-invalid-this - return this.skip(); - } - }); if (SUPPORTS_SYMLINKS) { test('mixed', async () => { // Create the target directory and its contents. @@ -378,7 +366,7 @@ suite('FileSystem', () => { [subdir, FileType.Directory] ]); }); - } else { + } else if (SUPPORTS_SOCKETS) { test('mixed', async () => { // Create the target directory and its contents. const dirname = await fix.createDirectory('x/y/z'); @@ -405,6 +393,31 @@ suite('FileSystem', () => { [subdir, FileType.Directory] ]); }); + } else { + test('mixed', async () => { + // Create the target directory and its contents. + const dirname = await fix.createDirectory('x/y/z'); + const file1 = await fix.createFile('x/y/z/__init__.py', ''); + const script = await fix.createFile('x/y/z/__main__.py', '