From b240b855c128c39843a0a244412b0e7de4429747 Mon Sep 17 00:00:00 2001 From: Faizan Ahmad Date: Tue, 4 Oct 2016 00:17:35 +0530 Subject: [PATCH] Update the new version of Microsoft.TestPlatform.cli which has fix related to testAdapterPath. Updated the test project to reflect the same. --- Microsoft.DotNet.Cli.sln | 24 ++++++------- .../VSTestDotNetCoreProject/Tests.cs | 14 ++++++-- .../VSTestDotNetCoreProject.csproj | 36 ++++++++++++------- .../VSTestDotNetCoreProject/project.json | 21 ----------- src/redist/project.json | 3 +- test/dotnet-vstest.Tests/VSTestTests.cs | 15 +++++--- 6 files changed, 60 insertions(+), 53 deletions(-) delete mode 100644 TestAssets/TestProjects/VSTestDotNetCoreProject/project.json diff --git a/Microsoft.DotNet.Cli.sln b/Microsoft.DotNet.Cli.sln index 7840b9296..6df6f635d 100644 --- a/Microsoft.DotNet.Cli.sln +++ b/Microsoft.DotNet.Cli.sln @@ -906,20 +906,20 @@ Global {0E083818-2320-4388-8007-4F720FD5C634}.RelWithDebInfo|x64.Build.0 = Release|Any CPU {1F2EF070-AC5F-4078-AFB0-65745AC691B9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {1F2EF070-AC5F-4078-AFB0-65745AC691B9}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1F2EF070-AC5F-4078-AFB0-65745AC691B9}.Debug|x64.ActiveCfg = Debug|x64 - {1F2EF070-AC5F-4078-AFB0-65745AC691B9}.Debug|x64.Build.0 = Debug|x64 - {1F2EF070-AC5F-4078-AFB0-65745AC691B9}.MinSizeRel|Any CPU.ActiveCfg = MinSizeRel|Any CPU - {1F2EF070-AC5F-4078-AFB0-65745AC691B9}.MinSizeRel|Any CPU.Build.0 = MinSizeRel|Any CPU - {1F2EF070-AC5F-4078-AFB0-65745AC691B9}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64 - {1F2EF070-AC5F-4078-AFB0-65745AC691B9}.MinSizeRel|x64.Build.0 = MinSizeRel|x64 + {1F2EF070-AC5F-4078-AFB0-65745AC691B9}.Debug|x64.ActiveCfg = Debug|Any CPU + {1F2EF070-AC5F-4078-AFB0-65745AC691B9}.Debug|x64.Build.0 = Debug|Any CPU + {1F2EF070-AC5F-4078-AFB0-65745AC691B9}.MinSizeRel|Any CPU.ActiveCfg = Release|Any CPU + {1F2EF070-AC5F-4078-AFB0-65745AC691B9}.MinSizeRel|Any CPU.Build.0 = Release|Any CPU + {1F2EF070-AC5F-4078-AFB0-65745AC691B9}.MinSizeRel|x64.ActiveCfg = Release|Any CPU + {1F2EF070-AC5F-4078-AFB0-65745AC691B9}.MinSizeRel|x64.Build.0 = Release|Any CPU {1F2EF070-AC5F-4078-AFB0-65745AC691B9}.Release|Any CPU.ActiveCfg = Release|Any CPU {1F2EF070-AC5F-4078-AFB0-65745AC691B9}.Release|Any CPU.Build.0 = Release|Any CPU - {1F2EF070-AC5F-4078-AFB0-65745AC691B9}.Release|x64.ActiveCfg = Release|x64 - {1F2EF070-AC5F-4078-AFB0-65745AC691B9}.Release|x64.Build.0 = Release|x64 - {1F2EF070-AC5F-4078-AFB0-65745AC691B9}.RelWithDebInfo|Any CPU.ActiveCfg = RelWithDebInfo|Any CPU - {1F2EF070-AC5F-4078-AFB0-65745AC691B9}.RelWithDebInfo|Any CPU.Build.0 = RelWithDebInfo|Any CPU - {1F2EF070-AC5F-4078-AFB0-65745AC691B9}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64 - {1F2EF070-AC5F-4078-AFB0-65745AC691B9}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64 + {1F2EF070-AC5F-4078-AFB0-65745AC691B9}.Release|x64.ActiveCfg = Release|Any CPU + {1F2EF070-AC5F-4078-AFB0-65745AC691B9}.Release|x64.Build.0 = Release|Any CPU + {1F2EF070-AC5F-4078-AFB0-65745AC691B9}.RelWithDebInfo|Any CPU.ActiveCfg = Release|Any CPU + {1F2EF070-AC5F-4078-AFB0-65745AC691B9}.RelWithDebInfo|Any CPU.Build.0 = Release|Any CPU + {1F2EF070-AC5F-4078-AFB0-65745AC691B9}.RelWithDebInfo|x64.ActiveCfg = Release|Any CPU + {1F2EF070-AC5F-4078-AFB0-65745AC691B9}.RelWithDebInfo|x64.Build.0 = Release|Any CPU {A62EDFBD-9E6D-458F-983E-1A86DA52AE1E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {A62EDFBD-9E6D-458F-983E-1A86DA52AE1E}.Debug|Any CPU.Build.0 = Debug|Any CPU {A62EDFBD-9E6D-458F-983E-1A86DA52AE1E}.Debug|x64.ActiveCfg = Debug|Any CPU diff --git a/TestAssets/TestProjects/VSTestDotNetCoreProject/Tests.cs b/TestAssets/TestProjects/VSTestDotNetCoreProject/Tests.cs index 06cf2371b..afb3b28a2 100644 --- a/TestAssets/TestProjects/VSTestDotNetCoreProject/Tests.cs +++ b/TestAssets/TestProjects/VSTestDotNetCoreProject/Tests.cs @@ -2,6 +2,14 @@ namespace TestNamespace { + public class Program + { + public static void Main(string[] args) + { + + } + } + [TestClass] public class VSTestTests { @@ -9,11 +17,11 @@ namespace TestNamespace public void VSTestPassTest() { } - - [TestMethod] + + [TestMethod] public void VSTestFailTest() { - Assert.Fail(); + Assert.Fail(); } } } \ No newline at end of file diff --git a/TestAssets/TestProjects/VSTestDotNetCoreProject/VSTestDotNetCoreProject.csproj b/TestAssets/TestProjects/VSTestDotNetCoreProject/VSTestDotNetCoreProject.csproj index f4fa033eb..6bc4de367 100644 --- a/TestAssets/TestProjects/VSTestDotNetCoreProject/VSTestDotNetCoreProject.csproj +++ b/TestAssets/TestProjects/VSTestDotNetCoreProject/VSTestDotNetCoreProject.csproj @@ -3,23 +3,35 @@ - Library - .NETCoreApp - v1.0 - bin\$(Configuration)\netcoreapp1.0 + Exe + netcoreapp1.0 + bin\$(Configuration) - + + + + + 1.0.1 + + + 1.0.0-alpha-20160930-1 + + + 1.0.4-preview + + + 1.1.3-preview + + + 15.0.0-preview-20160928-07 + + + 15.0.0-preview-20160928-07 + - - - - - - - \ No newline at end of file diff --git a/TestAssets/TestProjects/VSTestDotNetCoreProject/project.json b/TestAssets/TestProjects/VSTestDotNetCoreProject/project.json deleted file mode 100644 index a576bf82a..000000000 --- a/TestAssets/TestProjects/VSTestDotNetCoreProject/project.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "dependencies": { - "MSTest.TestAdapter": "1.0.3-preview", - "MSTest.TestFramework": "1.0.1-preview" - }, - "frameworks": { - "netcoreapp1.0": { - "dependencies": { - "Microsoft.NETCore.Sdk": "1.0.0-alpha-20160914-1", - "Microsoft.NETCore.App": { - "version": "1.0.1", - "type": "platform" - } - }, - "imports": [ - "dnxcore50", - "portable-net45+win8" - ] - } - } -} diff --git a/src/redist/project.json b/src/redist/project.json index 0f0e6b4bb..3a6df7242 100644 --- a/src/redist/project.json +++ b/src/redist/project.json @@ -28,7 +28,8 @@ "Microsoft.CodeAnalysis.Build.Tasks": "2.0.0-beta6-60922-08", "System.Runtime.Serialization.Xml": "4.1.1", "NuGet.Build.Tasks": "3.6.0-beta.1.msbuild.17", - "Microsoft.TestPlatform.CLI": "15.0.0-preview-20160915-01" + "Microsoft.TestPlatform.CLI": "15.0.0-preview-20161003-01", + "Microsoft.TestPlatform.Build": "15.0.0-preview-20160928-07" }, "frameworks": { "netcoreapp1.0": { diff --git a/test/dotnet-vstest.Tests/VSTestTests.cs b/test/dotnet-vstest.Tests/VSTestTests.cs index 4a3a9b61a..029ec3a36 100644 --- a/test/dotnet-vstest.Tests/VSTestTests.cs +++ b/test/dotnet-vstest.Tests/VSTestTests.cs @@ -11,18 +11,25 @@ using Microsoft.DotNet.Cli.Utils; namespace Microsoft.DotNet.Cli.VSTest.Tests { - public class VSTestTests: TestBase + public class VSTestTests : TestBase { [Fact] public void TestsFromAGivenContainerShouldRunWithExpectedOutput() { // Copy DotNetCoreTestProject project in output directory of project dotnet-vstest.Tests string testAppName = "VSTestDotNetCoreProject"; - TestInstance testInstance = TestAssetsManager.CreateTestInstance(testAppName).WithLockFiles(); + TestInstance testInstance = TestAssetsManager.CreateTestInstance(testAppName); string testProjectDirectory = testInstance.TestRoot; - // Build project DotNetCoreTestProject + // Restore project VSTestDotNetCoreProject + new Restore3Command() + .WithWorkingDirectory(testProjectDirectory) + .Execute() + .Should() + .Pass(); + + // Build project VSTestDotNetCoreProject new Build3Command() .WithWorkingDirectory(testProjectDirectory) .Execute() @@ -33,7 +40,7 @@ namespace Microsoft.DotNet.Cli.VSTest.Tests string configuration = Environment.GetEnvironmentVariable("CONFIGURATION") ?? "Debug"; string testAdapterPath = Path.Combine(testProjectDirectory, "bin", configuration, "netcoreapp1.0"); string outputDll = Path.Combine(testAdapterPath, $"{testAppName}.dll"); - string argsForVstest = string.Concat("\"", outputDll, "\"", " --TestAdapterPath:", "\"", testAdapterPath, "\""); + string argsForVstest = string.Concat("\"", outputDll, "\""); // Call vstest CommandResult result = new VSTestCommand().ExecuteWithCapturedOutput(argsForVstest);