diff --git a/test/E2ETests/DeploymentUtility.cs b/test/E2ETests/DeploymentUtility.cs index c954f38305..cd871ee2a4 100644 --- a/test/E2ETests/DeploymentUtility.cs +++ b/test/E2ETests/DeploymentUtility.cs @@ -1,8 +1,9 @@ using System; using System.Diagnostics; using System.IO; -using System.Linq; using System.Threading; +using System.Text; +using System.Text.RegularExpressions; using Microsoft.Framework.Runtime; using Microsoft.Framework.Runtime.Infrastructure; @@ -48,11 +49,11 @@ namespace E2ETests private const string APP_RELATIVE_PATH = @"..\..\src\MusicStore\"; - public static Process StartApplication(ServerType hostType, KreFlavor kreFlavor, string identityDbName) + public static Process StartApplication(ServerType hostType, KreFlavor kreFlavor, KreArchitecture kreArchitecture, 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)); + Environment.SetEnvironmentVariable("PATH", SwitchPathToKreFlavor(kreFlavor,kreArchitecture)); var backupKreDefaultLibPath = Environment.GetEnvironmentVariable("KRE_DEFAULT_LIB"); //To avoid the KRE_DEFAULT_LIB of the test process flowing into Helios, set it to empty Environment.SetEnvironmentVariable("KRE_DEFAULT_LIB", string.Empty); @@ -111,15 +112,18 @@ namespace E2ETests return hostProcess; } - private static string SwitchPathToKreFlavor(KreFlavor kreFlavor) + private static string SwitchPathToKreFlavor(KreFlavor kreFlavor,KreArchitecture kreArchitecture) { 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-"); + StringBuilder replaceStr = new StringBuilder(); + replaceStr.Append("KRE"); + replaceStr.Append((kreFlavor == KreFlavor.CoreClr) ? "-svrc50" : "-svr50"); + replaceStr.Append((kreArchitecture == KreArchitecture.x86) ? "-x86" : "-x64"); + + pathValue = Regex.Replace(pathValue, "KRE-(svr|svrc)50-(x86|x64)", replaceStr.ToString(), RegexOptions.IgnoreCase); Console.WriteLine(); Console.WriteLine("Setting %PATH% value to : {0}", pathValue); diff --git a/test/E2ETests/E2ETests.kproj b/test/E2ETests/E2ETests.kproj index 0ca3bfdf03..ad0e1100e6 100644 --- a/test/E2ETests/E2ETests.kproj +++ b/test/E2ETests/E2ETests.kproj @@ -29,10 +29,11 @@ + - + \ No newline at end of file diff --git a/test/E2ETests/KreArchitecture.cs b/test/E2ETests/KreArchitecture.cs new file mode 100644 index 0000000000..e12d87eb1c --- /dev/null +++ b/test/E2ETests/KreArchitecture.cs @@ -0,0 +1,8 @@ +namespace E2ETests +{ + public enum KreArchitecture + { + x64, + x86 + } +} \ No newline at end of file diff --git a/test/E2ETests/SmokeTests.cs b/test/E2ETests/SmokeTests.cs index 07390d531c..c42156ba3b 100644 --- a/test/E2ETests/SmokeTests.cs +++ b/test/E2ETests/SmokeTests.cs @@ -16,13 +16,14 @@ namespace E2ETests private HttpClientHandler httpClientHandler; [Theory] - [InlineData(ServerType.Helios, KreFlavor.DesktopClr, "http://localhost:5001/")] - [InlineData(ServerType.WebListener, KreFlavor.DesktopClr, "http://localhost:5002/")] - [InlineData(ServerType.Kestrel, KreFlavor.DesktopClr, "http://localhost:5004/")] - [InlineData(ServerType.Helios, KreFlavor.CoreClr, "http://localhost:5001/")] - [InlineData(ServerType.WebListener, KreFlavor.CoreClr, "http://localhost:5002/")] - [InlineData(ServerType.Kestrel, KreFlavor.CoreClr, "http://localhost:5004/")] - public void SmokeTestSuite(ServerType hostType, KreFlavor kreFlavor, string applicationBaseUrl) + [InlineData(ServerType.Helios, KreFlavor.DesktopClr,KreArchitecture.x86, "http://localhost:5001/")] + [InlineData(ServerType.Helios, KreFlavor.CoreClr, KreArchitecture.x64, "http://localhost:5001/")] + [InlineData(ServerType.WebListener, KreFlavor.DesktopClr, KreArchitecture.x86, "http://localhost:5002/")] + [InlineData(ServerType.Kestrel, KreFlavor.DesktopClr, KreArchitecture.x86, "http://localhost:5004/")] + [InlineData(ServerType.Helios, KreFlavor.CoreClr, KreArchitecture.x86, "http://localhost:5001/")] + [InlineData(ServerType.WebListener, KreFlavor.CoreClr, KreArchitecture.x86, "http://localhost:5002/")] + [InlineData(ServerType.Kestrel, KreFlavor.CoreClr, KreArchitecture.x86, "http://localhost:5004/")] + public void SmokeTestSuite(ServerType hostType, KreFlavor kreFlavor, KreArchitecture architecture, string applicationBaseUrl) { Console.WriteLine("Variation Details : HostType = {0}, KreFlavor = {1}, applicationBaseUrl = {2}", hostType, kreFlavor, applicationBaseUrl); @@ -40,7 +41,7 @@ namespace E2ETests try { - hostProcess = DeploymentUtility.StartApplication(hostType, kreFlavor, musicStoreDbName); + hostProcess = DeploymentUtility.StartApplication(hostType, kreFlavor, architecture, musicStoreDbName); httpClientHandler = new HttpClientHandler(); httpClient = new HttpClient(httpClientHandler) { BaseAddress = new Uri(applicationBaseUrl) };