diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/Constants.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/Constants.cs
new file mode 100644
index 0000000000..44754c2535
--- /dev/null
+++ b/src/Microsoft.TestPlatform.CrossPlatEngine/Constants.cs
@@ -0,0 +1,29 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+namespace Microsoft.VisualStudio.TestPlatform.CrossPlatEngine
+{
+ using Microsoft.VisualStudio.TestPlatform.PlatformAbstractions;
+ using System.Collections.Generic;
+ using System.Collections.ObjectModel;
+ using System.IO;
+
+ ///
+ /// The set of constants used throughout this project.
+ ///
+ public class Constants
+ {
+ // Replace this collection with list of adapters we want to whitelist from "Extensions" folder in Next Major VS Release
+ internal static readonly IList DefaultAdapters = new ReadOnlyCollection(new List
+ {
+ "executor://CodedWebTestAdapter/v1",
+ "executor://GenericTestAdapter/v1",
+ "executor://OrderedTestAdapter/v1",
+ "executor://MSTestAdapter/v1",
+ "executor://WebTestAdapter/v1",
+ "executor://CppUnitTestExecutor/v1"
+ });
+
+ internal static string DefaultAdapterLocation = Path.Combine(new ProcessHelper().GetCurrentProcessLocation(), "Extensions");
+ }
+}
\ No newline at end of file
diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/Discovery/DiscovererEnumerator.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/Discovery/DiscovererEnumerator.cs
index 293b710050..b692e2c311 100644
--- a/src/Microsoft.TestPlatform.CrossPlatEngine/Discovery/DiscovererEnumerator.cs
+++ b/src/Microsoft.TestPlatform.CrossPlatEngine/Discovery/DiscovererEnumerator.cs
@@ -9,6 +9,7 @@ namespace Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Discovery
using System.Globalization;
using System.IO;
using System.Linq;
+ using System.Reflection;
using Microsoft.VisualStudio.TestPlatform.Common.ExtensionFramework;
using Microsoft.VisualStudio.TestPlatform.Common.ExtensionFramework.Utilities;
@@ -23,6 +24,7 @@ namespace Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Discovery
using Microsoft.VisualStudio.TestPlatform.ObjectModel.Adapter;
using Microsoft.VisualStudio.TestPlatform.ObjectModel.Client;
using Microsoft.VisualStudio.TestPlatform.ObjectModel.Logging;
+ using Microsoft.VisualStudio.TestPlatform.PlatformAbstractions;
using CrossPlatEngineResources = Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Resources.Resources;
@@ -105,6 +107,8 @@ private void LoadTestsFromAnExtension(string extensionAssembly, IEnumerable> execut
{
double totalTimeTakenByAdapters = 0;
+ var executorsFromDeprecatedLocations = false;
+
// Call the executor for each group of tests.
var exceptionsHitDuringRunTests = false;
@@ -417,6 +421,13 @@ private bool RunTestInternalWithExecutors(IEnumerable> execut
var totalTestRun = this.testRunCache.TotalExecutedTests - totalTests;
this.requestData.MetricsCollection.Add(string.Format("{0}.{1}", TelemetryDataConstants.TotalTestsRanByAdapter, executorUriExtensionTuple.Item1.AbsoluteUri), totalTestRun);
+ if (!CrossPlatEngine.Constants.DefaultAdapters.Contains(executor.Metadata.ExtensionUri, StringComparer.OrdinalIgnoreCase))
+ {
+ var executorLocation = executor.Value.GetType().GetTypeInfo().Assembly.GetAssemblyLocation();
+
+ executorsFromDeprecatedLocations |= Path.GetDirectoryName(executorLocation).Equals(CrossPlatEngine.Constants.DefaultAdapterLocation);
+ }
+
totalTests = this.testRunCache.TotalExecutedTests;
}
@@ -471,6 +482,11 @@ private bool RunTestInternalWithExecutors(IEnumerable> execut
// Collecting Total Time Taken by Adapters
this.requestData.MetricsCollection.Add(TelemetryDataConstants.TimeTakenByAllAdaptersInSec, totalTimeTakenByAdapters);
+ if (executorsFromDeprecatedLocations)
+ {
+ this.TestRunEventsHandler?.HandleLogMessage(TestMessageLevel.Warning, string.Format(CultureInfo.CurrentCulture, CrossPlatEngineResources.DeprecatedAdapterPath));
+ }
+
return exceptionsHitDuringRunTests;
}
diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/Resources/Resources.Designer.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/Resources/Resources.Designer.cs
index 7d5dfd61f6..750d15f4c1 100644
--- a/src/Microsoft.TestPlatform.CrossPlatEngine/Resources/Resources.Designer.cs
+++ b/src/Microsoft.TestPlatform.CrossPlatEngine/Resources/Resources.Designer.cs
@@ -78,7 +78,18 @@ internal static string DataCollectorDebuggerWarning {
return ResourceManager.GetString("DataCollectorDebuggerWarning", resourceCulture);
}
}
-
+
+ ///
+ /// Looks up a localized string similar to Adapter lookup is being changed, please follow https://github.com/Microsoft/vstest-docs/blob/master/RFCs/0022-User-Specified-TestAdapter-Lookup.md#roadmap for more details..
+ ///
+ internal static string DeprecatedAdapterPath
+ {
+ get
+ {
+ return ResourceManager.GetString("DeprecatedAdapterPath", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Exception occurred while instantiating discoverer : {0}.
///
diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/Resources/Resources.resx b/src/Microsoft.TestPlatform.CrossPlatEngine/Resources/Resources.resx
index 7750aca1de..63da8ebe38 100644
--- a/src/Microsoft.TestPlatform.CrossPlatEngine/Resources/Resources.resx
+++ b/src/Microsoft.TestPlatform.CrossPlatEngine/Resources/Resources.resx
@@ -192,4 +192,7 @@
Could not find extensions: {0}
+
+ Adapter lookup is being changed, please follow https://github.com/Microsoft/vstest-docs/blob/master/RFCs/0022-User-Specified-TestAdapter-Lookup.md#roadmap for more details.
+
\ No newline at end of file
diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/Resources/xlf/Resources.cs.xlf b/src/Microsoft.TestPlatform.CrossPlatEngine/Resources/xlf/Resources.cs.xlf
index 99a13497ae..873ac767a1 100644
--- a/src/Microsoft.TestPlatform.CrossPlatEngine/Resources/xlf/Resources.cs.xlf
+++ b/src/Microsoft.TestPlatform.CrossPlatEngine/Resources/xlf/Resources.cs.xlf
@@ -196,6 +196,11 @@
Could not find extensions: {0}
+
+
+ Adapter lookup is being changed, please follow https://github.com/Microsoft/vstest-docs/blob/master/RFCs/0022-User-Specified-TestAdapter-Lookup.md#roadmap for more details.
+
+