Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TestPlugin cache refactored. #709

Merged
merged 16 commits into from
Apr 18, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Reverted changes for adding Default Extensions Path in testadapterpat…
…hs in runsettings.
  • Loading branch information
Harsh Jain committed Apr 18, 2017
commit 8b9fd52d41697f15088077baecd69104d32e68d4
31 changes: 0 additions & 31 deletions src/vstest.console/TestPlatformHelpers/TestRequestManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@ namespace Microsoft.VisualStudio.TestPlatform.CommandLine.TestPlatformHelpers
using Microsoft.VisualStudio.TestPlatform.ObjectModel.Client.Interfaces;
using Microsoft.VisualStudio.TestPlatform.ObjectModel.Utilities;
using Microsoft.VisualStudio.TestPlatform.Utilities;
using Microsoft.VisualStudio.TestPlatform.Utilities.Helpers;
using System.Reflection;
using Microsoft.VisualStudio.TestPlatform.Common.ExtensionFramework;
using Microsoft.VisualStudio.TestPlatform.Common;

/// <summary>
/// Defines the TestRequestManger which can fire off discovery and test run requests
Expand Down Expand Up @@ -144,8 +140,6 @@ public bool DiscoverTests(DiscoveryRequestPayload discoveryPayload, ITestDiscove
runsettings = updatedRunsettings;
}

runsettings = UpdateDefaultExtensionsPathInRunSettings(runsettings);

// create discovery request
var criteria = new DiscoveryCriteria(discoveryPayload.Sources, batchSize, this.commandLineOptions.TestStatsEventTimeout, runsettings);

Expand Down Expand Up @@ -214,8 +208,6 @@ public bool RunTests(TestRunRequestPayload testRunRequestPayload, ITestHostLaunc
runsettings = updatedRunsettings;
}

runsettings = UpdateDefaultExtensionsPathInRunSettings(runsettings);

if (testRunRequestPayload.Sources != null && testRunRequestPayload.Sources.Any())
{
runCriteria = new TestRunCriteria(
Expand Down Expand Up @@ -353,28 +345,5 @@ ex is SettingsException ||
return success;
}
}

/// <summary>
/// Find all test platform extensions from the `.\Extensions` directory. This is used to load the inbox extensions like
/// Trx logger and legacy test extensions like mstest v1, mstest c++ etc..
/// </summary>
private static string UpdateDefaultExtensionsPathInRunSettings(string runSettings)
{
var fileHelper = new FileHelper();
var extensionsFolder = Path.Combine(Path.GetDirectoryName(typeof(TestPlatform).GetTypeInfo().Assembly.Location), "Extensions");
var runsettings = new RunSettings();
runsettings.LoadSettingsXml(runSettings);
var runConfig = (RunConfiguration)runsettings.GetSettings("RunConfiguration");
if (string.IsNullOrWhiteSpace(runConfig.TestAdaptersPaths))
{
runConfig.TestAdaptersPaths = extensionsFolder;
}
else
{
runConfig.TestAdaptersPaths = string.Concat(runConfig.TestAdaptersPaths, ';', extensionsFolder);
}

return runsettings.SettingsXml;
}
}
}