Skip to content

Commit 87a1936

Browse files
committed
Updates for build to suit VSTS automation
- extend IS_CI_SERVER to include TF_BUILD env var (present on VSTS) - update 'useColor' parameter to mocha to take into account VSTS.
1 parent 5fa57f8 commit 87a1936

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

src/test/constants.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
// Copyright (c) Microsoft Corporation. All rights reserved.
22
// Licensed under the MIT License.
33

4-
// tslint:disable:no-string-literal
54
import { workspace } from 'vscode';
65
import { PythonSettings } from '../client/common/configSettings';
76

8-
export const IS_APPVEYOR = process.env['APPVEYOR'] === 'true';
9-
export const IS_TRAVIS = process.env['TRAVIS'] === 'true';
10-
export const IS_CI_SERVER = IS_TRAVIS || IS_APPVEYOR;
7+
export const IS_APPVEYOR = process.env.APPVEYOR === 'true';
8+
export const IS_TRAVIS = process.env.TRAVIS === 'true';
9+
export const IS_VSTS = process.env.TF_BUILD === 'true';
10+
export const IS_CI_SERVER = IS_TRAVIS || IS_APPVEYOR || IS_VSTS;
1111
export const TEST_TIMEOUT = 25000;
1212
export const IS_MULTI_ROOT_TEST = isMultitrootTest();
13-
export const IS_CI_SERVER_TEST_DEBUGGER = process.env['IS_CI_SERVER_TEST_DEBUGGER'] === '1';
13+
export const IS_CI_SERVER_TEST_DEBUGGER = process.env.IS_CI_SERVER_TEST_DEBUGGER === '1';
1414
// If running on CI server, then run debugger tests ONLY if the corresponding flag is enabled.
1515
export const TEST_DEBUGGER = IS_CI_SERVER ? IS_CI_SERVER_TEST_DEBUGGER : true;
1616

@@ -19,4 +19,4 @@ function isMultitrootTest() {
1919
}
2020

2121
export const IS_ANALYSIS_ENGINE_TEST =
22-
!IS_TRAVIS && (process.env['VSC_PYTHON_ANALYSIS'] === '1' || !PythonSettings.getInstance().jediEnabled);
22+
!IS_TRAVIS && (process.env.VSC_PYTHON_ANALYSIS === '1' || !PythonSettings.getInstance().jediEnabled);

src/test/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ if ((Reflect as any).metadata === undefined) {
44
require('reflect-metadata');
55
}
66
import { MochaSetupOptions } from 'vscode/lib/testrunner';
7-
import { IS_CI_SERVER, IS_CI_SERVER_TEST_DEBUGGER, IS_MULTI_ROOT_TEST } from './constants';
7+
import { IS_CI_SERVER, IS_CI_SERVER_TEST_DEBUGGER,
8+
IS_MULTI_ROOT_TEST, IS_VSTS } from './constants';
89
import * as testRunner from './testRunner';
910

1011
process.env.VSC_PYTHON_CI_TEST = '1';
@@ -20,7 +21,7 @@ const grep = IS_CI_SERVER && IS_CI_SERVER_TEST_DEBUGGER ? 'Debug' : undefined;
2021
// Hack, as retries is not supported as setting in tsd.
2122
const options: MochaSetupOptions & { retries: number } = {
2223
ui: 'tdd',
23-
useColors: true,
24+
useColors: !IS_VSTS,
2425
timeout: 25000,
2526
retries: 3,
2627
grep

0 commit comments

Comments
 (0)