From 02200d4c11907b094dc5441ac8461acf0e94e538 Mon Sep 17 00:00:00 2001 From: Ryan Nowak Date: Mon, 29 Jan 2018 11:41:42 -0800 Subject: [PATCH] Integrate new WebSDK One of these tests had to be updated and split into two because the expectations of the test weren't totally right. I also logged https://github.com/aspnet/Razor/issues/1986 during this, we didn't consider the impact of putting this logic in the WebSDK on class library. --- .../IntegrationTests/PublishIntegrationTest.cs | 18 ++++++++++++++++-- .../AppWithP2PReference.csproj | 3 --- test/testapps/ClassLibrary/ClassLibrary.csproj | 4 ++-- test/testapps/SimpleMvc/SimpleMvc.csproj | 3 --- test/testapps/SimplePages/SimplePages.csproj | 3 --- 5 files changed, 18 insertions(+), 13 deletions(-) diff --git a/test/Microsoft.AspNetCore.Razor.Design.Test/IntegrationTests/PublishIntegrationTest.cs b/test/Microsoft.AspNetCore.Razor.Design.Test/IntegrationTests/PublishIntegrationTest.cs index 6089d6f378..6b80b97be6 100644 --- a/test/Microsoft.AspNetCore.Razor.Design.Test/IntegrationTests/PublishIntegrationTest.cs +++ b/test/Microsoft.AspNetCore.Razor.Design.Test/IntegrationTests/PublishIntegrationTest.cs @@ -74,14 +74,28 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests Assert.FileCountEquals(result, 0, Path.Combine(PublishOutputPath, "Views"), "*.cshtml"); } - [Fact] + [Fact] // This will use the old precompilation tool, RazorSDK shouldn't get involved. [InitializeTestProject("SimpleMvc")] - public async Task Publish_WithMvcRazorCompileOnPublish_PublishesAssembly() + public async Task Publish_WithMvcRazorCompileOnPublish_Noops() { var result = await DotnetMSBuild("Publish", "/p:MvcRazorCompileOnPublish=true"); Assert.BuildPassed(result); + Assert.FileExists(result, PublishOutputPath, "SimpleMvc.dll"); + Assert.FileExists(result, PublishOutputPath, "SimpleMvc.pdb"); + Assert.FileDoesNotExist(result, PublishOutputPath, "SimpleMvc.PrecompiledViews.dll"); + Assert.FileDoesNotExist(result, PublishOutputPath, "SimpleMvc.PrecompiledViews.pdb"); + } + + [Fact] // This is an override to force the new toolset + [InitializeTestProject("SimpleMvc")] + public async Task Publish_WithMvcRazorCompileOnPublish_AndRazorSDK_PublishesAssembly() + { + var result = await DotnetMSBuild("Publish", "/p:MvcRazorCompileOnPublish=true /p:ResolvedRazorCompileToolset=RazorSDK"); + + Assert.BuildPassed(result); + Assert.FileDoesNotExist(result, OutputPath, "SimpleMvc.PrecompiledViews.dll"); Assert.FileDoesNotExist(result, OutputPath, "SimpleMvc.PrecompiledViews.pdb"); diff --git a/test/testapps/AppWithP2PReference/AppWithP2PReference.csproj b/test/testapps/AppWithP2PReference/AppWithP2PReference.csproj index 82ba010fe7..ee3aa0f554 100644 --- a/test/testapps/AppWithP2PReference/AppWithP2PReference.csproj +++ b/test/testapps/AppWithP2PReference/AppWithP2PReference.csproj @@ -1,9 +1,6 @@ netcoreapp2.0 - - - RazorSDK diff --git a/test/testapps/ClassLibrary/ClassLibrary.csproj b/test/testapps/ClassLibrary/ClassLibrary.csproj index 18338f29d2..13f82dd665 100644 --- a/test/testapps/ClassLibrary/ClassLibrary.csproj +++ b/test/testapps/ClassLibrary/ClassLibrary.csproj @@ -2,8 +2,8 @@ netcoreapp2.0 - - RazorSDK + + RazorSDK diff --git a/test/testapps/SimpleMvc/SimpleMvc.csproj b/test/testapps/SimpleMvc/SimpleMvc.csproj index 11dac1b1da..91bf7e583a 100644 --- a/test/testapps/SimpleMvc/SimpleMvc.csproj +++ b/test/testapps/SimpleMvc/SimpleMvc.csproj @@ -1,9 +1,6 @@ netcoreapp2.0 - - - RazorSDK diff --git a/test/testapps/SimplePages/SimplePages.csproj b/test/testapps/SimplePages/SimplePages.csproj index 11dac1b1da..91bf7e583a 100644 --- a/test/testapps/SimplePages/SimplePages.csproj +++ b/test/testapps/SimplePages/SimplePages.csproj @@ -1,9 +1,6 @@ netcoreapp2.0 - - - RazorSDK