Skip to content

Commit 1f7f21a

Browse files
authored
Enable experiment for always displaying the test explorer (#6330)
1 parent 3434854 commit 1f7f21a

4 files changed

Lines changed: 20 additions & 7 deletions

File tree

‎experiments.json‎

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,14 @@
1-
[]
1+
[
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+
}
14+
]

‎src/client/common/experimentGroups.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ export const LSEnabled = 'LS - enabled';
44
// Experiment to check whether to always display the test explorer.
55
export enum AlwaysDisplayTestExplorerGroups {
66
control = 'AlwaysDisplayTestExplorer - control',
7-
enabled = 'AlwaysDisplayTestExplorer - enabled'
7+
experiment = 'AlwaysDisplayTestExplorer - experiment'
88
}

‎src/client/testing/main.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export class UnitTestManagementService implements ITestManagementService, Dispos
7474
}
7575
public checkExperiments() {
7676
const experiments = this.serviceContainer.get<IExperimentsManager>(IExperimentsManager);
77-
if (experiments.inExperiment(AlwaysDisplayTestExplorerGroups.enabled)) {
77+
if (experiments.inExperiment(AlwaysDisplayTestExplorerGroups.experiment)) {
7878
const commandManager = this.serviceContainer.get<ICommandManager>(ICommandManager);
7979
commandManager.executeCommand('setContext', 'testsDiscovered', true).then(noop, noop);
8080
} else {

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,22 +47,22 @@ suite('Unit Tests - ManagementService', () => {
4747
});
4848

4949
test('Execute command if in experiment', async () => {
50-
when(experiment.inExperiment(AlwaysDisplayTestExplorerGroups.enabled)).thenReturn(true);
50+
when(experiment.inExperiment(AlwaysDisplayTestExplorerGroups.experiment)).thenReturn(true);
5151

5252
await testManagementService.activate(instance(mock(JediSymbolProvider)));
5353

5454
verify(commandManager.executeCommand('setContext', 'testsDiscovered', true)).once();
55-
verify(experiment.inExperiment(AlwaysDisplayTestExplorerGroups.enabled)).once();
55+
verify(experiment.inExperiment(AlwaysDisplayTestExplorerGroups.experiment)).once();
5656
verify(experiment.inExperiment(AlwaysDisplayTestExplorerGroups.control)).never();
5757
verify(experiment.sendTelemetryIfInExperiment(anything())).never();
5858
});
5959
test('If not in experiment, check and send Telemetry for control group and do not execute command', async () => {
60-
when(experiment.inExperiment(AlwaysDisplayTestExplorerGroups.enabled)).thenReturn(false);
60+
when(experiment.inExperiment(AlwaysDisplayTestExplorerGroups.experiment)).thenReturn(false);
6161

6262
await testManagementService.activate(instance(mock(JediSymbolProvider)));
6363

6464
verify(commandManager.executeCommand('setContext', 'testsDiscovered', anything())).never();
65-
verify(experiment.inExperiment(AlwaysDisplayTestExplorerGroups.enabled)).once();
65+
verify(experiment.inExperiment(AlwaysDisplayTestExplorerGroups.experiment)).once();
6666
verify(experiment.inExperiment(AlwaysDisplayTestExplorerGroups.control)).never();
6767
verify(experiment.sendTelemetryIfInExperiment(AlwaysDisplayTestExplorerGroups.control)).once();
6868
});

0 commit comments

Comments
 (0)