From ce6b22000830fae30e361ec860d2503ed5e72aed Mon Sep 17 00:00:00 2001 From: Luciana Date: Mon, 28 Oct 2019 15:33:04 -0700 Subject: [PATCH 1/3] Changing NewDebugAdapter experiment to be on for 50% of insiders users --- experiments.json | 10 +++++----- src/client/common/experimentGroups.ts | 6 +++--- src/test/extension.unit.test.ts | 22 +++++++++++----------- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/experiments.json b/experiments.json index c6327eeba69d..565efa3b4df6 100644 --- a/experiments.json +++ b/experiments.json @@ -30,16 +30,16 @@ "max": 20 }, { - "name": "DebugAdapterFactory - control", + "name": "DebugAdapterFactoryInsiders - control", "salt": "DebugAdapterFactory", "min": 0, - "max": 0 + "max": 50 }, { - "name": "DebugAdapterFactory - experiment", + "name": "DebugAdapterFactoryInsiders - experiment", "salt": "DebugAdapterFactory", - "min": 0, - "max": 0 + "min": 50, + "max": 100 }, { "name": "PtvsdWheels37 - control", diff --git a/src/client/common/experimentGroups.ts b/src/client/common/experimentGroups.ts index 9ca508801ec9..8b2df2035482 100644 --- a/src/client/common/experimentGroups.ts +++ b/src/client/common/experimentGroups.ts @@ -14,9 +14,9 @@ export enum ShowExtensionSurveyPrompt { } // Experiment to check whether the extension should use the new VS Code debug adapter API. -export enum DebugAdapterDescriptorFactory { - control = 'DebugAdapterFactory - control', - experiment = 'DebugAdapterFactory - experiment' +export enum DebugAdapterDescriptorFactoryInsiders { + control = 'DebugAdapterFactoryInsiders - control', + experiment = 'DebugAdapterFactoryInsiders - experiment' } // Experiment to check whether the ptvsd launcher should use pre-installed ptvsd wheels for debugging. diff --git a/src/test/extension.unit.test.ts b/src/test/extension.unit.test.ts index d6d4f878b677..5097634d310a 100644 --- a/src/test/extension.unit.test.ts +++ b/src/test/extension.unit.test.ts @@ -23,31 +23,31 @@ suite('Extension API Debugger', () => { const ptvsdPath = path.join('path', 'to', 'ptvsd'); let experimentsManager: IExperimentsManager; - let debugAdapterFactory: IDebugAdapterDescriptorFactory; + let debugAdapterFactoryInsiders: IDebugAdapterDescriptorFactory; let configurationService: IConfigurationService; setup(() => { experimentsManager = mock(ExperimentsManager); - debugAdapterFactory = mock(DebugAdapterDescriptorFactory); + debugAdapterFactoryInsiders = mock(DebugAdapterDescriptorFactory); configurationService = mock(ConfigurationService); }); function mockInExperiment() { when(experimentsManager.inExperiment(anyString())).thenReturn(true); - when(debugAdapterFactory.useNewPtvsd(anyString())).thenResolve(true); - when(debugAdapterFactory.getPtvsdPath()).thenReturn(ptvsdPath); + when(debugAdapterFactoryInsiders.useNewPtvsd(anyString())).thenResolve(true); + when(debugAdapterFactoryInsiders.getPtvsdPath()).thenReturn(ptvsdPath); when(configurationService.getSettings(undefined)).thenReturn(({ pythonPath: 'python' } as any) as IPythonSettings); } function mockNotInExperiment() { when(experimentsManager.inExperiment(anyString())).thenReturn(false); - when(debugAdapterFactory.useNewPtvsd(anyString())).thenResolve(false); + when(debugAdapterFactoryInsiders.useNewPtvsd(anyString())).thenResolve(false); } test('Test debug launcher args (no-wait and not in experiment)', async () => { mockNotInExperiment(); - const args = await buildApi(Promise.resolve(), instance(experimentsManager), instance(debugAdapterFactory), instance(configurationService)).debug.getRemoteLauncherCommand( + const args = await buildApi(Promise.resolve(), instance(experimentsManager), instance(debugAdapterFactoryInsiders), instance(configurationService)).debug.getRemoteLauncherCommand( 'something', 1234, false @@ -59,9 +59,9 @@ suite('Extension API Debugger', () => { test('Test debug launcher args (no-wait and in experiment)', async () => { mockInExperiment(); - when(debugAdapterFactory.getRemotePtvsdArgs(anything())).thenReturn(['--default', '--host', 'something', '--port', '1234']); + when(debugAdapterFactoryInsiders.getRemotePtvsdArgs(anything())).thenReturn(['--default', '--host', 'something', '--port', '1234']); - const args = await buildApi(Promise.resolve(), instance(experimentsManager), instance(debugAdapterFactory), instance(configurationService)).debug.getRemoteLauncherCommand( + const args = await buildApi(Promise.resolve(), instance(experimentsManager), instance(debugAdapterFactoryInsiders), instance(configurationService)).debug.getRemoteLauncherCommand( 'something', 1234, false @@ -74,7 +74,7 @@ suite('Extension API Debugger', () => { test('Test debug launcher args (wait and not in experiment)', async () => { mockNotInExperiment(); - const args = await buildApi(Promise.resolve(), instance(experimentsManager), instance(debugAdapterFactory), instance(configurationService)).debug.getRemoteLauncherCommand( + const args = await buildApi(Promise.resolve(), instance(experimentsManager), instance(debugAdapterFactoryInsiders), instance(configurationService)).debug.getRemoteLauncherCommand( 'something', 1234, true @@ -86,9 +86,9 @@ suite('Extension API Debugger', () => { test('Test debug launcher args (wait and in experiment)', async () => { mockInExperiment(); - when(debugAdapterFactory.getRemotePtvsdArgs(anything())).thenReturn(['--default', '--host', 'something', '--port', '1234', '--wait']); + when(debugAdapterFactoryInsiders.getRemotePtvsdArgs(anything())).thenReturn(['--default', '--host', 'something', '--port', '1234', '--wait']); - const args = await buildApi(Promise.resolve(), instance(experimentsManager), instance(debugAdapterFactory), instance(configurationService)).debug.getRemoteLauncherCommand( + const args = await buildApi(Promise.resolve(), instance(experimentsManager), instance(debugAdapterFactoryInsiders), instance(configurationService)).debug.getRemoteLauncherCommand( 'something', 1234, true From dafac9024c32edc91cedac0e962608286352ad23 Mon Sep 17 00:00:00 2001 From: Luciana Date: Mon, 28 Oct 2019 16:36:44 -0700 Subject: [PATCH 2/3] Fix wrong rename of DebugAdapterDescriptorFactory enum --- src/client/common/experimentGroups.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/common/experimentGroups.ts b/src/client/common/experimentGroups.ts index 8b2df2035482..0957892f564e 100644 --- a/src/client/common/experimentGroups.ts +++ b/src/client/common/experimentGroups.ts @@ -14,7 +14,7 @@ export enum ShowExtensionSurveyPrompt { } // Experiment to check whether the extension should use the new VS Code debug adapter API. -export enum DebugAdapterDescriptorFactoryInsiders { +export enum DebugAdapterDescriptorFactory { control = 'DebugAdapterFactoryInsiders - control', experiment = 'DebugAdapterFactoryInsiders - experiment' } From 90d0a903071fb75ba7a84f267d8f2bfeaf688695 Mon Sep 17 00:00:00 2001 From: Luciana Date: Tue, 29 Oct 2019 09:12:27 -0700 Subject: [PATCH 3/3] Revert changes for Debug Adapter tests --- src/test/extension.unit.test.ts | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/test/extension.unit.test.ts b/src/test/extension.unit.test.ts index 5097634d310a..d6d4f878b677 100644 --- a/src/test/extension.unit.test.ts +++ b/src/test/extension.unit.test.ts @@ -23,31 +23,31 @@ suite('Extension API Debugger', () => { const ptvsdPath = path.join('path', 'to', 'ptvsd'); let experimentsManager: IExperimentsManager; - let debugAdapterFactoryInsiders: IDebugAdapterDescriptorFactory; + let debugAdapterFactory: IDebugAdapterDescriptorFactory; let configurationService: IConfigurationService; setup(() => { experimentsManager = mock(ExperimentsManager); - debugAdapterFactoryInsiders = mock(DebugAdapterDescriptorFactory); + debugAdapterFactory = mock(DebugAdapterDescriptorFactory); configurationService = mock(ConfigurationService); }); function mockInExperiment() { when(experimentsManager.inExperiment(anyString())).thenReturn(true); - when(debugAdapterFactoryInsiders.useNewPtvsd(anyString())).thenResolve(true); - when(debugAdapterFactoryInsiders.getPtvsdPath()).thenReturn(ptvsdPath); + when(debugAdapterFactory.useNewPtvsd(anyString())).thenResolve(true); + when(debugAdapterFactory.getPtvsdPath()).thenReturn(ptvsdPath); when(configurationService.getSettings(undefined)).thenReturn(({ pythonPath: 'python' } as any) as IPythonSettings); } function mockNotInExperiment() { when(experimentsManager.inExperiment(anyString())).thenReturn(false); - when(debugAdapterFactoryInsiders.useNewPtvsd(anyString())).thenResolve(false); + when(debugAdapterFactory.useNewPtvsd(anyString())).thenResolve(false); } test('Test debug launcher args (no-wait and not in experiment)', async () => { mockNotInExperiment(); - const args = await buildApi(Promise.resolve(), instance(experimentsManager), instance(debugAdapterFactoryInsiders), instance(configurationService)).debug.getRemoteLauncherCommand( + const args = await buildApi(Promise.resolve(), instance(experimentsManager), instance(debugAdapterFactory), instance(configurationService)).debug.getRemoteLauncherCommand( 'something', 1234, false @@ -59,9 +59,9 @@ suite('Extension API Debugger', () => { test('Test debug launcher args (no-wait and in experiment)', async () => { mockInExperiment(); - when(debugAdapterFactoryInsiders.getRemotePtvsdArgs(anything())).thenReturn(['--default', '--host', 'something', '--port', '1234']); + when(debugAdapterFactory.getRemotePtvsdArgs(anything())).thenReturn(['--default', '--host', 'something', '--port', '1234']); - const args = await buildApi(Promise.resolve(), instance(experimentsManager), instance(debugAdapterFactoryInsiders), instance(configurationService)).debug.getRemoteLauncherCommand( + const args = await buildApi(Promise.resolve(), instance(experimentsManager), instance(debugAdapterFactory), instance(configurationService)).debug.getRemoteLauncherCommand( 'something', 1234, false @@ -74,7 +74,7 @@ suite('Extension API Debugger', () => { test('Test debug launcher args (wait and not in experiment)', async () => { mockNotInExperiment(); - const args = await buildApi(Promise.resolve(), instance(experimentsManager), instance(debugAdapterFactoryInsiders), instance(configurationService)).debug.getRemoteLauncherCommand( + const args = await buildApi(Promise.resolve(), instance(experimentsManager), instance(debugAdapterFactory), instance(configurationService)).debug.getRemoteLauncherCommand( 'something', 1234, true @@ -86,9 +86,9 @@ suite('Extension API Debugger', () => { test('Test debug launcher args (wait and in experiment)', async () => { mockInExperiment(); - when(debugAdapterFactoryInsiders.getRemotePtvsdArgs(anything())).thenReturn(['--default', '--host', 'something', '--port', '1234', '--wait']); + when(debugAdapterFactory.getRemotePtvsdArgs(anything())).thenReturn(['--default', '--host', 'something', '--port', '1234', '--wait']); - const args = await buildApi(Promise.resolve(), instance(experimentsManager), instance(debugAdapterFactoryInsiders), instance(configurationService)).debug.getRemoteLauncherCommand( + const args = await buildApi(Promise.resolve(), instance(experimentsManager), instance(debugAdapterFactory), instance(configurationService)).debug.getRemoteLauncherCommand( 'something', 1234, true