@@ -68,6 +68,11 @@ internal VsTestConsoleRequestSender(ICommunicationManager communicationManager,
68
68
/// <returns>Port Number of hosted server on this side</returns>
69
69
public int InitializeCommunication ( )
70
70
{
71
+ if ( EqtTrace . IsInfoEnabled )
72
+ {
73
+ EqtTrace . Info ( "VsTestConsoleRequestSender.InitializeCommunication: Started." ) ;
74
+ }
75
+
71
76
this . processExitCancellationTokenSource = new CancellationTokenSource ( ) ;
72
77
this . handShakeSuccessful = false ;
73
78
this . handShakeComplete . Reset ( ) ;
@@ -90,6 +95,11 @@ public int InitializeCommunication()
90
95
this . handShakeComplete . Set ( ) ;
91
96
}
92
97
98
+ if ( EqtTrace . IsInfoEnabled )
99
+ {
100
+ EqtTrace . Info ( "VsTestConsoleRequestSender.InitializeCommunication: Ended." ) ;
101
+ }
102
+
93
103
return port ;
94
104
}
95
105
@@ -107,6 +117,11 @@ public bool WaitForRequestHandlerConnection(int clientConnectionTimeout)
107
117
/// <inheritdoc/>
108
118
public async Task < int > InitializeCommunicationAsync ( int clientConnectionTimeout )
109
119
{
120
+ if ( EqtTrace . IsInfoEnabled )
121
+ {
122
+ EqtTrace . Info ( $ "VsTestConsoleRequestSender.InitializeCommunicationAsync: Started with client connection timeout { clientConnectionTimeout } milliseconds.") ;
123
+ }
124
+
110
125
this . processExitCancellationTokenSource = new CancellationTokenSource ( ) ;
111
126
this . handShakeSuccessful = false ;
112
127
this . handShakeComplete . Reset ( ) ;
@@ -126,18 +141,31 @@ public async Task<int> InitializeCommunicationAsync(int clientConnectionTimeout)
126
141
this . handShakeComplete . Set ( ) ;
127
142
}
128
143
144
+ if ( EqtTrace . IsInfoEnabled )
145
+ {
146
+ EqtTrace . Info ( "VsTestConsoleRequestSender.InitializeCommunicationAsync: Ended." ) ;
147
+ }
148
+
129
149
return this . handShakeSuccessful ? port : - 1 ;
130
150
}
131
151
132
152
/// <inheritdoc/>
133
153
public void InitializeExtensions ( IEnumerable < string > pathToAdditionalExtensions )
134
154
{
155
+ if ( EqtTrace . IsInfoEnabled )
156
+ {
157
+ EqtTrace . Info ( $ "VsTestConsoleRequestSender.InitializeExtensions: Initializing extensions with additional extensions path { string . Join ( "," , pathToAdditionalExtensions . ToList ( ) ) } .") ;
158
+ }
135
159
this . communicationManager . SendMessage ( MessageType . ExtensionsInitialize , pathToAdditionalExtensions , this . protocolVersion ) ;
136
160
}
137
161
138
162
/// <inheritdoc/>
139
163
public void DiscoverTests ( IEnumerable < string > sources , string runSettings , TestPlatformOptions options , ITestDiscoveryEventsHandler2 eventHandler )
140
164
{
165
+ if ( EqtTrace . IsInfoEnabled )
166
+ {
167
+ EqtTrace . Info ( "VsTestConsoleRequestSender.DiscoverTests: Starting test discovery." ) ;
168
+ }
141
169
this . SendMessageAndListenAndReportTestCases ( sources , runSettings , options , eventHandler ) ;
142
170
}
143
171
@@ -146,12 +174,21 @@ public void DiscoverTests(IEnumerable<string> sources, string runSettings, TestP
146
174
/// </summary>
147
175
public async Task DiscoverTestsAsync ( IEnumerable < string > sources , string runSettings , TestPlatformOptions options , ITestDiscoveryEventsHandler2 eventHandler )
148
176
{
177
+ if ( EqtTrace . IsInfoEnabled )
178
+ {
179
+ EqtTrace . Info ( "VsTestConsoleRequestSender.DiscoverTestsAsync: Starting test discovery." ) ;
180
+ }
149
181
await this . SendMessageAndListenAndReportTestCasesAsync ( sources , runSettings , options , eventHandler ) ;
150
182
}
151
183
152
184
/// <inheritdoc/>
153
185
public void StartTestRun ( IEnumerable < string > sources , string runSettings , TestPlatformOptions options , ITestRunEventsHandler runEventsHandler )
154
186
{
187
+ if ( EqtTrace . IsInfoEnabled )
188
+ {
189
+ EqtTrace . Info ( "VsTestConsoleRequestSender.StartTestRun: Starting test run." ) ;
190
+ }
191
+
155
192
this . SendMessageAndListenAndReportTestResults (
156
193
MessageType . TestRunAllSourcesWithDefaultHost ,
157
194
new TestRunRequestPayload ( ) { Sources = sources . ToList ( ) , RunSettings = runSettings , TestPlatformOptions = options } ,
@@ -162,6 +199,10 @@ public void StartTestRun(IEnumerable<string> sources, string runSettings, TestPl
162
199
/// <inheritdoc/>
163
200
public async Task StartTestRunAsync ( IEnumerable < string > sources , string runSettings , TestPlatformOptions options , ITestRunEventsHandler runEventsHandler )
164
201
{
202
+ if ( EqtTrace . IsInfoEnabled )
203
+ {
204
+ EqtTrace . Info ( "VsTestConsoleRequestSender.StartTestRunAsync: Starting test run." ) ;
205
+ }
165
206
await this . SendMessageAndListenAndReportTestResultsAsync (
166
207
MessageType . TestRunAllSourcesWithDefaultHost ,
167
208
new TestRunRequestPayload ( ) { Sources = sources . ToList ( ) , RunSettings = runSettings , TestPlatformOptions = options } ,
@@ -172,6 +213,10 @@ await this.SendMessageAndListenAndReportTestResultsAsync(
172
213
/// <inheritdoc/>
173
214
public void StartTestRun ( IEnumerable < TestCase > testCases , string runSettings , TestPlatformOptions options , ITestRunEventsHandler runEventsHandler )
174
215
{
216
+ if ( EqtTrace . IsInfoEnabled )
217
+ {
218
+ EqtTrace . Info ( "VsTestConsoleRequestSender.StartTestRun: Starting test run." ) ;
219
+ }
175
220
this . SendMessageAndListenAndReportTestResults (
176
221
MessageType . TestRunAllSourcesWithDefaultHost ,
177
222
new TestRunRequestPayload ( ) { TestCases = testCases . ToList ( ) , RunSettings = runSettings , TestPlatformOptions = options } ,
@@ -182,6 +227,11 @@ public void StartTestRun(IEnumerable<TestCase> testCases, string runSettings, Te
182
227
/// <inheritdoc/>
183
228
public async Task StartTestRunAsync ( IEnumerable < TestCase > testCases , string runSettings , TestPlatformOptions options , ITestRunEventsHandler runEventsHandler )
184
229
{
230
+ if ( EqtTrace . IsInfoEnabled )
231
+ {
232
+ EqtTrace . Info ( "VsTestConsoleRequestSender.StartTestRunAsync: Starting test run." ) ;
233
+ }
234
+
185
235
await this . SendMessageAndListenAndReportTestResultsAsync (
186
236
MessageType . TestRunAllSourcesWithDefaultHost ,
187
237
new TestRunRequestPayload ( ) { TestCases = testCases . ToList ( ) , RunSettings = runSettings , TestPlatformOptions = options } ,
@@ -197,6 +247,11 @@ public void StartTestRunWithCustomHost(
197
247
ITestRunEventsHandler runEventsHandler ,
198
248
ITestHostLauncher customHostLauncher )
199
249
{
250
+ if ( EqtTrace . IsInfoEnabled )
251
+ {
252
+ EqtTrace . Info ( "VsTestConsoleRequestSender.StartTestRunWithCustomHost: Starting test run." ) ;
253
+ }
254
+
200
255
this . SendMessageAndListenAndReportTestResults (
201
256
MessageType . GetTestRunnerProcessStartInfoForRunAll ,
202
257
new TestRunRequestPayload ( )
@@ -218,6 +273,11 @@ public async Task StartTestRunWithCustomHostAsync(
218
273
ITestRunEventsHandler runEventsHandler ,
219
274
ITestHostLauncher customHostLauncher )
220
275
{
276
+ if ( EqtTrace . IsInfoEnabled )
277
+ {
278
+ EqtTrace . Info ( "VsTestConsoleRequestSender.StartTestRunWithCustomHostAsync: Starting test run." ) ;
279
+ }
280
+
221
281
await this . SendMessageAndListenAndReportTestResultsAsync (
222
282
MessageType . GetTestRunnerProcessStartInfoForRunAll ,
223
283
new TestRunRequestPayload ( )
@@ -234,6 +294,11 @@ await this.SendMessageAndListenAndReportTestResultsAsync(
234
294
/// <inheritdoc/>
235
295
public void StartTestRunWithCustomHost ( IEnumerable < TestCase > testCases , string runSettings , TestPlatformOptions options , ITestRunEventsHandler runEventsHandler , ITestHostLauncher customHostLauncher )
236
296
{
297
+ if ( EqtTrace . IsInfoEnabled )
298
+ {
299
+ EqtTrace . Info ( "VsTestConsoleRequestSender.StartTestRunWithCustomHost: Starting test run." ) ;
300
+ }
301
+
237
302
this . SendMessageAndListenAndReportTestResults (
238
303
MessageType . GetTestRunnerProcessStartInfoForRunSelected ,
239
304
new TestRunRequestPayload
@@ -250,6 +315,11 @@ public void StartTestRunWithCustomHost(IEnumerable<TestCase> testCases, string r
250
315
/// <inheritdoc/>
251
316
public async Task StartTestRunWithCustomHostAsync ( IEnumerable < TestCase > testCases , string runSettings , TestPlatformOptions options , ITestRunEventsHandler runEventsHandler , ITestHostLauncher customHostLauncher )
252
317
{
318
+ if ( EqtTrace . IsInfoEnabled )
319
+ {
320
+ EqtTrace . Info ( "VsTestConsoleRequestSender.StartTestRunWithCustomHostAsync: Starting test run." ) ;
321
+ }
322
+
253
323
await this . SendMessageAndListenAndReportTestResultsAsync (
254
324
MessageType . GetTestRunnerProcessStartInfoForRunSelected ,
255
325
new TestRunRequestPayload ( )
@@ -266,18 +336,30 @@ await this.SendMessageAndListenAndReportTestResultsAsync(
266
336
/// <inheritdoc/>
267
337
public void CancelTestRun ( )
268
338
{
339
+ if ( EqtTrace . IsInfoEnabled )
340
+ {
341
+ EqtTrace . Info ( "VsTestConsoleRequestSender.CancelTestRun: Cancelling test run." ) ;
342
+ }
269
343
this . communicationManager . SendMessage ( MessageType . CancelTestRun ) ;
270
344
}
271
345
272
346
/// <inheritdoc/>
273
347
public void AbortTestRun ( )
274
348
{
349
+ if ( EqtTrace . IsInfoEnabled )
350
+ {
351
+ EqtTrace . Info ( "VsTestConsoleRequestSender.AbortTestRun: Aborting test run." ) ;
352
+ }
275
353
this . communicationManager . SendMessage ( MessageType . AbortTestRun ) ;
276
354
}
277
355
278
356
/// <inheritdoc/>
279
357
public void CancelDiscovery ( )
280
358
{
359
+ if ( EqtTrace . IsInfoEnabled )
360
+ {
361
+ EqtTrace . Info ( "VsTestConsoleRequestSender.CancelDiscovery: Cancelling test discovery." ) ;
362
+ }
281
363
this . communicationManager . SendMessage ( MessageType . CancelDiscovery ) ;
282
364
}
283
365
@@ -328,7 +410,7 @@ private bool HandShakeWithVsTestConsole()
328
410
else if ( message . MessageType == MessageType . ProtocolError )
329
411
{
330
412
// TODO : Payload for ProtocolError needs to finalized.
331
- EqtTrace . Error ( "VsTestConsoleRequestSender.HandShakeWithVsTestConsole: Version Check failed. ProtolError was revceived from the runner" ) ;
413
+ EqtTrace . Error ( "VsTestConsoleRequestSender.HandShakeWithVsTestConsole: Version Check failed. ProtolError was received from the runner" ) ;
332
414
}
333
415
else
334
416
{
@@ -400,6 +482,11 @@ private void SendMessageAndListenAndReportTestCases(IEnumerable<string> sources,
400
482
}
401
483
else if ( string . Equals ( MessageType . DiscoveryComplete , message . MessageType ) )
402
484
{
485
+ if ( EqtTrace . IsInfoEnabled )
486
+ {
487
+ EqtTrace . Info ( "VsTestConsoleRequestSender.SendMessageAndListenAndReportTestCases: Discovery complete." ) ;
488
+ }
489
+
403
490
var discoveryCompletePayload =
404
491
this . dataSerializer . DeserializePayload < DiscoveryCompletePayload > ( message ) ;
405
492
@@ -461,6 +548,11 @@ private async Task SendMessageAndListenAndReportTestCasesAsync(IEnumerable<strin
461
548
}
462
549
else if ( string . Equals ( MessageType . DiscoveryComplete , message . MessageType ) )
463
550
{
551
+ if ( EqtTrace . IsInfoEnabled )
552
+ {
553
+ EqtTrace . Info ( "VsTestConsoleRequestSender.SendMessageAndListenAndReportTestCasesAsync: Discovery complete." ) ;
554
+ }
555
+
464
556
var discoveryCompletePayload =
465
557
this . dataSerializer . DeserializePayload < DiscoveryCompletePayload > ( message ) ;
466
558
@@ -520,6 +612,11 @@ private void SendMessageAndListenAndReportTestResults(string messageType, object
520
612
}
521
613
else if ( string . Equals ( MessageType . ExecutionComplete , message . MessageType ) )
522
614
{
615
+ if ( EqtTrace . IsInfoEnabled )
616
+ {
617
+ EqtTrace . Info ( "VsTestConsoleRequestSender.SendMessageAndListenAndReportTestResults: Execution complete." ) ;
618
+ }
619
+
523
620
var testRunCompletePayload =
524
621
this . dataSerializer . DeserializePayload < TestRunCompletePayload > ( message ) ;
525
622
@@ -578,6 +675,11 @@ private async Task SendMessageAndListenAndReportTestResultsAsync(string messageT
578
675
}
579
676
else if ( string . Equals ( MessageType . ExecutionComplete , message . MessageType ) )
580
677
{
678
+ if ( EqtTrace . IsInfoEnabled )
679
+ {
680
+ EqtTrace . Info ( "VsTestConsoleRequestSender.SendMessageAndListenAndReportTestResultsAsync: Execution complete." ) ;
681
+ }
682
+
581
683
var testRunCompletePayload =
582
684
this . dataSerializer . DeserializePayload < TestRunCompletePayload > ( message ) ;
583
685
0 commit comments