Skip to content

Commit bde3052

Browse files
committed
replace ITestOutputChannel with ILogOutputChannel
1 parent 86da781 commit bde3052

17 files changed

+70
-76
lines changed

src/client/common/types.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import {
1616
Memento,
1717
LogOutputChannel,
1818
Uri,
19-
OutputChannel,
2019
} from 'vscode';
2120
import { LanguageServerType } from '../activation/types';
2221
import type { InstallOptions, InterpreterUri, ModuleInstallFlags } from './installer/types';
@@ -29,8 +28,6 @@ export interface IDisposable {
2928

3029
export const ILogOutputChannel = Symbol('ILogOutputChannel');
3130
export interface ILogOutputChannel extends LogOutputChannel {}
32-
export const ITestOutputChannel = Symbol('ITestOutputChannel');
33-
export interface ITestOutputChannel extends OutputChannel {}
3431
export const IDocumentSymbolProvider = Symbol('IDocumentSymbolProvider');
3532
export interface IDocumentSymbolProvider extends DocumentSymbolProvider {}
3633
export const IsWindows = Symbol('IS_WINDOWS');

src/client/testing/testController/controller.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import { IExtensionSingleActivationService } from '../../activation/types';
2525
import { ICommandManager, IWorkspaceService } from '../../common/application/types';
2626
import * as constants from '../../common/constants';
2727
import { IPythonExecutionFactory } from '../../common/process/types';
28-
import { IConfigurationService, IDisposableRegistry, ITestOutputChannel, Resource } from '../../common/types';
28+
import { IConfigurationService, IDisposableRegistry, ILogOutputChannel, Resource } from '../../common/types';
2929
import { DelayedTrigger, IDelayedTrigger } from '../../common/utils/delayTrigger';
3030
import { noop } from '../../common/utils/misc';
3131
import { IInterpreterService } from '../../interpreter/contracts';
@@ -98,7 +98,7 @@ export class PythonTestController implements ITestController, IExtensionSingleAc
9898
@inject(ICommandManager) private readonly commandManager: ICommandManager,
9999
@inject(IPythonExecutionFactory) private readonly pythonExecFactory: IPythonExecutionFactory,
100100
@inject(ITestDebugLauncher) private readonly debugLauncher: ITestDebugLauncher,
101-
@inject(ITestOutputChannel) private readonly testOutputChannel: ITestOutputChannel,
101+
@inject(ILogOutputChannel) private readonly logOutputChannel: ILogOutputChannel,
102102
@inject(IEnvironmentVariablesProvider) private readonly envVarsService: IEnvironmentVariablesProvider,
103103
) {
104104
this.refreshCancellation = new CancellationTokenSource();
@@ -176,13 +176,13 @@ export class PythonTestController implements ITestController, IExtensionSingleAc
176176
resultResolver = new PythonResultResolver(this.testController, testProvider, workspace.uri);
177177
discoveryAdapter = new UnittestTestDiscoveryAdapter(
178178
this.configSettings,
179-
this.testOutputChannel,
179+
this.logOutputChannel,
180180
resultResolver,
181181
this.envVarsService,
182182
);
183183
executionAdapter = new UnittestTestExecutionAdapter(
184184
this.configSettings,
185-
this.testOutputChannel,
185+
this.logOutputChannel,
186186
resultResolver,
187187
this.envVarsService,
188188
);
@@ -191,13 +191,13 @@ export class PythonTestController implements ITestController, IExtensionSingleAc
191191
resultResolver = new PythonResultResolver(this.testController, testProvider, workspace.uri);
192192
discoveryAdapter = new PytestTestDiscoveryAdapter(
193193
this.configSettings,
194-
this.testOutputChannel,
194+
this.logOutputChannel,
195195
resultResolver,
196196
this.envVarsService,
197197
);
198198
executionAdapter = new PytestTestExecutionAdapter(
199199
this.configSettings,
200-
this.testOutputChannel,
200+
this.logOutputChannel,
201201
resultResolver,
202202
this.envVarsService,
203203
);

src/client/testing/testController/pytest/pytestDiscoveryAdapter.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
IPythonExecutionFactory,
1010
SpawnOptions,
1111
} from '../../../common/process/types';
12-
import { IConfigurationService, ITestOutputChannel } from '../../../common/types';
12+
import { IConfigurationService, ILogOutputChannel } from '../../../common/types';
1313
import { createDeferred, Deferred } from '../../../common/utils/async';
1414
import { EXTENSION_ROOT_DIR } from '../../../constants';
1515
import { traceError, traceInfo, traceVerbose, traceWarn } from '../../../logging';
@@ -32,7 +32,7 @@ import { useEnvExtension, getEnvironment, runInBackground } from '../../../envEx
3232
export class PytestTestDiscoveryAdapter implements ITestDiscoveryAdapter {
3333
constructor(
3434
public configSettings: IConfigurationService,
35-
private readonly outputChannel: ITestOutputChannel,
35+
private readonly outputChannel: ILogOutputChannel,
3636
private readonly resultResolver?: ITestResultResolver,
3737
private readonly envVarsService?: IEnvironmentVariablesProvider,
3838
) {}

src/client/testing/testController/pytest/pytestExecutionAdapter.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import { CancellationTokenSource, DebugSessionOptions, TestRun, TestRunProfileKind, Uri } from 'vscode';
55
import * as path from 'path';
66
import { ChildProcess } from 'child_process';
7-
import { IConfigurationService, ITestOutputChannel } from '../../../common/types';
7+
import { IConfigurationService, ILogOutputChannel } from '../../../common/types';
88
import { Deferred } from '../../../common/utils/async';
99
import { traceError, traceInfo, traceVerbose } from '../../../logging';
1010
import { ExecutionTestPayload, ITestExecutionAdapter, ITestResultResolver } from '../common/types';
@@ -25,7 +25,7 @@ import { getEnvironment, runInBackground, useEnvExtension } from '../../../envEx
2525
export class PytestTestExecutionAdapter implements ITestExecutionAdapter {
2626
constructor(
2727
public configSettings: IConfigurationService,
28-
private readonly outputChannel: ITestOutputChannel,
28+
private readonly outputChannel: ILogOutputChannel,
2929
private readonly resultResolver?: ITestResultResolver,
3030
private readonly envVarsService?: IEnvironmentVariablesProvider,
3131
) {}

src/client/testing/testController/unittest/testDiscoveryAdapter.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import * as path from 'path';
55
import { CancellationTokenSource, Uri } from 'vscode';
66
import { CancellationToken } from 'vscode-jsonrpc';
77
import { ChildProcess } from 'child_process';
8-
import { IConfigurationService, ITestOutputChannel } from '../../../common/types';
8+
import { IConfigurationService, ILogOutputChannel } from '../../../common/types';
99
import { EXTENSION_ROOT_DIR } from '../../../constants';
1010
import {
1111
DiscoveredTestPayload,
@@ -32,7 +32,7 @@ import { getEnvironment, runInBackground, useEnvExtension } from '../../../envEx
3232
export class UnittestTestDiscoveryAdapter implements ITestDiscoveryAdapter {
3333
constructor(
3434
public configSettings: IConfigurationService,
35-
private readonly outputChannel: ITestOutputChannel,
35+
private readonly logOutputChannel: ILogOutputChannel,
3636
private readonly resultResolver?: ITestResultResolver,
3737
private readonly envVarsService?: IEnvironmentVariablesProvider,
3838
) {}
@@ -74,7 +74,7 @@ export class UnittestTestDiscoveryAdapter implements ITestDiscoveryAdapter {
7474
workspaceFolder: uri,
7575
command,
7676
cwd,
77-
outChannel: this.outputChannel,
77+
outChannel: this.logOutputChannel,
7878
token,
7979
};
8080

src/client/testing/testController/unittest/testExecutionAdapter.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import * as path from 'path';
55
import { CancellationTokenSource, DebugSessionOptions, TestRun, TestRunProfileKind, Uri } from 'vscode';
66
import { ChildProcess } from 'child_process';
7-
import { IConfigurationService, ITestOutputChannel } from '../../../common/types';
7+
import { IConfigurationService, ILogOutputChannel } from '../../../common/types';
88
import { Deferred, createDeferred } from '../../../common/utils/async';
99
import { EXTENSION_ROOT_DIR } from '../../../constants';
1010
import {
@@ -35,7 +35,7 @@ import { getEnvironment, runInBackground, useEnvExtension } from '../../../envEx
3535
export class UnittestTestExecutionAdapter implements ITestExecutionAdapter {
3636
constructor(
3737
public configSettings: IConfigurationService,
38-
private readonly outputChannel: ITestOutputChannel,
38+
private readonly outputChannel: ILogOutputChannel,
3939
private readonly resultResolver?: ITestResultResolver,
4040
private readonly envVarsService?: IEnvironmentVariablesProvider,
4141
) {}

src/test/serviceRegistry.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,10 @@ import {
2727
ICurrentProcess,
2828
IDisposableRegistry,
2929
IMemento,
30-
ILogOutputChannel,
3130
IPathUtils,
3231
IsWindows,
3332
WORKSPACE_MEMENTO,
34-
ITestOutputChannel,
33+
ILogOutputChannel,
3534
} from '../client/common/types';
3635
import { registerTypes as variableRegisterTypes } from '../client/common/variables/serviceRegistry';
3736
import { EnvironmentActivationService } from '../client/interpreter/activation/service';
@@ -84,7 +83,7 @@ export class IocContainer {
8483
this.serviceManager.addSingletonInstance<ILogOutputChannel>(ILogOutputChannel, stdOutputChannel);
8584
const testOutputChannel = new MockOutputChannel('Python Test - UnitTests');
8685
this.disposables.push(testOutputChannel);
87-
this.serviceManager.addSingletonInstance<ITestOutputChannel>(ITestOutputChannel, testOutputChannel);
86+
this.serviceManager.addSingletonInstance<ILogOutputChannel>(ILogOutputChannel, testOutputChannel);
8887

8988
this.serviceManager.addSingleton<IInterpreterAutoSelectionService>(
9089
IInterpreterAutoSelectionService,

src/test/testing/common/managers/testConfigurationManager.unit.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import * as TypeMoq from 'typemoq';
77
import { OutputChannel, Uri } from 'vscode';
8-
import { IInstaller, ITestOutputChannel, Product } from '../../../../client/common/types';
8+
import { IInstaller, ILogOutputChannel, Product } from '../../../../client/common/types';
99
import { getNamesAndValues } from '../../../../client/common/utils/enum';
1010
import { IServiceContainer } from '../../../../client/ioc/types';
1111
import { UNIT_TEST_PRODUCTS } from '../../../../client/testing/common/constants';
@@ -41,7 +41,7 @@ suite('Unit Test Configuration Manager (unit)', () => {
4141
const installer = TypeMoq.Mock.ofType<IInstaller>().object;
4242
const serviceContainer = TypeMoq.Mock.ofType<IServiceContainer>();
4343
serviceContainer
44-
.setup((s) => s.get(TypeMoq.It.isValue(ITestOutputChannel)))
44+
.setup((s) => s.get(TypeMoq.It.isValue(ILogOutputChannel)))
4545
.returns(() => outputChannel);
4646
serviceContainer
4747
.setup((s) => s.get(TypeMoq.It.isValue(ITestConfigSettingsService)))

src/test/testing/common/testingAdapter.test.ts

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import * as sinon from 'sinon';
1111
import { PytestTestDiscoveryAdapter } from '../../../client/testing/testController/pytest/pytestDiscoveryAdapter';
1212
import { ITestController, ITestResultResolver } from '../../../client/testing/testController/common/types';
1313
import { IPythonExecutionFactory } from '../../../client/common/process/types';
14-
import { IConfigurationService, ITestOutputChannel } from '../../../client/common/types';
14+
import { IConfigurationService, ILogOutputChannel } from '../../../client/common/types';
1515
import { IServiceContainer } from '../../../client/ioc/types';
1616
import { EXTENSION_ROOT_DIR_FOR_TESTS, initialize } from '../../initialize';
1717
import { traceError, traceLog } from '../../../client/logging';
@@ -32,7 +32,7 @@ suite('End to End Tests: test adapters', () => {
3232
let serviceContainer: IServiceContainer;
3333
let envVarsService: IEnvironmentVariablesProvider;
3434
let workspaceUri: Uri;
35-
let testOutputChannel: typeMoq.IMock<ITestOutputChannel>;
35+
let logOutputChannel: typeMoq.IMock<ILogOutputChannel>;
3636
let testController: TestController;
3737
let getPixiStub: sinon.SinonStub;
3838
const unittestProvider: TestProvider = UNITTEST_PROVIDER;
@@ -117,16 +117,16 @@ suite('End to End Tests: test adapters', () => {
117117

118118
// create objects that were not injected
119119

120-
testOutputChannel = createTypeMoq<ITestOutputChannel>();
121-
testOutputChannel
120+
logOutputChannel = createTypeMoq<ILogOutputChannel>();
121+
logOutputChannel
122122
.setup((x) => x.append(typeMoq.It.isAny()))
123123
.callback((appendVal: any) => {
124124
traceLog('output channel - ', appendVal.toString());
125125
})
126126
.returns(() => {
127127
// Whatever you need to return
128128
});
129-
testOutputChannel
129+
logOutputChannel
130130
.setup((x) => x.appendLine(typeMoq.It.isAny()))
131131
.callback((appendVal: any) => {
132132
traceLog('output channel ', appendVal.toString());
@@ -191,7 +191,7 @@ suite('End to End Tests: test adapters', () => {
191191
// run unittest discovery
192192
const discoveryAdapter = new UnittestTestDiscoveryAdapter(
193193
configService,
194-
testOutputChannel.object,
194+
logOutputChannel.object,
195195
resultResolver,
196196
envVarsService,
197197
);
@@ -236,7 +236,7 @@ suite('End to End Tests: test adapters', () => {
236236
// run discovery
237237
const discoveryAdapter = new UnittestTestDiscoveryAdapter(
238238
configService,
239-
testOutputChannel.object,
239+
logOutputChannel.object,
240240
resultResolver,
241241
envVarsService,
242242
);
@@ -276,7 +276,7 @@ suite('End to End Tests: test adapters', () => {
276276
// run pytest discovery
277277
const discoveryAdapter = new PytestTestDiscoveryAdapter(
278278
configService,
279-
testOutputChannel.object,
279+
logOutputChannel.object,
280280
resultResolver,
281281
envVarsService,
282282
);
@@ -331,7 +331,7 @@ suite('End to End Tests: test adapters', () => {
331331
// run pytest discovery
332332
const discoveryAdapter = new PytestTestDiscoveryAdapter(
333333
configService,
334-
testOutputChannel.object,
334+
logOutputChannel.object,
335335
resultResolver,
336336
envVarsService,
337337
);
@@ -420,7 +420,7 @@ suite('End to End Tests: test adapters', () => {
420420
// run pytest discovery
421421
const discoveryAdapter = new PytestTestDiscoveryAdapter(
422422
configService,
423-
testOutputChannel.object,
423+
logOutputChannel.object,
424424
resultResolver,
425425
envVarsService,
426426
);
@@ -496,7 +496,7 @@ suite('End to End Tests: test adapters', () => {
496496
// run pytest discovery
497497
const discoveryAdapter = new PytestTestDiscoveryAdapter(
498498
configService,
499-
testOutputChannel.object,
499+
logOutputChannel.object,
500500
resultResolver,
501501
envVarsService,
502502
);
@@ -550,7 +550,7 @@ suite('End to End Tests: test adapters', () => {
550550
// run execution
551551
const executionAdapter = new UnittestTestExecutionAdapter(
552552
configService,
553-
testOutputChannel.object,
553+
logOutputChannel.object,
554554
resultResolver,
555555
envVarsService,
556556
);
@@ -630,7 +630,7 @@ suite('End to End Tests: test adapters', () => {
630630
// run unittest execution
631631
const executionAdapter = new UnittestTestExecutionAdapter(
632632
configService,
633-
testOutputChannel.object,
633+
logOutputChannel.object,
634634
resultResolver,
635635
envVarsService,
636636
);
@@ -705,7 +705,7 @@ suite('End to End Tests: test adapters', () => {
705705
// run pytest execution
706706
const executionAdapter = new PytestTestExecutionAdapter(
707707
configService,
708-
testOutputChannel.object,
708+
logOutputChannel.object,
709709
resultResolver,
710710
envVarsService,
711711
);
@@ -785,7 +785,7 @@ suite('End to End Tests: test adapters', () => {
785785
// run execution
786786
const executionAdapter = new UnittestTestExecutionAdapter(
787787
configService,
788-
testOutputChannel.object,
788+
logOutputChannel.object,
789789
resultResolver,
790790
envVarsService,
791791
);
@@ -839,7 +839,7 @@ suite('End to End Tests: test adapters', () => {
839839
// run pytest execution
840840
const executionAdapter = new PytestTestExecutionAdapter(
841841
configService,
842-
testOutputChannel.object,
842+
logOutputChannel.object,
843843
resultResolver,
844844
envVarsService,
845845
);
@@ -910,7 +910,7 @@ suite('End to End Tests: test adapters', () => {
910910
// run pytest execution
911911
const executionAdapter = new PytestTestExecutionAdapter(
912912
configService,
913-
testOutputChannel.object,
913+
logOutputChannel.object,
914914
resultResolver,
915915
envVarsService,
916916
);
@@ -984,7 +984,7 @@ suite('End to End Tests: test adapters', () => {
984984

985985
const discoveryAdapter = new UnittestTestDiscoveryAdapter(
986986
configService,
987-
testOutputChannel.object,
987+
logOutputChannel.object,
988988
resultResolver,
989989
envVarsService,
990990
);
@@ -1043,7 +1043,7 @@ suite('End to End Tests: test adapters', () => {
10431043
// run pytest discovery
10441044
const discoveryAdapter = new PytestTestDiscoveryAdapter(
10451045
configService,
1046-
testOutputChannel.object,
1046+
logOutputChannel.object,
10471047
resultResolver,
10481048
envVarsService,
10491049
);
@@ -1104,7 +1104,7 @@ suite('End to End Tests: test adapters', () => {
11041104
// run pytest execution
11051105
const executionAdapter = new PytestTestExecutionAdapter(
11061106
configService,
1107-
testOutputChannel.object,
1107+
logOutputChannel.object,
11081108
resultResolver,
11091109
envVarsService,
11101110
);

src/test/testing/configuration.unit.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { IApplicationShell, ICommandManager, IWorkspaceService } from '../../cli
1010
import {
1111
IConfigurationService,
1212
IInstaller,
13-
ITestOutputChannel,
13+
ILogOutputChannel,
1414
IPythonSettings,
1515
Product,
1616
} from '../../client/common/types';
@@ -61,7 +61,7 @@ suite('Unit Tests - ConfigurationService', () => {
6161
configurationService.setup((c) => c.getSettings(workspaceUri)).returns(() => pythonSettings.object);
6262

6363
serviceContainer
64-
.setup((c) => c.get(typeMoq.It.isValue(ITestOutputChannel)))
64+
.setup((c) => c.get(typeMoq.It.isValue(ILogOutputChannel)))
6565
.returns(() => outputChannel.object);
6666
serviceContainer.setup((c) => c.get(typeMoq.It.isValue(IInstaller))).returns(() => installer.object);
6767
serviceContainer

0 commit comments

Comments
 (0)