Added support for kre architecture
This commit is contained in:
parent
c28cae9e94
commit
759eee9734
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -29,10 +29,11 @@
|
|||
<Compile Include="DeploymentUtility.cs" />
|
||||
<Compile Include="DbUtils.cs" />
|
||||
<Compile Include="Extensions.cs" />
|
||||
<Compile Include="KreArchitecture.cs" />
|
||||
<Compile Include="ServerType.cs" />
|
||||
<Compile Include="HtmlDOMHelper.cs" />
|
||||
<Compile Include="KreFlavor.cs" />
|
||||
<Compile Include="SmokeTests.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VSToolsPath)\AspNet\Microsoft.Web.AspNet.targets" Condition="'$(VSToolsPath)' != ''" />
|
||||
</Project>
|
||||
</Project>
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
namespace E2ETests
|
||||
{
|
||||
public enum KreArchitecture
|
||||
{
|
||||
x64,
|
||||
x86
|
||||
}
|
||||
}
|
||||
|
|
@ -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) };
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue