tests - skip flaky in node.js env (#137853)

This commit is contained in:
Benjamin Pasero 2021-11-26 08:56:58 +01:00
parent d18d093403
commit 01d1ea52e6
No known key found for this signature in database
GPG key ID: E6380CC4C8219E65
2 changed files with 11 additions and 2 deletions

View file

@ -11,6 +11,7 @@ let _isLinux = false;
let _isLinuxSnap = false;
let _isNative = false;
let _isWeb = false;
let _isElectron = false;
let _isIOS = false;
let _locale: string | undefined = undefined;
let _language: string = LANGUAGE_DEFAULT;
@ -61,7 +62,8 @@ if (typeof globals.vscode !== 'undefined' && typeof globals.vscode.process !== '
nodeProcess = process;
}
const isElectronRenderer = typeof nodeProcess?.versions?.electron === 'string' && nodeProcess.type === 'renderer';
const isElectronProcess = typeof nodeProcess?.versions?.electron === 'string';
const isElectronRenderer = isElectronProcess && nodeProcess?.type === 'renderer';
export const isElectronSandboxed = isElectronRenderer && nodeProcess?.sandboxed;
interface INavigator {
@ -89,6 +91,7 @@ else if (typeof nodeProcess === 'object') {
_isMacintosh = (nodeProcess.platform === 'darwin');
_isLinux = (nodeProcess.platform === 'linux');
_isLinuxSnap = _isLinux && !!nodeProcess.env['SNAP'] && !!nodeProcess.env['SNAP_REVISION'];
_isElectron = isElectronProcess;
_locale = LANGUAGE_DEFAULT;
_language = LANGUAGE_DEFAULT;
const rawNlsConfig = nodeProcess.env['VSCODE_NLS_CONFIG'];
@ -140,6 +143,7 @@ export const isMacintosh = _isMacintosh;
export const isLinux = _isLinux;
export const isLinuxSnap = _isLinuxSnap;
export const isNative = _isNative;
export const isElectron = _isElectron;
export const isWeb = _isWeb;
export const isIOS = _isIOS;
export const platform = _platform;

View file

@ -18,6 +18,7 @@ import { TestResultService } from 'vs/workbench/contrib/testing/common/testResul
import { InMemoryResultStorage, ITestResultStorage } from 'vs/workbench/contrib/testing/common/testResultStorage';
import { Convert, getInitializedMainTestCollection, TestItemImpl, testStubs } from 'vs/workbench/contrib/testing/common/testStubs';
import { TestStorageService } from 'vs/workbench/test/common/workbenchTestServices';
import { isNative, isElectron } from 'vs/base/common/platform';
export const emptyOutputController = () => new LiveOutputController(
new Lazy(() => [newWriteableBufferStream(), Promise.resolve()]),
@ -311,7 +312,11 @@ suite('Workbench - Test Results Service', () => {
});
});
test('resultItemParents', () => {
test('resultItemParents', function () {
if (isNative && !isElectron) {
this.skip(); // TODO@connor4312 https://github.com/microsoft/vscode/issues/137853
}
assert.deepStrictEqual([...resultItemParents(r, r.getStateById(new TestId(['ctrlId', 'id-a', 'id-aa']).toString())!)], [
r.getStateById(new TestId(['ctrlId', 'id-a', 'id-aa']).toString()),
r.getStateById(new TestId(['ctrlId', 'id-a']).toString()),