Skip to content

Commit

Permalink
Integration of vstest.console process with datacollector process. (mi…
Browse files Browse the repository at this point in the history
…crosoft#418)

* saving changes.

* vstest.console process and datacollector process integration.

* Fixed failing test.

* Updated Class name in eqttrace.

* PR feedback.

* PR feedback.

* xlf files.

* fixing build issues that were introduced while merging.
* xlf files.
* fixing build issues that were introduced while merging.
  • Loading branch information
harshjain2 authored Feb 2, 2017
1 parent 8f5c4f6 commit 9e5a0f9
Show file tree
Hide file tree
Showing 92 changed files with 2,258 additions and 1,012 deletions.
30 changes: 30 additions & 0 deletions TestPlatform.sln
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SimpleTestProject3", "test\
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "datacollector.UnitTests", "test\datacollector.UnitTests\datacollector.UnitTests.csproj", "{0C6EFAF9-CE3E-4C11-8DD8-D7DABB206E5C}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "datacollector.PlatformTests", "test\datacollector.PlatformTests\datacollector.PlatformTests.csproj", "{FF80D706-8309-4E02-BAC0-D28B4CBCF600}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OutOfProcDataCollector", "test\TestAssets\OutOfProcDataCollector\OutOfProcDataCollector.csproj", "{CB6FA3C6-38E2-4DD1-AAB7-A705EFE114BC}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -686,6 +690,30 @@ Global
{0C6EFAF9-CE3E-4C11-8DD8-D7DABB206E5C}.Release|x64.Build.0 = Release|x64
{0C6EFAF9-CE3E-4C11-8DD8-D7DABB206E5C}.Release|x86.ActiveCfg = Release|x86
{0C6EFAF9-CE3E-4C11-8DD8-D7DABB206E5C}.Release|x86.Build.0 = Release|x86
{FF80D706-8309-4E02-BAC0-D28B4CBCF600}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FF80D706-8309-4E02-BAC0-D28B4CBCF600}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FF80D706-8309-4E02-BAC0-D28B4CBCF600}.Debug|x64.ActiveCfg = Debug|Any CPU
{FF80D706-8309-4E02-BAC0-D28B4CBCF600}.Debug|x64.Build.0 = Debug|Any CPU
{FF80D706-8309-4E02-BAC0-D28B4CBCF600}.Debug|x86.ActiveCfg = Debug|Any CPU
{FF80D706-8309-4E02-BAC0-D28B4CBCF600}.Debug|x86.Build.0 = Debug|Any CPU
{FF80D706-8309-4E02-BAC0-D28B4CBCF600}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FF80D706-8309-4E02-BAC0-D28B4CBCF600}.Release|Any CPU.Build.0 = Release|Any CPU
{FF80D706-8309-4E02-BAC0-D28B4CBCF600}.Release|x64.ActiveCfg = Release|Any CPU
{FF80D706-8309-4E02-BAC0-D28B4CBCF600}.Release|x64.Build.0 = Release|Any CPU
{FF80D706-8309-4E02-BAC0-D28B4CBCF600}.Release|x86.ActiveCfg = Release|Any CPU
{FF80D706-8309-4E02-BAC0-D28B4CBCF600}.Release|x86.Build.0 = Release|Any CPU
{CB6FA3C6-38E2-4DD1-AAB7-A705EFE114BC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CB6FA3C6-38E2-4DD1-AAB7-A705EFE114BC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CB6FA3C6-38E2-4DD1-AAB7-A705EFE114BC}.Debug|x64.ActiveCfg = Debug|x64
{CB6FA3C6-38E2-4DD1-AAB7-A705EFE114BC}.Debug|x64.Build.0 = Debug|x64
{CB6FA3C6-38E2-4DD1-AAB7-A705EFE114BC}.Debug|x86.ActiveCfg = Debug|x86
{CB6FA3C6-38E2-4DD1-AAB7-A705EFE114BC}.Debug|x86.Build.0 = Debug|x86
{CB6FA3C6-38E2-4DD1-AAB7-A705EFE114BC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CB6FA3C6-38E2-4DD1-AAB7-A705EFE114BC}.Release|Any CPU.Build.0 = Release|Any CPU
{CB6FA3C6-38E2-4DD1-AAB7-A705EFE114BC}.Release|x64.ActiveCfg = Release|x64
{CB6FA3C6-38E2-4DD1-AAB7-A705EFE114BC}.Release|x64.Build.0 = Release|x64
{CB6FA3C6-38E2-4DD1-AAB7-A705EFE114BC}.Release|x86.ActiveCfg = Release|x86
{CB6FA3C6-38E2-4DD1-AAB7-A705EFE114BC}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -743,5 +771,7 @@ Global
{0D85D957-6FF2-4620-B766-B708801D97F3} = {8DA7CBD9-F17E-41B6-90C4-CFF55848A25A}
{9549C1A4-CB57-4689-B3EB-F752F65F863F} = {8DA7CBD9-F17E-41B6-90C4-CFF55848A25A}
{0C6EFAF9-CE3E-4C11-8DD8-D7DABB206E5C} = {B27FAFDF-2DBA-4AB0-BA85-FD5F21D359D6}
{FF80D706-8309-4E02-BAC0-D28B4CBCF600} = {B27FAFDF-2DBA-4AB0-BA85-FD5F21D359D6}
{CB6FA3C6-38E2-4DD1-AAB7-A705EFE114BC} = {8DA7CBD9-F17E-41B6-90C4-CFF55848A25A}
EndGlobalSection
EndGlobal
34 changes: 17 additions & 17 deletions src/Microsoft.TestPlatform.Client/Execution/TestRunRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ namespace Microsoft.VisualStudio.TestPlatform.Client.Execution
using Microsoft.VisualStudio.TestPlatform.Utilities;

using ClientResources = Microsoft.VisualStudio.TestPlatform.Client.Resources.Resources;
using System.Collections.ObjectModel;

public class TestRunRequest : ITestRunRequest, ITestRunEventsHandler
{
Expand All @@ -26,7 +27,7 @@ internal TestRunRequest(TestRunCriteria testRunCriteria, IProxyExecutionManager
EqtTrace.Verbose("TestRunRequest.ExecuteAsync: Creating test run request.");
this.testRunCriteria = testRunCriteria;
this.ExecutionManager = executionManager;

this.State = TestRunState.Pending;
}

Expand All @@ -39,7 +40,7 @@ internal TestRunRequest(TestRunCriteria testRunCriteria, IProxyExecutionManager
public int ExecuteAsync()
{
EqtTrace.Verbose("TestRunRequest.ExecuteAsync: Starting.");

lock (this.syncObject)
{
if (this.disposed)
Expand All @@ -53,17 +54,17 @@ public int ExecuteAsync()
}

EqtTrace.Info("TestRunRequest.ExecuteAsync: Starting run with settings:{0}", this.testRunCriteria);

// Waiting for warm up to be over.
EqtTrace.Verbose("TestRunRequest.ExecuteAsync: Wait for the first run request is over.");

this.State = TestRunState.InProgress;

// Reset the run completion event
// (This needs to be done before queuing the test run because if the test run finishes fast then runCompletion event can
// remain in non-signaled state even though run is actually complete.
this.runCompletionEvent.Reset();

try
{
this.runRequestTimeTracker = new Stopwatch();
Expand All @@ -72,7 +73,7 @@ public int ExecuteAsync()
this.runRequestTimeTracker.Start();
int processId = this.ExecutionManager.StartTestRun(this.testRunCriteria, this);
EqtTrace.Info("TestRunRequest.ExecuteAsync: Started.");

return processId;
}
catch
Expand All @@ -88,8 +89,8 @@ public int ExecuteAsync()
/// </summary>
public bool WaitForCompletion(int timeout)
{
EqtTrace.Verbose("TestRunRequest.WaitForCompletion: Waiting with timeout {0}.", timeout);
EqtTrace.Verbose("TestRunRequest.WaitForCompletion: Waiting with timeout {0}.", timeout);

if (this.disposed)
{
throw new ObjectDisposedException("testRunRequest");
Expand Down Expand Up @@ -122,7 +123,7 @@ public bool WaitForCompletion(int timeout)
public void CancelAsync()
{
EqtTrace.Verbose("TestRunRequest.CancelAsync: Canceling.");

lock (this.syncObject)
{
if (this.disposed)
Expand All @@ -132,7 +133,7 @@ public void CancelAsync()

if (this.State != TestRunState.InProgress)
{
EqtTrace.Info("Ignoring TestRunRequest.CancelAsync(). No test run in progress.");
EqtTrace.Info("Ignoring TestRunRequest.CancelAsync(). No test run in progress.");
}
else
{
Expand Down Expand Up @@ -170,7 +171,7 @@ public void Abort()

EqtTrace.Info("TestRunRequest.Abort: Aborted.");
}


/// <summary>
/// Specifies the test run criteria
Expand All @@ -194,13 +195,13 @@ public ITestRunConfiguration TestRunConfiguration
/// Raised when the test message is received.
/// </summary>
public event EventHandler<TestRunMessageEventArgs> TestRunMessage;


/// <summary>
/// Raised when the test run completes.
/// </summary>
public event EventHandler<TestRunCompleteEventArgs> OnRunCompletion;


/// <summary>
/// Raised when data collection message is received.
Expand Down Expand Up @@ -291,7 +292,7 @@ public void HandleTestRunComplete(TestRunCompleteEventArgs runCompleteArgs, Test
runCompleteArgs.IsCanceled,
runCompleteArgs.IsAborted,
runCompleteArgs.Error,
null,
runContextAttachments as Collection<AttachmentSet>,
this.runRequestTimeTracker.Elapsed);

// Ignore the time sent (runCompleteArgs.ElapsedTimeInRunningTests)
Expand Down Expand Up @@ -363,7 +364,6 @@ public virtual void HandleTestRunStatsChange(TestRunChangedEventArgs testRunChan
EqtTrace.Info("TestRunRequest:SendTestRunStatsChange: Completed.");
}
}


/// <summary>
/// Invoked when log messages are received
Expand Down Expand Up @@ -410,7 +410,7 @@ public int LaunchProcessWithDebuggerAttached(TestProcessStartInfo testProcessSta
{
processId = this.testRunCriteria.TestHostLauncher.LaunchTestHost(testProcessStartInfo);
}

return processId;
}

Expand Down Expand Up @@ -459,7 +459,7 @@ protected virtual void Dispose(bool disposing)
/// The run completion event which will be signalled on completion of test run.
/// </summary>
private ManualResetEvent runCompletionEvent = new ManualResetEvent(true);


/// <summary>
/// Tracks the time taken by each run request
Expand Down
Loading

0 comments on commit 9e5a0f9

Please sign in to comment.