From 59fad3bbb39aae12bf4c2112fbaef26116d10ee1 Mon Sep 17 00:00:00 2001 From: Praburaj Date: Fri, 6 Jun 2014 17:34:12 -0700 Subject: [PATCH] Adding CoreCLR variation of test on selfhost --- test/E2ETests/DeploymentUtility.cs | 19 ++++++++++++++++++- test/E2ETests/SmokeTests.cs | 2 ++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/test/E2ETests/DeploymentUtility.cs b/test/E2ETests/DeploymentUtility.cs index 0d829e0332..ec534a8c12 100644 --- a/test/E2ETests/DeploymentUtility.cs +++ b/test/E2ETests/DeploymentUtility.cs @@ -46,6 +46,8 @@ namespace E2ETests public static Process StartApplication(HostType hostType, KreFlavor kreFlavor, string identityDbName) { string applicationPath = Path.GetFullPath(Path.Combine(Environment.CurrentDirectory, APP_RELATIVE_PATH)); + //Tweak the %PATH% to the point to the right KREFLAVOR + Environment.SetEnvironmentVariable("PATH", SwitchPathToKreFlavor(kreFlavor)); if (hostType == HostType.Helios) { @@ -86,12 +88,27 @@ namespace E2ETests }; var hostProcess = Process.Start(startInfo); - Console.WriteLine("Started klr.exe. Process Id : {0}", hostProcess.Id); + Console.WriteLine("Started {0}. Process Id : {1}", hostProcess.MainModule.FileName, hostProcess.Id); WaitTillDbCreated(identityDbName); return hostProcess; } + private static string SwitchPathToKreFlavor(KreFlavor kreFlavor) + { + var pathValue = Environment.GetEnvironmentVariable("PATH"); + Console.WriteLine(); + Console.WriteLine("Current %PATH% value : {0}", pathValue); + + pathValue = (kreFlavor == KreFlavor.CoreClr) ? + pathValue.Replace("KRE-svr50-", "KRE-svrc50-") : + pathValue.Replace("KRE-svrc50-", "KRE-svr50-"); + + Console.WriteLine(); + Console.WriteLine("Setting %PATH% value to : {0}", pathValue); + return pathValue; + } + //In case of self-host application activation happens immediately unlike iis where activation happens on first request. //So in self-host case, we need a way to block the first request until the application is initialized. In MusicStore application's case, //identity DB creation is pretty much the last step of application setup. So waiting on this event will help us wait efficiently. diff --git a/test/E2ETests/SmokeTests.cs b/test/E2ETests/SmokeTests.cs index 94059c59b3..77b146f68e 100644 --- a/test/E2ETests/SmokeTests.cs +++ b/test/E2ETests/SmokeTests.cs @@ -17,6 +17,8 @@ namespace E2ETests [Theory] [InlineData(HostType.Helios, KreFlavor.DesktopClr, "http://localhost:5001/")] [InlineData(HostType.SelfHost, KreFlavor.DesktopClr, "http://localhost:5002/")] + //[InlineData(HostType.Helios, KreFlavor.CoreClr, "http://localhost:5001/")] + [InlineData(HostType.SelfHost, KreFlavor.CoreClr, "http://localhost:5002/")] public void SmokeTestSuite(HostType hostType, KreFlavor kreFlavor, string applicationBaseUrl) { var testStartTime = DateTime.Now;