From 4e4f46161013976846f1362ca8254638c8f27162 Mon Sep 17 00:00:00 2001 From: Faizan Ahmad Date: Wed, 10 Aug 2016 09:41:29 -0700 Subject: [PATCH 1/4] This Commit has two thing 1) Add Trx Logger in Vsix. 2) Pass output path to Trx logger. the path where the trx will get generated. --- .../Logging/TestLoggerManager.cs | 48 ++++++++++++++++--- .../TrxLogger.cs | 2 - .../CopyTrxToExtension.cmd | 19 ++++++++ .../project.json | 10 ++-- 4 files changed, 66 insertions(+), 13 deletions(-) create mode 100644 src/Microsoft.TestPlatform.VSIXCreator/CopyTrxToExtension.cmd diff --git a/src/Microsoft.TestPlatform.Common/Logging/TestLoggerManager.cs b/src/Microsoft.TestPlatform.Common/Logging/TestLoggerManager.cs index f33df67691..4a43c3219d 100644 --- a/src/Microsoft.TestPlatform.Common/Logging/TestLoggerManager.cs +++ b/src/Microsoft.TestPlatform.Common/Logging/TestLoggerManager.cs @@ -6,11 +6,14 @@ namespace Microsoft.VisualStudio.TestPlatform.Common.Logging using Microsoft.VisualStudio.TestPlatform.ObjectModel; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Client; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Logging; + using ObjectModel.Utilities; using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.Globalization; + using System.IO; using System.Linq; + using Utilities; using CommonResources = Microsoft.VisualStudio.TestPlatform.Common.Resources; /// @@ -157,8 +160,7 @@ public void AddLogger(Uri uri, Dictionary parameters) } else { - // todo Read Output Directory from RunSettings - ((ITestLogger)logger.Value).Initialize(this.loggerEvents, null); + ((ITestLogger)logger.Value).Initialize(this.loggerEvents, GetResultsDirectory(RunSettingsManager.Instance.ActiveRunSettings)); } } catch (Exception e) @@ -339,7 +341,41 @@ protected virtual void Dispose(bool disposing) #endregion - #region Private Members + /// + /// Gets the test results directory. + /// + /// Test run settings. + /// Test results directory + private static string GetResultsDirectory(RunSettings runSettings) + { + string resultsDirectory = null; + if (runSettings != null) + { + try + { + RunConfiguration runConfiguration = XmlRunSettingsUtilities.GetRunConfigurationNode(runSettings.SettingsXml); + resultsDirectory = RunSettingsUtilities.GetTestResultsDirectory(runConfiguration); + } + catch (SettingsException se) + { + if (EqtTrace.IsErrorEnabled) + { + EqtTrace.Error("TestLoggerManager.GetResultsDirectory: Unable to get the test results directory: Error {0}", se); + } + } + } + +#if NET46 + if (string.IsNullOrEmpty(resultsDirectory)) + { + resultsDirectory = Path.Combine(Environment.CurrentDirectory, Constants.ResultsDirectoryName); + } +#endif + + return resultsDirectory; + } + +#region Private Members /// /// Populates user supplied and default logger parameters. @@ -366,7 +402,7 @@ private void CheckDisposed() } } - #region Event Handlers +#region Event Handlers /// /// Called when a test run message is received. @@ -423,8 +459,8 @@ private void DiscoveryMessageHandler(object sender, TestRunMessageEventArgs e) { this.loggerEvents.RaiseMessage(e); } - #endregion +#endregion - #endregion +#endregion } } diff --git a/src/Microsoft.TestPlatform.Extensions.TrxLogger/TrxLogger.cs b/src/Microsoft.TestPlatform.Extensions.TrxLogger/TrxLogger.cs index 33631a8607..a03da6c595 100644 --- a/src/Microsoft.TestPlatform.Extensions.TrxLogger/TrxLogger.cs +++ b/src/Microsoft.TestPlatform.Extensions.TrxLogger/TrxLogger.cs @@ -108,8 +108,6 @@ public void Initialize(TestLoggerEvents events, string testRunDirectory) events.TestResult += this.TestResultHandler; events.TestRunComplete += this.TestRunCompleteHandler; - // ToDo: - // currently we are getting null in testRunDirectory because reading run setting work has to be done TrxFileDirectory = testRunDirectory; this.InitializeInternal(); diff --git a/src/Microsoft.TestPlatform.VSIXCreator/CopyTrxToExtension.cmd b/src/Microsoft.TestPlatform.VSIXCreator/CopyTrxToExtension.cmd new file mode 100644 index 0000000000..30d7092f39 --- /dev/null +++ b/src/Microsoft.TestPlatform.VSIXCreator/CopyTrxToExtension.cmd @@ -0,0 +1,19 @@ +@IF NOT DEFINED _ECHO @ECHO OFF + +@ECHO. + +SET TPBINRELPATH=..\\..\\artifacts\\src\\Microsoft.TestPlatform.VSIXCreator\\bin\\Release + +IF EXIST "%TPBINRELPATH%" ( + IF EXIST "%TPBINRELPATH%\\net461\\win7-x64\\Microsoft.VisualStudio.TestPlatform.Extensions.TrxLogger.dll" ( + MOVE /Y "%TPBINRELPATH%\\net461\\win7-x64\\Microsoft.VisualStudio.TestPlatform.Extensions.TrxLogger.dll" "%TPBINRELPATH%\\net461\\win7-x64\\Extensions" + ) +) + +SET TPBINDEBUGPATH=..\\..\\artifacts\\src\\Microsoft.TestPlatform.VSIXCreator\\bin\\Debug + +IF EXIST "%TPBINDEBUGPATH%" ( + IF EXIST "%TPBINDEBUGPATH%\\net461\\win7-x64\\Microsoft.VisualStudio.TestPlatform.Extensions.TrxLogger.dll" ( + MOVE /Y "%TPBINDEBUGPATH%\\net461\\win7-x64\\Microsoft.VisualStudio.TestPlatform.Extensions.TrxLogger.dll" "%TPBINDEBUGPATH%\\net461\\win7-x64\\Extensions" + ) +) diff --git a/src/Microsoft.TestPlatform.VSIXCreator/project.json b/src/Microsoft.TestPlatform.VSIXCreator/project.json index d55301fcec..e8a98ffe3d 100644 --- a/src/Microsoft.TestPlatform.VSIXCreator/project.json +++ b/src/Microsoft.TestPlatform.VSIXCreator/project.json @@ -16,8 +16,8 @@ "scripts": { "precompile": "VSIXDelete.cmd", - "postcompile": [ "VSIXCreator.cmd" ] - }, + "postcompile": [ "CopyTrxToExtension.cmd", "VSIXCreator.cmd" ] + }, "frameworks": { "net461": { @@ -38,10 +38,10 @@ "testhost": "15.0.0-*", "testhost.x86": "15.0.0-*", "vstest.console": "15.0.0-*", - "Microsoft.Internal.TestPlatform.Extensions": { "type": "build", - "version": "15.0.0" - } + "version": "15.0.0" + }, + "Microsoft.TestPlatform.Extensions.TrxLogger": "15.0.0-*" } } \ No newline at end of file From 7538349e671e2b65fcdac44ebfcf74a6052ecd54 Mon Sep 17 00:00:00 2001 From: Faizan Ahmad Date: Wed, 10 Aug 2016 23:30:49 -0700 Subject: [PATCH 2/4] Get path to create trxlogger if "ResultsDirectory" is not present in runsettings --- .../Logging/TestLoggerManager.cs | 24 +++++++++---------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/src/Microsoft.TestPlatform.Common/Logging/TestLoggerManager.cs b/src/Microsoft.TestPlatform.Common/Logging/TestLoggerManager.cs index 4a43c3219d..184332ee04 100644 --- a/src/Microsoft.TestPlatform.Common/Logging/TestLoggerManager.cs +++ b/src/Microsoft.TestPlatform.Common/Logging/TestLoggerManager.cs @@ -55,7 +55,7 @@ internal class TestLoggerManager : ITestDiscoveryEventsRegistrar, ITestRunEvents private TestLoggerExtensionManager testLoggerExtensionManager; private IDiscoveryRequest discoveryRequest; - + #endregion #region Constructor @@ -183,7 +183,7 @@ public void AddLogger(Uri uri, Dictionary parameters) uri.OriginalString)); } } - + /// /// Tries to get uri of the logger corresponding to the friendly name. If no such logger exists return null. /// @@ -205,7 +205,7 @@ public bool TryGetUriFromFriendlyName(string friendlyName, out string loggerUri) loggerUri = null; return false; } - + /// /// Registers to receive events from the provided test run request. /// These events will then be broadcast to any registered loggers. @@ -241,7 +241,7 @@ public void RegisterDiscoveryEvents(IDiscoveryRequest discoveryRequest) this.discoveryRequest = discoveryRequest; discoveryRequest.OnDiscoveryMessage += this.DiscoveryMessageHandler; } - + /// /// Unregisters the events from the test run request. /// @@ -255,7 +255,7 @@ public void UnregisterTestRunEvents(ITestRunRequest testRunRequest) testRunRequest.OnRunCompletion -= this.TestRunCompleteHandler; this.runRequest.DataCollectionMessage -= this.DiscoveryMessageHandler; } - + /// /// Unregister the events from the discovery request. /// @@ -341,6 +341,8 @@ protected virtual void Dispose(bool disposing) #endregion + #region Private Members + /// /// Gets the test results directory. /// @@ -365,18 +367,14 @@ private static string GetResultsDirectory(RunSettings runSettings) } } -#if NET46 if (string.IsNullOrEmpty(resultsDirectory)) { - resultsDirectory = Path.Combine(Environment.CurrentDirectory, Constants.ResultsDirectoryName); + resultsDirectory = Path.Combine(Directory.GetCurrentDirectory(), Constants.ResultsDirectoryName); } -#endif return resultsDirectory; } -#region Private Members - /// /// Populates user supplied and default logger parameters. /// @@ -402,7 +400,7 @@ private void CheckDisposed() } } -#region Event Handlers + #region Event Handlers /// /// Called when a test run message is received. @@ -459,8 +457,8 @@ private void DiscoveryMessageHandler(object sender, TestRunMessageEventArgs e) { this.loggerEvents.RaiseMessage(e); } -#endregion + #endregion -#endregion + #endregion } } From 8528c7dcb8b216ff96f2624edb6492f135053201 Mon Sep 17 00:00:00 2001 From: Faizan Ahmad Date: Thu, 11 Aug 2016 08:31:41 -0700 Subject: [PATCH 3/4] 1) Addressed PR comment 2) Added Test 3) Using buildable version of System.Diagnostics.TraceSource --- .../Logging/TestLoggerManager.cs | 13 ++--- .../Utilities/RunSettingsUtilities.cs | 9 +--- .../Constants.cs | 2 +- .../RunSettings/RunConfiguration.cs | 10 ---- .../project.json | 2 +- .../Logging/TestLoggerManagerTests.cs | 47 +++++++++++++++++++ .../project.json | 2 +- .../project.json | 2 +- .../project.json | 2 +- .../project.json | 2 +- .../project.json | 2 +- .../project.json | 2 +- .../project.json | 2 +- test/datacollector.x86.UnitTests/project.json | 2 +- test/testhost.UnitTests/project.json | 2 +- test/vstest.console.UnitTests/project.json | 2 +- 16 files changed, 64 insertions(+), 39 deletions(-) diff --git a/src/Microsoft.TestPlatform.Common/Logging/TestLoggerManager.cs b/src/Microsoft.TestPlatform.Common/Logging/TestLoggerManager.cs index 184332ee04..e782366818 100644 --- a/src/Microsoft.TestPlatform.Common/Logging/TestLoggerManager.cs +++ b/src/Microsoft.TestPlatform.Common/Logging/TestLoggerManager.cs @@ -6,14 +6,14 @@ namespace Microsoft.VisualStudio.TestPlatform.Common.Logging using Microsoft.VisualStudio.TestPlatform.ObjectModel; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Client; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Logging; - using ObjectModel.Utilities; + using Microsoft.VisualStudio.TestPlatform.ObjectModel.Utilities; using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.IO; using System.Linq; - using Utilities; + using Microsoft.VisualStudio.TestPlatform.Common.Utilities; using CommonResources = Microsoft.VisualStudio.TestPlatform.Common.Resources; /// @@ -160,7 +160,7 @@ public void AddLogger(Uri uri, Dictionary parameters) } else { - ((ITestLogger)logger.Value).Initialize(this.loggerEvents, GetResultsDirectory(RunSettingsManager.Instance.ActiveRunSettings)); + ((ITestLogger)logger.Value).Initialize(this.loggerEvents, this.GetResultsDirectory(RunSettingsManager.Instance.ActiveRunSettings)); } } catch (Exception e) @@ -348,7 +348,7 @@ protected virtual void Dispose(bool disposing) /// /// Test run settings. /// Test results directory - private static string GetResultsDirectory(RunSettings runSettings) + internal string GetResultsDirectory(RunSettings runSettings) { string resultsDirectory = null; if (runSettings != null) @@ -367,11 +367,6 @@ private static string GetResultsDirectory(RunSettings runSettings) } } - if (string.IsNullOrEmpty(resultsDirectory)) - { - resultsDirectory = Path.Combine(Directory.GetCurrentDirectory(), Constants.ResultsDirectoryName); - } - return resultsDirectory; } diff --git a/src/Microsoft.TestPlatform.Common/Utilities/RunSettingsUtilities.cs b/src/Microsoft.TestPlatform.Common/Utilities/RunSettingsUtilities.cs index 30ffa10eaa..c1934738a9 100644 --- a/src/Microsoft.TestPlatform.Common/Utilities/RunSettingsUtilities.cs +++ b/src/Microsoft.TestPlatform.Common/Utilities/RunSettingsUtilities.cs @@ -37,14 +37,7 @@ public static string GetTestResultsDirectory(RunConfiguration runConfiguration) string resultsDirectory = null; if (runConfiguration != null) { - if (!runConfiguration.ResultsDirectorySet) - { - resultsDirectory = null; - } - else - { - resultsDirectory = Environment.ExpandEnvironmentVariables(runConfiguration.ResultsDirectory); - } + resultsDirectory = Environment.ExpandEnvironmentVariables(runConfiguration.ResultsDirectory); } return resultsDirectory; diff --git a/src/Microsoft.TestPlatform.ObjectModel/Constants.cs b/src/Microsoft.TestPlatform.ObjectModel/Constants.cs index d5d15aa24c..b2824d88f2 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/Constants.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/Constants.cs @@ -79,7 +79,7 @@ public static class Constants /// /// Default results directory. /// - public static readonly string DefaultResultsDirectory = Path.Combine("%Temp%", ResultsDirectoryName); + public static readonly string DefaultResultsDirectory = Path.Combine(Directory.GetCurrentDirectory(), ResultsDirectoryName); /// /// Default treatment of error from test adapters. diff --git a/src/Microsoft.TestPlatform.ObjectModel/RunSettings/RunConfiguration.cs b/src/Microsoft.TestPlatform.ObjectModel/RunSettings/RunConfiguration.cs index bb6975b86a..1c9fc7df63 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/RunSettings/RunConfiguration.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/RunSettings/RunConfiguration.cs @@ -96,7 +96,6 @@ public string ResultsDirectory set { this.resultsDirectory = value; - this.ResultsDirectorySet = true; } } @@ -240,15 +239,6 @@ public bool TestAdaptersPathsSet private set; } - /// - /// Gets a value indicating whether results directory is set. - /// - public bool ResultsDirectorySet - { - get; - private set; - } - /// /// Gets the binaries root. /// diff --git a/test/Microsoft.TestPlatform.Client.UnitTests/project.json b/test/Microsoft.TestPlatform.Client.UnitTests/project.json index 57f3d781f1..fcbed5caf2 100644 --- a/test/Microsoft.TestPlatform.Client.UnitTests/project.json +++ b/test/Microsoft.TestPlatform.Client.UnitTests/project.json @@ -18,7 +18,7 @@ }, "MSTest.TestFramework": "1.0.0-preview", "moq.netcore": "4.4.0-beta8", - "System.Diagnostics.TraceSource": "4.0.0-rc2-24015", + "System.Diagnostics.TraceSource": "4.0.0", "Microsoft.TestPlatform.Client": "15.0.0-*" }, diff --git a/test/Microsoft.TestPlatform.Common.UnitTests/Logging/TestLoggerManagerTests.cs b/test/Microsoft.TestPlatform.Common.UnitTests/Logging/TestLoggerManagerTests.cs index 5e1b8bb8d0..ec717c4229 100644 --- a/test/Microsoft.TestPlatform.Common.UnitTests/Logging/TestLoggerManagerTests.cs +++ b/test/Microsoft.TestPlatform.Common.UnitTests/Logging/TestLoggerManagerTests.cs @@ -2,6 +2,7 @@ namespace TestPlatform.Common.UnitTests.Logging { + using Microsoft.VisualStudio.TestPlatform.Common; using Microsoft.VisualStudio.TestPlatform.Common.Logging; using Microsoft.VisualStudio.TestPlatform.ObjectModel; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Client; @@ -54,6 +55,52 @@ public void TryGetUriFromFriendlyNameShouldNotReturnUriIfLoggerIsNotAdded() Assert.IsNull(uri); } + [TestMethod] + public void GetResultsDirectoryShouldReturnNullIfRunSettingsIsNull() + { + string result = TestLoggerManager.Instance.GetResultsDirectory(null); + Assert.AreEqual(null, result); + } + + [TestMethod] + public void GetResultsDirectoryIsReadingFromRunsettings() + { + string runSettingsXml = @" + + + 0 + DummyTestResultsFolder + x64 + Framework45 + + "; + + RunSettings runsettings = new RunSettings(); + runsettings.LoadSettingsXml(runSettingsXml); + + string result = TestLoggerManager.Instance.GetResultsDirectory(runsettings); + Assert.AreEqual(string.Compare("DummyTestResultsFolder", result), 0); + } + + [TestMethod] + public void GetResultsDirectoryShouldReturnDefaultPathIfResultsDirectoryIsNotProvidedInRunSettings() + { + string runSettingsXml = @" + + + 0 + x64 + Framework45 + + "; + + RunSettings runsettings = new RunSettings(); + runsettings.LoadSettingsXml(runSettingsXml); + + string result = TestLoggerManager.Instance.GetResultsDirectory(runsettings); + Assert.AreEqual(string.Compare(Constants.DefaultResultsDirectory, result), 0); + } + [TestMethod] public void TestRunRequestRaiseShouldInvokeTestRunMessageHandlerOfLoggersIfRegistered() { diff --git a/test/Microsoft.TestPlatform.Common.UnitTests/project.json b/test/Microsoft.TestPlatform.Common.UnitTests/project.json index b12ef7b3dc..ee3e89f978 100644 --- a/test/Microsoft.TestPlatform.Common.UnitTests/project.json +++ b/test/Microsoft.TestPlatform.Common.UnitTests/project.json @@ -18,7 +18,7 @@ }, "MSTest.TestFramework": "1.0.0-preview", "moq.netcore": "4.4.0-beta8", - "System.Diagnostics.TraceSource": "4.0.0-rc2-24015", + "System.Diagnostics.TraceSource": "4.0.0", "Microsoft.TestPlatform.Common": "15.0.0-*" }, diff --git a/test/Microsoft.TestPlatform.CommunicationUtilities.UnitTests/project.json b/test/Microsoft.TestPlatform.CommunicationUtilities.UnitTests/project.json index eca8f0460b..1e8f6a5df2 100644 --- a/test/Microsoft.TestPlatform.CommunicationUtilities.UnitTests/project.json +++ b/test/Microsoft.TestPlatform.CommunicationUtilities.UnitTests/project.json @@ -18,7 +18,7 @@ }, "MSTest.TestFramework": "1.0.0-preview", "moq.netcore": "4.4.0-beta8", - "System.Diagnostics.TraceSource": "4.0.0-rc2-24015", + "System.Diagnostics.TraceSource": "4.0.0", "Microsoft.TestPlatform.CommunicationUtilities": "15.0.0-*" }, diff --git a/test/Microsoft.TestPlatform.CoreUtilities.UnitTests/project.json b/test/Microsoft.TestPlatform.CoreUtilities.UnitTests/project.json index 6900b217a6..794831b6b5 100644 --- a/test/Microsoft.TestPlatform.CoreUtilities.UnitTests/project.json +++ b/test/Microsoft.TestPlatform.CoreUtilities.UnitTests/project.json @@ -18,7 +18,7 @@ }, "MSTest.TestFramework": "1.0.0-preview", "moq.netcore": "4.4.0-beta8", - "System.Diagnostics.TraceSource": "4.0.0-rc2-24015", + "System.Diagnostics.TraceSource": "4.0.0", "Microsoft.TestPlatform.CoreUtilities": "15.0.0-*" }, diff --git a/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/project.json b/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/project.json index 35ebd037c8..bc857e53e1 100644 --- a/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/project.json +++ b/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/project.json @@ -18,7 +18,7 @@ }, "MSTest.TestFramework": "1.0.0-preview", "moq.netcore": "4.4.0-beta8", - "System.Diagnostics.TraceSource": "4.0.0-rc2-24015", + "System.Diagnostics.TraceSource": "4.0.0", "Microsoft.TestPlatform.CrossPlatEngine": "15.0.0-*", "Microsoft.TestPlatform.ObjectModel": "15.0.0-*", "Microsoft.TestPlatform.Common": "15.0.0-*", diff --git a/test/Microsoft.TestPlatform.Extensions.TrxLogger.UnitTests/project.json b/test/Microsoft.TestPlatform.Extensions.TrxLogger.UnitTests/project.json index eac7795cc8..667f1eac59 100644 --- a/test/Microsoft.TestPlatform.Extensions.TrxLogger.UnitTests/project.json +++ b/test/Microsoft.TestPlatform.Extensions.TrxLogger.UnitTests/project.json @@ -18,7 +18,7 @@ }, "MSTest.TestFramework": "1.0.0-preview", "moq.netcore": "4.4.0-beta8", - "System.Diagnostics.TraceSource": "4.0.0-rc2-24015", + "System.Diagnostics.TraceSource": "4.0.0", "Microsoft.TestPlatform.Client": "15.0.0-*", "Microsoft.TestPlatform.Extensions.TrxLogger": "15.0.0-*", "Microsoft.TestPlatform.ObjectModel": "15.0.0-*" diff --git a/test/Microsoft.TestPlatform.ObjectModel.UnitTests/project.json b/test/Microsoft.TestPlatform.ObjectModel.UnitTests/project.json index 0a55d85444..8cb962b6aa 100644 --- a/test/Microsoft.TestPlatform.ObjectModel.UnitTests/project.json +++ b/test/Microsoft.TestPlatform.ObjectModel.UnitTests/project.json @@ -18,7 +18,7 @@ }, "MSTest.TestFramework": "1.0.0-preview", "moq.netcore": "4.4.0-beta8", - "System.Diagnostics.TraceSource": "4.0.0-rc2-24015", + "System.Diagnostics.TraceSource": "4.0.0", "Microsoft.TestPlatform.ObjectModel": "15.0.0-*" }, diff --git a/test/Microsoft.TestPlatform.VsTestConsole.TranslationLayer.UnitTests/project.json b/test/Microsoft.TestPlatform.VsTestConsole.TranslationLayer.UnitTests/project.json index cf5e667806..4e35eb1074 100644 --- a/test/Microsoft.TestPlatform.VsTestConsole.TranslationLayer.UnitTests/project.json +++ b/test/Microsoft.TestPlatform.VsTestConsole.TranslationLayer.UnitTests/project.json @@ -18,7 +18,7 @@ }, "MSTest.TestFramework": "1.0.0-preview", "moq.netcore": "4.4.0-beta8", - "System.Diagnostics.TraceSource": "4.0.0-rc2-24015", + "System.Diagnostics.TraceSource": "4.0.0", "Microsoft.TestPlatform.VsTestConsole.TranslationLayer": "15.0.0-*", "Microsoft.TestPlatform.CommunicationUtilities": "15.0.0-*", "Microsoft.TestPlatform.ObjectModel": "15.0.0-*" diff --git a/test/datacollector.x86.UnitTests/project.json b/test/datacollector.x86.UnitTests/project.json index f023a24637..12b94d190a 100644 --- a/test/datacollector.x86.UnitTests/project.json +++ b/test/datacollector.x86.UnitTests/project.json @@ -18,7 +18,7 @@ }, "MSTest.TestFramework": "1.0.0-preview", "moq.netcore": "4.4.0-beta8", - "System.Diagnostics.TraceSource": "4.0.0-rc2-24015", + "System.Diagnostics.TraceSource": "4.0.0", "datacollector": "15.0.0-*" }, diff --git a/test/testhost.UnitTests/project.json b/test/testhost.UnitTests/project.json index f66c69f3ad..2d4cd606ad 100644 --- a/test/testhost.UnitTests/project.json +++ b/test/testhost.UnitTests/project.json @@ -18,7 +18,7 @@ }, "MSTest.TestFramework": "1.0.0-preview", "moq.netcore": "4.4.0-beta8", - "System.Diagnostics.TraceSource": "4.0.0-rc2-24015" + "System.Diagnostics.TraceSource": "4.0.0" }, "frameworks": { diff --git a/test/vstest.console.UnitTests/project.json b/test/vstest.console.UnitTests/project.json index 9a5054f7ac..3c44f8706a 100644 --- a/test/vstest.console.UnitTests/project.json +++ b/test/vstest.console.UnitTests/project.json @@ -18,7 +18,7 @@ }, "MSTest.TestFramework": "1.0.0-preview", "moq.netcore": "4.4.0-beta8", - "System.Diagnostics.TraceSource": "4.0.0-rc2-24015", + "System.Diagnostics.TraceSource": "4.0.0", "vstest.console": "15.0.0-*", "Microsoft.TestPlatform.Client": "15.0.0-*" }, From 3d94d37888a03154f7f3f1868640e85b63fd9e16 Mon Sep 17 00:00:00 2001 From: Faizan Ahmad Date: Fri, 12 Aug 2016 05:30:59 -0700 Subject: [PATCH 4/4] Addressed CR comment --- .../Utilities/RunSettingsUtilities.cs | 3 ++- .../Logging/TestLoggerManagerTests.cs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.TestPlatform.Common/Utilities/RunSettingsUtilities.cs b/src/Microsoft.TestPlatform.Common/Utilities/RunSettingsUtilities.cs index c1934738a9..e7a31b8646 100644 --- a/src/Microsoft.TestPlatform.Common/Utilities/RunSettingsUtilities.cs +++ b/src/Microsoft.TestPlatform.Common/Utilities/RunSettingsUtilities.cs @@ -37,7 +37,8 @@ public static string GetTestResultsDirectory(RunConfiguration runConfiguration) string resultsDirectory = null; if (runConfiguration != null) { - resultsDirectory = Environment.ExpandEnvironmentVariables(runConfiguration.ResultsDirectory); + // It will try to get path from runsettings, if not found then it will return default path. + resultsDirectory = Environment.ExpandEnvironmentVariables(runConfiguration.ResultsDirectory); } return resultsDirectory; diff --git a/test/Microsoft.TestPlatform.Common.UnitTests/Logging/TestLoggerManagerTests.cs b/test/Microsoft.TestPlatform.Common.UnitTests/Logging/TestLoggerManagerTests.cs index ec717c4229..51e8204f95 100644 --- a/test/Microsoft.TestPlatform.Common.UnitTests/Logging/TestLoggerManagerTests.cs +++ b/test/Microsoft.TestPlatform.Common.UnitTests/Logging/TestLoggerManagerTests.cs @@ -63,7 +63,7 @@ public void GetResultsDirectoryShouldReturnNullIfRunSettingsIsNull() } [TestMethod] - public void GetResultsDirectoryIsReadingFromRunsettings() + public void GetResultsDirectoryShouldReadResultsDirectoryFromSettingsIfSpecified() { string runSettingsXml = @"