Skip to content

Commit

Permalink
fix bug with unittest debug not having args
Browse files Browse the repository at this point in the history
  • Loading branch information
eleanorjboyd committed Oct 6, 2023
1 parent e7dfef8 commit ccc52ac
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/client/testing/common/debugLauncher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 2 additions & 0 deletions src/client/testing/testController/common/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`);

Expand Down

0 comments on commit ccc52ac

Please sign in to comment.