mirror of
https://github.com/microsoft/vscode.git
synced 2026-02-27 13:16:59 +00:00
disable updates in smoketests
This commit is contained in:
@@ -44,6 +44,7 @@ export interface ParsedArgs {
|
||||
'disable-telemetry'?: boolean;
|
||||
'export-default-configuration'?: string;
|
||||
'install-source'?: string;
|
||||
'disable-updates'?: string;
|
||||
}
|
||||
|
||||
export const IEnvironmentService = createDecorator<IEnvironmentService>('environmentService');
|
||||
@@ -106,4 +107,5 @@ export interface IEnvironmentService {
|
||||
nodeCachedDataDir: string;
|
||||
|
||||
installSource: string;
|
||||
disableUpdates: boolean;
|
||||
}
|
||||
|
||||
@@ -50,7 +50,8 @@ const options: minimist.Opts = {
|
||||
'nolazy',
|
||||
'skip-getting-started',
|
||||
'sticky-quickopen',
|
||||
'disable-telemetry'
|
||||
'disable-telemetry',
|
||||
'disable-updates'
|
||||
],
|
||||
alias: {
|
||||
add: 'a',
|
||||
|
||||
@@ -125,6 +125,8 @@ export class EnvironmentService implements IEnvironmentService {
|
||||
@memoize
|
||||
get nodeCachedDataDir(): string { return this.isBuilt ? path.join(this.userDataPath, 'CachedData', product.commit || new Array(41).join('0')) : undefined; }
|
||||
|
||||
get disableUpdates(): boolean { return !!this._args['disable-updates']; }
|
||||
|
||||
readonly machineUUID: string;
|
||||
|
||||
readonly installSource: string;
|
||||
|
||||
@@ -22,6 +22,7 @@ import product from 'vs/platform/node/product';
|
||||
import { TPromise } from 'vs/base/common/winjs.base';
|
||||
import { IUpdateService, State, IAutoUpdater, IUpdate, IRawUpdate } from 'vs/platform/update/common/update';
|
||||
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
|
||||
|
||||
export class UpdateService implements IUpdateService {
|
||||
|
||||
@@ -87,7 +88,8 @@ export class UpdateService implements IUpdateService {
|
||||
@IRequestService requestService: IRequestService,
|
||||
@ILifecycleService private lifecycleService: ILifecycleService,
|
||||
@IConfigurationService private configurationService: IConfigurationService,
|
||||
@ITelemetryService private telemetryService: ITelemetryService
|
||||
@ITelemetryService private telemetryService: ITelemetryService,
|
||||
@IEnvironmentService private environmentService: IEnvironmentService
|
||||
) {
|
||||
if (process.platform === 'win32') {
|
||||
this.raw = new Win32AutoUpdaterImpl(requestService);
|
||||
@@ -99,6 +101,10 @@ export class UpdateService implements IUpdateService {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.environmentService.disableUpdates) {
|
||||
return;
|
||||
}
|
||||
|
||||
const channel = this.getUpdateChannel();
|
||||
const feedUrl = this.getUpdateFeedUrl(channel);
|
||||
|
||||
|
||||
@@ -127,9 +127,12 @@ export class SpectronApplication {
|
||||
// Prevent Quick Open from closing when focus is stolen, this allows concurrent smoketest suite running
|
||||
args.push('--sticky-quickopen');
|
||||
|
||||
// Disable telemetry for smoke tests
|
||||
// Disable telemetry
|
||||
args.push('--disable-telemetry');
|
||||
|
||||
// Disable updates
|
||||
args.push('--disable-updates');
|
||||
|
||||
// Ensure that running over custom extensions directory, rather than picking up the one that was used by a tester previously
|
||||
args.push(`--extensions-dir=${EXTENSIONS_DIR}`);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user