diff --git a/src/client/testing/testController/common/types.ts b/src/client/testing/testController/common/types.ts index 3f1a25b6eb62..7139788a8177 100644 --- a/src/client/testing/testController/common/types.ts +++ b/src/client/testing/testController/common/types.ts @@ -156,19 +156,19 @@ export interface ITestResultResolver { } export interface ITestDiscoveryAdapter { // ** first line old method signature, second line new method signature - discoverTests(uri: Uri): Promise; + discoverTests(uri: Uri): Promise; discoverTests( uri: Uri, executionFactory?: IPythonExecutionFactory, token?: CancellationToken, interpreter?: PythonEnvironment, - ): Promise; + ): Promise; } // interface for execution/runner adapter export interface ITestExecutionAdapter { // ** first line old method signature, second line new method signature - runTests(uri: Uri, testIds: string[], profileKind?: boolean | TestRunProfileKind): Promise; + runTests(uri: Uri, testIds: string[], profileKind?: boolean | TestRunProfileKind): Promise; runTests( uri: Uri, testIds: string[], @@ -177,7 +177,7 @@ export interface ITestExecutionAdapter { executionFactory?: IPythonExecutionFactory, debugLauncher?: ITestDebugLauncher, interpreter?: PythonEnvironment, - ): Promise; + ): Promise; } // Same types as in python_files/unittestadapter/utils.py diff --git a/src/client/testing/testController/pytest/pytestDiscoveryAdapter.ts b/src/client/testing/testController/pytest/pytestDiscoveryAdapter.ts index a1a01e08d3e9..ef68f7d8039d 100644 --- a/src/client/testing/testController/pytest/pytestDiscoveryAdapter.ts +++ b/src/client/testing/testController/pytest/pytestDiscoveryAdapter.ts @@ -43,14 +43,14 @@ export class PytestTestDiscoveryAdapter implements ITestDiscoveryAdapter { executionFactory?: IPythonExecutionFactory, token?: CancellationToken, interpreter?: PythonEnvironment, - ): Promise { + ): Promise { const cSource = new CancellationTokenSource(); - const deferredReturn = createDeferred(); + const deferredReturn = createDeferred(); token?.onCancellationRequested(() => { traceInfo(`Test discovery cancelled.`); cSource.cancel(); - deferredReturn.resolve({ cwd: uri.fsPath, status: 'success' }); + deferredReturn.resolve(); }); const name = await startDiscoveryNamedPipe((data: DiscoveredTestPayload) => { @@ -61,7 +61,7 @@ export class PytestTestDiscoveryAdapter implements ITestDiscoveryAdapter { }, cSource.token); this.runPytestDiscovery(uri, name, cSource, executionFactory, interpreter, token).then(() => { - deferredReturn.resolve({ cwd: uri.fsPath, status: 'success' }); + deferredReturn.resolve(); }); return deferredReturn.promise; diff --git a/src/client/testing/testController/pytest/pytestExecutionAdapter.ts b/src/client/testing/testController/pytest/pytestExecutionAdapter.ts index 741b07b814f7..f66bff584fe2 100644 --- a/src/client/testing/testController/pytest/pytestExecutionAdapter.ts +++ b/src/client/testing/testController/pytest/pytestExecutionAdapter.ts @@ -38,7 +38,7 @@ export class PytestTestExecutionAdapter implements ITestExecutionAdapter { executionFactory?: IPythonExecutionFactory, debugLauncher?: ITestDebugLauncher, interpreter?: PythonEnvironment, - ): Promise { + ): Promise { const deferredTillServerClose: Deferred = utils.createTestingDeferred(); // create callback to handle data received on the named pipe @@ -59,12 +59,6 @@ export class PytestTestExecutionAdapter implements ITestExecutionAdapter { ); runInstance?.token.onCancellationRequested(() => { traceInfo(`Test run cancelled, resolving 'TillServerClose' deferred for ${uri.fsPath}.`); - const executionPayload: ExecutionTestPayload = { - cwd: uri.fsPath, - status: 'success', - error: '', - }; - return executionPayload; }); try { @@ -82,15 +76,6 @@ export class PytestTestExecutionAdapter implements ITestExecutionAdapter { } finally { await deferredTillServerClose.promise; } - - // placeholder until after the rewrite is adopted - // TODO: remove after adoption. - const executionPayload: ExecutionTestPayload = { - cwd: uri.fsPath, - status: 'success', - error: '', - }; - return executionPayload; } private async runTestsNew( diff --git a/src/client/testing/testController/unittest/testDiscoveryAdapter.ts b/src/client/testing/testController/unittest/testDiscoveryAdapter.ts index 9a014116de96..9c8015b7864f 100644 --- a/src/client/testing/testController/unittest/testDiscoveryAdapter.ts +++ b/src/client/testing/testController/unittest/testDiscoveryAdapter.ts @@ -46,18 +46,18 @@ export class UnittestTestDiscoveryAdapter implements ITestDiscoveryAdapter { uri: Uri, executionFactory?: IPythonExecutionFactory, token?: CancellationToken, - ): Promise { + ): Promise { const settings = this.configSettings.getSettings(uri); const { unittestArgs } = settings.testing; const cwd = settings.testing.cwd && settings.testing.cwd.length > 0 ? settings.testing.cwd : uri.fsPath; const cSource = new CancellationTokenSource(); - const deferredReturn = createDeferred(); + const deferredReturn = createDeferred(); token?.onCancellationRequested(() => { traceInfo(`Test discovery cancelled.`); cSource.cancel(); - deferredReturn.resolve({ cwd: uri.fsPath, status: 'success' }); + deferredReturn.resolve(); }); const name = await startDiscoveryNamedPipe((data: DiscoveredTestPayload) => { @@ -83,7 +83,7 @@ export class UnittestTestDiscoveryAdapter implements ITestDiscoveryAdapter { }; this.runDiscovery(uri, options, name, cwd, cSource, executionFactory).then(() => { - deferredReturn.resolve({ cwd: uri.fsPath, status: 'success' }); + deferredReturn.resolve(); }); return deferredReturn.promise; diff --git a/src/client/testing/testController/unittest/testExecutionAdapter.ts b/src/client/testing/testController/unittest/testExecutionAdapter.ts index 6db36d96149f..e2b591379335 100644 --- a/src/client/testing/testController/unittest/testExecutionAdapter.ts +++ b/src/client/testing/testController/unittest/testExecutionAdapter.ts @@ -47,7 +47,7 @@ export class UnittestTestExecutionAdapter implements ITestExecutionAdapter { runInstance?: TestRun, executionFactory?: IPythonExecutionFactory, debugLauncher?: ITestDebugLauncher, - ): Promise { + ): Promise { // deferredTillServerClose awaits named pipe server close const deferredTillServerClose: Deferred = utils.createTestingDeferred(); @@ -87,12 +87,6 @@ export class UnittestTestExecutionAdapter implements ITestExecutionAdapter { } finally { await deferredTillServerClose.promise; } - const executionPayload: ExecutionTestPayload = { - cwd: uri.fsPath, - status: 'success', - error: '', - }; - return executionPayload; } private async runTestsNew(