diff --git a/src/Microsoft.TestPlatform.Common/Telemetry/TelemetryDataConstants.cs b/src/Microsoft.TestPlatform.Common/Telemetry/TelemetryDataConstants.cs index 0d29dcff28..b7a277e1e1 100644 --- a/src/Microsoft.TestPlatform.Common/Telemetry/TelemetryDataConstants.cs +++ b/src/Microsoft.TestPlatform.Common/Telemetry/TelemetryDataConstants.cs @@ -19,6 +19,8 @@ public static class TelemetryDataConstants public static string TestSettingsUsed = "VS.TestRun.IsTestSettingsUsed"; + public static string DisableAppDomain = "VS.TestRun.DisableAppDomain"; + // All data related to legacy settings nodes will be prefixed with this. public static string LegacySettingPrefix = "VS.TestRun.LegacySettings"; diff --git a/src/vstest.console/TestPlatformHelpers/TestRequestManager.cs b/src/vstest.console/TestPlatformHelpers/TestRequestManager.cs index 80fcda1712..8ac9548de3 100644 --- a/src/vstest.console/TestPlatformHelpers/TestRequestManager.cs +++ b/src/vstest.console/TestPlatformHelpers/TestRequestManager.cs @@ -639,6 +639,10 @@ private void CollectMetrics(IRequestData requestData, RunConfiguration runConfig // Collecting TargetOS requestData.MetricsCollection.Add(TelemetryDataConstants.TargetOS, new PlatformEnvironment().OperatingSystemVersion); + + //Collecting DisableAppDomain + requestData.MetricsCollection.Add(TelemetryDataConstants.DisableAppDomain, runConfiguration.DisableAppDomain); + } /// diff --git a/test/vstest.console.UnitTests/TestPlatformHelpers/TestRequestManagerTests.cs b/test/vstest.console.UnitTests/TestPlatformHelpers/TestRequestManagerTests.cs index ac9ef40c09..8cac6457e6 100644 --- a/test/vstest.console.UnitTests/TestPlatformHelpers/TestRequestManagerTests.cs +++ b/test/vstest.console.UnitTests/TestPlatformHelpers/TestRequestManagerTests.cs @@ -268,6 +268,7 @@ public void DiscoverTestsShouldCollectMetrics() 2 x86 Framework35 + True 169.254.193.190 @@ -296,15 +297,15 @@ public void DiscoverTestsShouldCollectMetrics() this.testRequestManager.DiscoverTests(payload, mockDiscoveryRegistrar.Object, mockProtocolConfig); // Verify. - object targetDevice; - object maxcount; - object targetPlatform; + object targetDevice, maxcount, targetPlatform, disableAppDomain; Assert.IsTrue(actualRequestData.MetricsCollection.Metrics.TryGetValue(TelemetryDataConstants.TargetDevice, out targetDevice)); Assert.IsTrue(actualRequestData.MetricsCollection.Metrics.TryGetValue(TelemetryDataConstants.MaxCPUcount, out maxcount)); Assert.IsTrue(actualRequestData.MetricsCollection.Metrics.TryGetValue(TelemetryDataConstants.TargetPlatform, out targetPlatform)); + Assert.IsTrue(actualRequestData.MetricsCollection.Metrics.TryGetValue(TelemetryDataConstants.DisableAppDomain, out disableAppDomain)); Assert.AreEqual("Other", targetDevice); Assert.AreEqual(2, maxcount); Assert.AreEqual("X86", targetPlatform.ToString()); + Assert.AreEqual(true, disableAppDomain); } [TestMethod] @@ -1062,6 +1063,7 @@ public void RunTestsShouldCollectMetrics() 2 x86 Framework35 + True 169.254.193.190 @@ -1089,16 +1091,15 @@ public void RunTestsShouldCollectMetrics() this.testRequestManager.RunTests(payload, new Mock().Object, new Mock().Object, mockProtocolConfig); // Verify - // Verify. - object targetDevice; - object maxcount; - object targetPlatform; + object targetDevice, maxcount, targetPlatform, disableAppDomain; Assert.IsTrue(actualRequestData.MetricsCollection.Metrics.TryGetValue(TelemetryDataConstants.TargetDevice, out targetDevice)); Assert.IsTrue(actualRequestData.MetricsCollection.Metrics.TryGetValue(TelemetryDataConstants.MaxCPUcount, out maxcount)); Assert.IsTrue(actualRequestData.MetricsCollection.Metrics.TryGetValue(TelemetryDataConstants.TargetPlatform, out targetPlatform)); + Assert.IsTrue(actualRequestData.MetricsCollection.Metrics.TryGetValue(TelemetryDataConstants.DisableAppDomain, out disableAppDomain)); Assert.AreEqual("Other", targetDevice); Assert.AreEqual(2, maxcount); Assert.AreEqual("X86", targetPlatform.ToString()); + Assert.AreEqual(true, disableAppDomain); } [TestMethod]