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
Show file tree
Hide file tree
Changes from all commits
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
5 changes: 2 additions & 3 deletions src/Microsoft.TestPlatform.Client/TestPlatform.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ public ITestRunRequest CreateTestRunRequest(TestRunCriteria testRunCriteria, Pro
throw new ArgumentNullException(nameof(testRunCriteria));
}

// Update cache with Extension Folder's files
this.AddExtensionAssemblies(testRunCriteria.TestRunSettings);

var runConfiguration = XmlRunSettingsUtilities.GetRunConfigurationNode(testRunCriteria.TestRunSettings);
Expand Down Expand Up @@ -201,8 +200,7 @@ private void AddExtensionAssemblies(string runSettings)
/// </param>
private void AddExtensionAssembliesFromSource(TestRunCriteria testRunCriteria)
{
// Find source directories
var sources = testRunCriteria.Sources;
IEnumerable<string> sources = testRunCriteria.Sources;
if (testRunCriteria.HasSpecificTests)
{
// If the test execution is with a test filter, group them by sources
Expand All @@ -211,6 +209,7 @@ private void AddExtensionAssembliesFromSource(TestRunCriteria testRunCriteria)

// Currently we support discovering loggers only from Source directory
var loggersToUpdate = new List<string>();

foreach (var source in sources)
{
var sourceDirectory = Path.GetDirectoryName(source);
Expand Down
1 change: 0 additions & 1 deletion src/Microsoft.TestPlatform.Common/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,5 @@ public static class TestPlatformConstants
/// Regex pattern used to find the settings provider.
/// </summary>
public const string SettingsProviderRegexPattern = @".*SettingsProvider.dll";

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ namespace Microsoft.VisualStudio.TestPlatform.Common.ExtensionFramework
/// <summary>
/// Responsible for managing the Test Discoverer extensions which are available.
/// </summary>
internal class TestDiscoveryExtensionManager
internal class TestDiscoveryExtensionManager
{
#region Fields

private static TestDiscoveryExtensionManager testDiscoveryExtensionManager;

#endregion
Expand Down Expand Up @@ -79,7 +79,8 @@ public static TestDiscoveryExtensionManager Create()
IEnumerable<LazyExtension<ITestDiscoverer, ITestDiscovererCapabilities>> testExtensions;

TestPluginManager.Instance
.GetTestExtensions<ITestDiscoverer, ITestDiscovererCapabilities, TestDiscovererMetadata>(
.GetSpecificTestExtensions<TestDiscovererPluginInformation, ITestDiscoverer, ITestDiscovererCapabilities, TestDiscovererMetadata>(
TestPlatformConstants.TestAdapterRegexPattern,
out unfilteredTestExtensions,
out testExtensions);

Expand All @@ -106,7 +107,7 @@ public static TestDiscoveryExtensionManager GetDiscoveryExtensionManager(string
IEnumerable<LazyExtension<ITestDiscoverer, ITestDiscovererCapabilities>> testExtensions;

TestPluginManager.Instance
.GetTestExtensions<ITestDiscoverer, ITestDiscovererCapabilities, TestDiscovererMetadata>(
.GetTestExtensions<TestDiscovererPluginInformation, ITestDiscoverer, ITestDiscovererCapabilities, TestDiscovererMetadata>(
extensionAssembly,
out unfilteredTestExtensions,
out testExtensions);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace Microsoft.VisualStudio.TestPlatform.Common.ExtensionFramework
using Microsoft.VisualStudio.TestPlatform.ObjectModel;
using Microsoft.VisualStudio.TestPlatform.ObjectModel.Adapter;
using Microsoft.VisualStudio.TestPlatform.ObjectModel.Logging;

/// <summary>
/// Manages the the Test Executor extensions.
/// </summary>
Expand Down Expand Up @@ -67,12 +67,13 @@ internal static TestExecutorExtensionManager Create()
IEnumerable<LazyExtension<ITestExecutor, ITestExecutorCapabilities>> testExtensions;

TestPluginManager.Instance
.GetTestExtensions<ITestExecutor, ITestExecutorCapabilities, TestExecutorMetadata>(
.GetSpecificTestExtensions<TestExecutorPluginInformation, ITestExecutor, ITestExecutorCapabilities, TestExecutorMetadata>(
TestPlatformConstants.TestAdapterRegexPattern,
out unfilteredTestExtensions,
out testExtensions);

testExecutorExtensionManager = new TestExecutorExtensionManager(
unfilteredTestExtensions, testExtensions, TestSessionMessageLogger.Instance);
unfilteredTestExtensions, testExtensions, TestSessionMessageLogger.Instance);
}
}
}
Expand All @@ -95,7 +96,7 @@ internal static TestExecutorExtensionManager GetExecutionExtensionManager(string
IEnumerable<LazyExtension<ITestExecutor, ITestExecutorCapabilities>> testExtensions;

TestPluginManager.Instance
.GetTestExtensions<ITestExecutor, ITestExecutorCapabilities, TestExecutorMetadata>(
.GetTestExtensions<TestExecutorPluginInformation, ITestExecutor, ITestExecutorCapabilities, TestExecutorMetadata>(
extensionAssembly,
out unfilteredTestExtensions,
out testExtensions);
Expand Down
Loading