forked from microsoft/vscode-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconstants.ts
More file actions
42 lines (36 loc) · 1.66 KB
/
constants.ts
File metadata and controls
42 lines (36 loc) · 1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
import * as path from 'path';
import { IS_CI_SERVER, IS_CI_SERVER_TEST_DEBUGGER } from './ciConstants';
// Activating extension for Multiroot and Debugger CI tests for Windows takes just over 2 minutes sometimes, so 3 minutes seems like a safe margin
export const MAX_EXTENSION_ACTIVATION_TIME = 180_000;
export const TEST_TIMEOUT = 25000;
export const TEST_RETRYCOUNT = 3;
export const IS_SMOKE_TEST = process.env.VSC_PYTHON_SMOKE_TEST === '1';
export const IS_PERF_TEST = process.env.VSC_PYTHON_PERF_TEST === '1';
export const IS_MULTI_ROOT_TEST = isMultitrootTest();
// If running on CI server, then run debugger tests ONLY if the corresponding flag is enabled.
export const TEST_DEBUGGER = IS_CI_SERVER ? IS_CI_SERVER_TEST_DEBUGGER : true;
function isMultitrootTest() {
// No need to run smoke nor perf tests in a multi-root environment.
if (IS_SMOKE_TEST || IS_PERF_TEST) {
return false;
}
try {
// tslint:disable-next-line:no-require-imports
const vscode = require('vscode');
const workspace = vscode.workspace;
return Array.isArray(workspace.workspaceFolders) && workspace.workspaceFolders.length > 1;
} catch {
// being accessed, when VS Code hasn't been launched.
return false;
}
}
export const EXTENSION_ROOT_DIR_FOR_TESTS = path.join(__dirname, '..', '..');
export const PVSC_EXTENSION_ID_FOR_TESTS = 'ms-python.python';
export const SMOKE_TEST_EXTENSIONS_DIR = path.join(
EXTENSION_ROOT_DIR_FOR_TESTS,
'tmp',
'ext',
'smokeTestExtensionsFolder'
);