@@ -17,6 +17,7 @@ import { deepFreeze } from 'vs/base/common/objects';
17
17
import { isDefined } from 'vs/base/common/types' ;
18
18
import { generateUuid } from 'vs/base/common/uuid' ;
19
19
import { IExtensionDescription , IRelaxedExtensionDescription } from 'vs/platform/extensions/common/extensions' ;
20
+ import { ILogService } from 'vs/platform/log/common/log' ;
20
21
import { ExtHostTestingShape , ILocationDto , MainContext , MainThreadTestingShape } from 'vs/workbench/api/common/extHost.protocol' ;
21
22
import { ExtHostCommands } from 'vs/workbench/api/common/extHostCommands' ;
22
23
import { ExtHostDocumentsAndEditors } from 'vs/workbench/api/common/extHostDocumentsAndEditors' ;
@@ -54,13 +55,14 @@ export class ExtHostTesting extends Disposable implements ExtHostTestingShape {
54
55
55
56
constructor (
56
57
@IExtHostRpcService rpc : IExtHostRpcService ,
58
+ @ILogService logService : ILogService ,
57
59
commands : ExtHostCommands ,
58
60
private readonly editors : ExtHostDocumentsAndEditors ,
59
61
) {
60
62
super ( ) ;
61
63
this . proxy = rpc . getProxy ( MainContext . MainThreadTesting ) ;
62
64
this . observer = new TestObservers ( this . proxy ) ;
63
- this . runTracker = new TestRunCoordinator ( this . proxy ) ;
65
+ this . runTracker = new TestRunCoordinator ( this . proxy , logService ) ;
64
66
65
67
commands . registerArgumentProcessor ( {
66
68
processArgument : arg => {
@@ -465,6 +467,7 @@ class TestRunTracker extends Disposable {
465
467
private readonly dto : TestRunDto ,
466
468
private readonly proxy : MainThreadTestingShape ,
467
469
private readonly extension : IRelaxedExtensionDescription ,
470
+ private readonly logService : ILogService ,
468
471
parentToken ?: CancellationToken ,
469
472
) {
470
473
super ( ) ;
@@ -496,7 +499,7 @@ class TestRunTracker extends Disposable {
496
499
const guardTestMutation = < Args extends unknown [ ] > ( fn : ( test : vscode . TestItem , ...args : Args ) => void ) =>
497
500
( test : vscode . TestItem , ...args : Args ) => {
498
501
if ( ended ) {
499
- console . warn ( `Setting the state of test "${ test . id } " is a no-op after the run ends.` ) ;
502
+ this . logService . warn ( `Setting the state of test "${ test . id } " is a no-op after the run ends.` ) ;
500
503
return ;
501
504
}
502
505
@@ -665,7 +668,10 @@ export class TestRunCoordinator {
665
668
return this . tracked . values ( ) ;
666
669
}
667
670
668
- constructor ( private readonly proxy : MainThreadTestingShape ) { }
671
+ constructor (
672
+ private readonly proxy : MainThreadTestingShape ,
673
+ private readonly logService : ILogService ,
674
+ ) { }
669
675
670
676
/**
671
677
* Gets a coverage report for a given run and task ID.
@@ -740,7 +746,7 @@ export class TestRunCoordinator {
740
746
}
741
747
742
748
private getTracker ( req : vscode . TestRunRequest , dto : TestRunDto , extension : IRelaxedExtensionDescription , token ?: CancellationToken ) {
743
- const tracker = new TestRunTracker ( dto , this . proxy , extension , token ) ;
749
+ const tracker = new TestRunTracker ( dto , this . proxy , extension , this . logService , token ) ;
744
750
this . tracked . set ( req , tracker ) ;
745
751
746
752
let coverageReports : CoverageReportRecord | undefined ;
0 commit comments