From ccc52acda5d71cc66d1cf8b9bf516d1365069382 Mon Sep 17 00:00:00 2001 From: eleanorjboyd Date: Fri, 6 Oct 2023 15:47:27 -0700 Subject: [PATCH] fix bug with unittest debug not having args --- src/client/testing/common/debugLauncher.ts | 17 +++++++++-------- .../testing/testController/common/server.ts | 2 ++ 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/client/testing/common/debugLauncher.ts b/src/client/testing/common/debugLauncher.ts index 63e2a4543beb..0f217afa6513 100644 --- a/src/client/testing/common/debugLauncher.ts +++ b/src/client/testing/common/debugLauncher.ts @@ -206,18 +206,19 @@ export class DebugLauncher implements ITestDebugLauncher { launchArgs.request = 'launch'; // Both types of tests need to have the port for the test result server. - if (options.runTestIdsPort) { - launchArgs.env = { - ...launchArgs.env, - RUN_TEST_IDS_PORT: options.runTestIdsPort, - }; - } - if (options.testProvider === 'pytest' && pythonTestAdapterRewriteExperiment) { - if (options.pytestPort && options.pytestUUID) { + // if (options.runTestIdsPort) { + // launchArgs.env = { + // ...launchArgs.env, + // RUN_TEST_IDS_PORT: options.runTestIdsPort, + // }; + // } + if (pythonTestAdapterRewriteExperiment) { + if (options.pytestPort && options.pytestUUID && options.runTestIdsPort) { launchArgs.env = { ...launchArgs.env, TEST_PORT: options.pytestPort, TEST_UUID: options.pytestUUID, + RUN_TEST_IDS_PORT: options.runTestIdsPort, }; } else { throw Error( diff --git a/src/client/testing/testController/common/server.ts b/src/client/testing/testController/common/server.ts index 7437a44d6080..50ae1f3f7536 100644 --- a/src/client/testing/testController/common/server.ts +++ b/src/client/testing/testController/common/server.ts @@ -211,6 +211,8 @@ export class PythonTestServer implements ITestServer, Disposable { token: options.token, testProvider: UNITTEST_PROVIDER, runTestIdsPort: runTestIdPort, + pytestUUID: uuid.toString(), + pytestPort: this.getPort().toString(), }; traceInfo(`Running DEBUG unittest with arguments: ${args}\r\n`);