Skip to content

Commit

Permalink
disable updates in smoketests
Browse files Browse the repository at this point in the history
  • Loading branch information
joaomoreno committed Oct 4, 2017
1 parent 1c4896e commit 08e6c5d
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/vs/platform/environment/common/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -106,4 +107,5 @@ export interface IEnvironmentService {
nodeCachedDataDir: string;

installSource: string;
disableUpdates: boolean;
}
3 changes: 2 additions & 1 deletion src/vs/platform/environment/node/argv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ const options: minimist.Opts = {
'nolazy',
'skip-getting-started',
'sticky-quickopen',
'disable-telemetry'
'disable-telemetry',
'disable-updates'
],
alias: {
add: 'a',
Expand Down
2 changes: 2 additions & 0 deletions src/vs/platform/environment/node/environmentService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 7 additions & 1 deletion src/vs/platform/update/electron-main/updateService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down Expand Up @@ -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);
Expand All @@ -99,6 +101,10 @@ export class UpdateService implements IUpdateService {
return;
}

if (this.environmentService.disableUpdates) {
return;
}

const channel = this.getUpdateChannel();
const feedUrl = this.getUpdateFeedUrl(channel);

Expand Down
5 changes: 4 additions & 1 deletion test/smoke/src/spectron/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`);

Expand Down

0 comments on commit 08e6c5d

Please sign in to comment.