diff --git a/build/dependencies.props b/build/dependencies.props index 16981805e6..c52fc19bdf 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -3,37 +3,37 @@ $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - 2.1.0-preview2-30077 - 2.1.0-preview2-30077 - 2.1.0-preview2-30077 - 2.1.0-preview2-30077 - 2.1.0-preview2-30077 - 2.1.0-preview2-30077 - 2.1.0-preview2-30077 - 2.1.0-preview2-30077 - 2.1.0-preview2-30077 - 2.1.0-preview2-30077 - 2.1.0-preview2-30077 - 2.1.0-preview2-30077 - 2.1.0-preview2-30077 - 2.1.0-preview2-30077 - 2.1.0-preview2-30077 - 2.1.0-preview2-30077 - 0.5.0-preview2-30077 - 2.1.0-preview2-30077 - 2.1.0-preview2-30077 - 2.1.0-preview2-30077 - 2.1.0-preview2-30077 - 2.1.0-preview2-30077 - 2.1.0-preview2-30077 - 2.1.0-preview2-30077 - 2.1.0-preview2-30077 - 2.1.0-preview2-30077 - 2.1.0-preview2-30077 - 2.1.0-preview2-30077 - 2.1.0-preview2-30077 - 2.1.0-preview2-30077 - 2.1.0-preview2-30077 + 2.1.0-preview2-30106 + 2.1.0-preview2-30106 + 2.1.0-preview2-30106 + 2.1.0-preview2-30106 + 2.1.0-preview2-30106 + 2.1.0-preview2-30106 + 2.1.0-preview2-30106 + 2.1.0-preview2-30106 + 2.1.0-preview2-30106 + 2.1.0-preview2-30106 + 2.1.0-preview2-30106 + 2.1.0-preview2-30106 + 2.1.0-preview2-30106 + 2.1.0-preview2-30106 + 2.1.0-preview2-30106 + 2.1.0-preview2-30106 + 0.5.0-preview2-30106 + 2.1.0-preview2-30106 + 2.1.0-preview2-30106 + 2.1.0-preview2-30106 + 2.1.0-preview2-30106 + 2.1.0-preview2-30106 + 2.1.0-preview2-30106 + 2.1.0-preview2-30106 + 2.1.0-preview2-30106 + 2.1.0-preview2-30106 + 2.1.0-preview2-30106 + 2.1.0-preview2-30106 + 2.1.0-preview2-30106 + 2.1.0-preview2-30106 + 2.1.0-preview2-30106 2.0.0 2.1.0-preview2-26130-04 15.3.0 diff --git a/korebuild-lock.txt b/korebuild-lock.txt index 3e2b56b91b..02dc92cb26 100644 --- a/korebuild-lock.txt +++ b/korebuild-lock.txt @@ -1,2 +1,2 @@ -version:2.1.0-preview2-15698 -commithash:7216e5068cb1957e09d45fcbe58a744dd5c2de73 +version:2.1.0-preview2-15704 +commithash:21fdd9f5254226f407a2b4b3ef963693c2fd7998 diff --git a/samples/MusicStore/MusicStore.csproj b/samples/MusicStore/MusicStore.csproj index 57d0e5ee85..07dc732828 100644 --- a/samples/MusicStore/MusicStore.csproj +++ b/samples/MusicStore/MusicStore.csproj @@ -4,10 +4,11 @@ Music store application on ASP.NET Core netcoreapp2.1;netcoreapp2.0;net461 $(DefineConstants);DEMO - true + true true win7-x86;win7-x64;linux-x64;osx-x64 Debug;Release;RuntimeStore + full @@ -41,4 +42,14 @@ + + + + + + $(PublishDir)$(RazorTargetName).dll + + + + diff --git a/samples/MusicStore/Pages/PageThatThrows.cshtml b/samples/MusicStore/Pages/PageThatThrows.cshtml new file mode 100644 index 0000000000..b119553071 --- /dev/null +++ b/samples/MusicStore/Pages/PageThatThrows.cshtml @@ -0,0 +1,2 @@ +@page +@{ throw new InvalidOperationException(); } diff --git a/test/MusicStore.E2ETests/Implementation/Validator.cs b/test/MusicStore.E2ETests/Implementation/Validator.cs index e254c2d026..92b2a1fe2d 100644 --- a/test/MusicStore.E2ETests/Implementation/Validator.cs +++ b/test/MusicStore.E2ETests/Implementation/Validator.cs @@ -127,6 +127,13 @@ namespace E2ETests StringComparison.OrdinalIgnoreCase); } + public async Task VerifyDeveloperExceptionPage(HttpResponseMessage response) + { + var responseContent = await response.Content.ReadAsStringAsync(); + Assert.Contains(responseContent, "PageThatThrows.cshtml"); + Assert.Contains(responseContent, "@{ throw new InvalidOperationException(); }"); + } + public void ValidateLayoutPage(string responseContent) { Assert.Contains("ASP.NET MVC Music Store", responseContent, StringComparison.OrdinalIgnoreCase); @@ -539,4 +546,4 @@ namespace E2ETests .Select(c => c.Name); } } -} \ No newline at end of file +} diff --git a/test/MusicStore.E2ETests/PublishAndRunTestRunner.cs b/test/MusicStore.E2ETests/PublishAndRunTestRunner.cs index 33abd4bb5c..c1fbd55b2f 100644 --- a/test/MusicStore.E2ETests/PublishAndRunTestRunner.cs +++ b/test/MusicStore.E2ETests/PublishAndRunTestRunner.cs @@ -85,5 +85,58 @@ namespace E2ETests } } } + + public async Task RunDeveloperTests( + ServerType serverType, + RuntimeFlavor runtimeFlavor, + ApplicationType applicationType, + RuntimeArchitecture runtimeArchitecture) + { + var testName = $"PublishAndRunTests_{serverType}_{runtimeFlavor}_{applicationType}"; + using (StartLog(out var loggerFactory, testName)) + { + var logger = loggerFactory.CreateLogger("Publish_And_Run_Development"); + var musicStoreDbName = DbUtils.GetUniqueName(); + + var deploymentParameters = new DeploymentParameters( + Helpers.GetApplicationPath(applicationType), serverType, runtimeFlavor, runtimeArchitecture) + { + PublishApplicationBeforeDeployment = true, + PreservePublishedApplicationForDebugging = Helpers.PreservePublishedApplicationForDebugging, + TargetFramework = Helpers.GetTargetFramework(runtimeFlavor), + Configuration = Helpers.GetCurrentBuildConfiguration(), + EnvironmentName = "Development", + ApplicationType = applicationType, + UserAdditionalCleanup = parameters => + { + DbUtils.DropDatabase(musicStoreDbName, logger); + } + }; + + // Override the connection strings using environment based configuration + deploymentParameters.EnvironmentVariables + .Add(new KeyValuePair( + MusicStoreConfig.ConnectionStringKey, + DbUtils.CreateConnectionString(musicStoreDbName))); + + using (var deployer = ApplicationDeployerFactory.Create(deploymentParameters, loggerFactory)) + { + var deploymentResult = await deployer.DeployAsync(); + var httpClientHandler = new HttpClientHandler { UseDefaultCredentials = true }; + var httpClient = deploymentResult.CreateHttpClient(httpClientHandler); + + // Request to base address and check if various parts of the body are rendered & + // measure the cold startup time. + // Add retry logic since tests are flaky on mono due to connection issues + var validator = new Validator(httpClient, httpClientHandler, logger, deploymentResult); + var response = await RetryHelper.RetryRequest(() => httpClient.GetAsync("PageThatThrows"), logger, cancellationToken: deploymentResult.HostShutdownToken); + + logger.LogInformation("Verifying developer exception page"); + await validator.VerifyDeveloperExceptionPage(response); + + logger.LogInformation("Variation completed successfully."); + } + } + } } } diff --git a/test/MusicStore.E2ETests/PublishAndRunTests_X64.cs b/test/MusicStore.E2ETests/PublishAndRunTests_X64.cs index 3ecfd6602a..a6e2776956 100644 --- a/test/MusicStore.E2ETests/PublishAndRunTests_X64.cs +++ b/test/MusicStore.E2ETests/PublishAndRunTests_X64.cs @@ -17,24 +17,21 @@ namespace E2ETests } [ConditionalFact] - [OSSkipCondition(OperatingSystems.Linux)] - [OSSkipCondition(OperatingSystems.MacOSX)] + [OSSkipCondition(OperatingSystems.Linux | OperatingSystems.MacOSX)] public Task PublishAndRunTests_X64_WebListener_CoreCLR_Portable() { return RunTests(ServerType.WebListener, RuntimeFlavor.CoreClr, ApplicationType.Portable); } [ConditionalFact] - [OSSkipCondition(OperatingSystems.Linux)] - [OSSkipCondition(OperatingSystems.MacOSX)] + [OSSkipCondition(OperatingSystems.Linux | OperatingSystems.MacOSX)] public Task PublishAndRunTests_X64_WebListener_CoreCLR_Standalone() { return RunTests(ServerType.WebListener, RuntimeFlavor.CoreClr, ApplicationType.Standalone); } [ConditionalFact] - [OSSkipCondition(OperatingSystems.Linux)] - [OSSkipCondition(OperatingSystems.MacOSX)] + [OSSkipCondition(OperatingSystems.Linux | OperatingSystems.MacOSX)] public Task PublishAndRunTests_X64_WebListener_Clr() { // CLR must be published as standalone to perform rid specific deployment @@ -47,6 +44,19 @@ namespace E2ETests return RunTests(ServerType.Kestrel, RuntimeFlavor.CoreClr, ApplicationType.Portable); } + [Fact] + public Task PublishAndRunDevelopmentTests_X64_Kestrel_CoreClr_Portable() + { + return _testRunner.RunTests(ServerType.Kestrel, RuntimeFlavor.CoreClr, ApplicationType.Portable, RuntimeArchitecture.x64); + } + + [ConditionalFact] + [OSSkipCondition(OperatingSystems.Linux | OperatingSystems.MacOSX)] + public Task PublishAndRunDevelopmentTests_X64_Kestrel_Clr_Portable() + { + return _testRunner.RunTests(ServerType.Kestrel, RuntimeFlavor.Clr, ApplicationType.Portable, RuntimeArchitecture.x64); + } + [Fact] public Task PublishAndRunTests_X64_Kestrel_CoreClr_Standalone() { @@ -54,8 +64,7 @@ namespace E2ETests } [ConditionalFact] - [OSSkipCondition(OperatingSystems.Linux)] - [OSSkipCondition(OperatingSystems.MacOSX)] + [OSSkipCondition(OperatingSystems.Linux | OperatingSystems.MacOSX)] public Task PublishAndRunTests_X64_Kestrel_Clr() { // CLR must be published as standalone to perform rid specific deployment