Skip to content

Commit b670a88

Browse files
authored
Remove AlwaysDisplayTestExplorer experiment (#15545)
1 parent be59fe3 commit b670a88

7 files changed

Lines changed: 5 additions & 68 deletions

File tree

experiments.json

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,4 @@
11
[
2-
{
3-
"name": "AlwaysDisplayTestExplorer - experiment",
4-
"salt": "AlwaysDisplayTestExplorer",
5-
"min": 80,
6-
"max": 100
7-
},
8-
{
9-
"name": "AlwaysDisplayTestExplorer - control",
10-
"salt": "AlwaysDisplayTestExplorer",
11-
"min": 0,
12-
"max": 20
13-
},
142
{
153
"name": "ShowPlayIcon - start",
164
"salt": "ShowPlayIcon",

package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1036,7 +1036,6 @@
10361036
"default": [],
10371037
"items": {
10381038
"enum": [
1039-
"AlwaysDisplayTestExplorer - experiment",
10401039
"ShowExtensionSurveyPrompt - enabled",
10411040
"Reload - experiment",
10421041
"AA_testing - experiment",
@@ -1062,7 +1061,6 @@
10621061
"default": [],
10631062
"items": {
10641063
"enum": [
1065-
"AlwaysDisplayTestExplorer - experiment",
10661064
"ShowExtensionSurveyPrompt - enabled",
10671065
"Reload - experiment",
10681066
"AA_testing - experiment",

src/client/common/experiments/groups.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
// Experiment to check whether to always display the test explorer.
2-
export enum AlwaysDisplayTestExplorerGroups {
3-
control = 'AlwaysDisplayTestExplorer - control',
4-
experiment = 'AlwaysDisplayTestExplorer - experiment',
5-
}
6-
71
// Experiment to check whether to show "Extension Survey prompt" or not.
82
export enum ShowExtensionSurveyPrompt {
93
control = 'ShowExtensionSurveyPrompt - control',

src/client/common/experiments/manager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export const experimentStorageKey = 'EXPERIMENT_STORAGE_KEY';
3333
* as about 40% of the users never come back for the second session.
3434
*/
3535
const configFile = path.join(EXTENSION_ROOT_DIR, 'experiments.json');
36-
export const oldExperimentSalts = ['ShowExtensionSurveyPrompt', 'ShowPlayIcon', 'AlwaysDisplayTestExplorer', 'LS'];
36+
export const oldExperimentSalts = ['ShowExtensionSurveyPrompt', 'ShowPlayIcon', 'LS'];
3737

3838
/**
3939
* <DEPRECATED> Manages and stores experiments, implements the AB testing functionality

src/client/testing/main.ts

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,9 @@ import {
1919
IWorkspaceService,
2020
} from '../common/application/types';
2121
import * as constants from '../common/constants';
22-
import { AlwaysDisplayTestExplorerGroups } from '../common/experiments/groups';
2322
import '../common/extensions';
2423
import { traceError } from '../common/logger';
25-
import {
26-
IConfigurationService,
27-
IDisposableRegistry,
28-
IExperimentsManager,
29-
IOutputChannel,
30-
Product,
31-
Resource,
32-
} from '../common/types';
24+
import { IConfigurationService, IDisposableRegistry, IOutputChannel, Product, Resource } from '../common/types';
3325
import { noop } from '../common/utils/misc';
3426
import { IInterpreterService } from '../interpreter/contracts';
3527
import { IServiceContainer } from '../ioc/types';
@@ -128,21 +120,11 @@ export class UnitTestManagementService implements ITestManagementService, Dispos
128120

129121
this.registerHandlers();
130122
this.registerCommands();
131-
this.checkExperiments();
132123
this.autoDiscoverTests(undefined).catch((ex) =>
133124
traceError('Failed to auto discover tests upon activation', ex),
134125
);
135126
await this.registerSymbolProvider(symbolProvider);
136127
}
137-
public checkExperiments() {
138-
const experiments = this.serviceContainer.get<IExperimentsManager>(IExperimentsManager);
139-
if (experiments.inExperiment(AlwaysDisplayTestExplorerGroups.experiment)) {
140-
const commandManager = this.serviceContainer.get<ICommandManager>(ICommandManager);
141-
commandManager.executeCommand('setContext', 'testsDiscovered', true).then(noop, noop);
142-
} else {
143-
experiments.sendTelemetryIfInExperiment(AlwaysDisplayTestExplorerGroups.control);
144-
}
145-
}
146128
public async getTestManager(
147129
displayTestNotConfiguredMessage: boolean,
148130
resource?: Uri,

src/test/common/experiments/manager.unit.test.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -252,12 +252,7 @@ suite('A/B experiments', () => {
252252
verify(crypto.createHash(anything(), 'number', 'FNV')).once();
253253
});
254254
test('Use the expected list of old experiments', async () => {
255-
const expectedOldExperimentSalts = [
256-
'ShowExtensionSurveyPrompt',
257-
'ShowPlayIcon',
258-
'AlwaysDisplayTestExplorer',
259-
'LS',
260-
];
255+
const expectedOldExperimentSalts = ['ShowExtensionSurveyPrompt', 'ShowPlayIcon', 'LS'];
261256
assert.deepEqual(expectedOldExperimentSalts, oldExperimentSalts);
262257
});
263258
});

src/test/testing/main.unit.test.ts

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@ import { anything, instance, mock, verify, when } from 'ts-mockito';
88
import { Disposable } from 'vscode';
99
import { CommandManager } from '../../client/common/application/commandManager';
1010
import { ICommandManager } from '../../client/common/application/types';
11-
import { AlwaysDisplayTestExplorerGroups } from '../../client/common/experiments/groups';
12-
import { ExperimentsManager } from '../../client/common/experiments/manager';
13-
import { IDisposableRegistry, IExperimentsManager } from '../../client/common/types';
11+
import { IDisposableRegistry } from '../../client/common/types';
1412
import { ServiceContainer } from '../../client/ioc/container';
1513
import { IServiceContainer } from '../../client/ioc/types';
1614
import { JediSymbolProvider } from '../../client/providers/symbolProvider';
@@ -20,7 +18,6 @@ suite('Unit Tests - ManagementService', () => {
2018
suite('Experiments', () => {
2119
let serviceContainer: IServiceContainer;
2220
let sandbox: sinon.SinonSandbox;
23-
let experiment: IExperimentsManager;
2421
let commandManager: ICommandManager;
2522
let testManagementService: UnitTestManagementService;
2623
setup(() => {
@@ -32,11 +29,9 @@ suite('Unit Tests - ManagementService', () => {
3229
sandbox.stub(UnitTestManagementService.prototype, 'registerHandlers');
3330
sandbox.stub(UnitTestManagementService.prototype, 'autoDiscoverTests').callsFake(() => Promise.resolve());
3431

35-
experiment = mock(ExperimentsManager);
3632
commandManager = mock(CommandManager);
3733

3834
when(serviceContainer.get<Disposable[]>(IDisposableRegistry)).thenReturn([]);
39-
when(serviceContainer.get<IExperimentsManager>(IExperimentsManager)).thenReturn(instance(experiment));
4035
when(serviceContainer.get<ICommandManager>(ICommandManager)).thenReturn(instance(commandManager));
4136
when(commandManager.executeCommand(anything(), anything(), anything())).thenResolve();
4237

@@ -46,25 +41,10 @@ suite('Unit Tests - ManagementService', () => {
4641
sandbox.restore();
4742
});
4843

49-
test('Execute command if in experiment', async () => {
50-
when(experiment.inExperiment(AlwaysDisplayTestExplorerGroups.experiment)).thenReturn(true);
51-
52-
await testManagementService.activate(instance(mock(JediSymbolProvider)));
53-
54-
verify(commandManager.executeCommand('setContext', 'testsDiscovered', true)).once();
55-
verify(experiment.inExperiment(AlwaysDisplayTestExplorerGroups.experiment)).once();
56-
verify(experiment.inExperiment(AlwaysDisplayTestExplorerGroups.control)).never();
57-
verify(experiment.sendTelemetryIfInExperiment(anything())).never();
58-
});
59-
test('If not in experiment, check and send Telemetry for control group and do not execute command', async () => {
60-
when(experiment.inExperiment(AlwaysDisplayTestExplorerGroups.experiment)).thenReturn(false);
61-
44+
test('Do not execute command', async () => {
6245
await testManagementService.activate(instance(mock(JediSymbolProvider)));
6346

6447
verify(commandManager.executeCommand('setContext', 'testsDiscovered', anything())).never();
65-
verify(experiment.inExperiment(AlwaysDisplayTestExplorerGroups.experiment)).once();
66-
verify(experiment.inExperiment(AlwaysDisplayTestExplorerGroups.control)).never();
67-
verify(experiment.sendTelemetryIfInExperiment(AlwaysDisplayTestExplorerGroups.control)).once();
6848
});
6949
});
7050
});

0 commit comments

Comments
 (0)