Handled starting IISExpress based on architecture

This commit is contained in:
Suhas Joshi 2014-07-24 14:38:34 -07:00
parent 6fb56ccdad
commit c74bb9258a
4 changed files with 36 additions and 18 deletions

View File

@ -22,6 +22,10 @@ IF EXIST packages\KoreBuild goto run
IF "%SKIP_KRE_INSTALL%"=="1" goto run
CALL packages\KoreBuild\build\kvm upgrade -svr50 -x86
CALL packages\KoreBuild\build\kvm install default -svrc50 -x86
IF EXIST "%Processor_Architecture%" == "AMD64"(
CALL packages\KoreBuild\build\kvm install default -svr50 -x64
CALL packages\KoreBuild\build\kvm install default -svrc50 -x64
)
:run
CALL packages\KoreBuild\build\kvm use default -svr50 -x86

View File

@ -24,6 +24,11 @@ namespace MusicStore
configuration.AddJsonFile("LocalConfig.json");
configuration.AddEnvironmentVariables(); //All environment variables in the process's context flow in as configuration values.
/* Error page middleware displays a nice formatted HTML page for any unhandled exceptions in the request pipeline.
* Note: ErrorPageOptions.ShowAll to be used only at development time. Not recommended for production.
*/
app.UseErrorPage(ErrorPageOptions.ShowAll);
app.UseServices(services =>
{
//If this type is present - we're on mono
@ -66,11 +71,6 @@ namespace MusicStore
services.AddMvc();
});
/* Error page middleware displays a nice formatted HTML page for any unhandled exceptions in the request pipeline.
* Note: ErrorPageOptions.ShowAll to be used only at development time. Not recommended for production.
*/
app.UseErrorPage(ErrorPageOptions.ShowAll);
// Add static files to the request pipeline
app.UseStaticFiles();

View File

@ -11,19 +11,23 @@ namespace E2ETests
{
internal class DeploymentUtility
{
private static string GetIISExpressPath()
private static string GetIISExpressPath(KreArchitecture architecture)
{
// Get path to program files
var iisExpressPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86), "IIS Express", "iisexpress.exe");
//If X86 version does not exist
if (!File.Exists(iisExpressPath))
// Get path to 64 bit of IIS Express
if(architecture == KreArchitecture.x64)
{
iisExpressPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles), "IIS Express", "iisexpress.exe");
if (!File.Exists(iisExpressPath))
{
throw new Exception("Unable to find IISExpress on the machine");
}
// If process is 32 bit, the path points to x86. Replace path to point to x64
iisExpressPath = Environment.Is64BitProcess ? iisExpressPath : iisExpressPath.Replace(" (x86)", "");
}
if (!File.Exists(iisExpressPath))
{
throw new Exception("Unable to find IISExpress on the machine");
}
return iisExpressPath;
@ -61,7 +65,7 @@ namespace E2ETests
if (hostType == ServerType.Helios)
{
hostProcess = StartHeliosHost(applicationPath);
hostProcess = StartHeliosHost(applicationPath, kreArchitecture);
}
else
{
@ -73,13 +77,13 @@ namespace E2ETests
return hostProcess;
}
private static Process StartHeliosHost(string applicationPath)
private static Process StartHeliosHost(string applicationPath, KreArchitecture kreArchitecture)
{
CopyAspNetLoader(applicationPath);
var startInfo = new ProcessStartInfo
{
FileName = GetIISExpressPath(),
FileName = GetIISExpressPath(kreArchitecture),
Arguments = string.Format("/port:5001 /path:{0}", applicationPath),
UseShellExecute = true,
CreateNoWindow = true

View File

@ -16,16 +16,26 @@ namespace E2ETests
private HttpClientHandler httpClientHandler;
[Theory]
[InlineData(ServerType.Helios, KreFlavor.DesktopClr,KreArchitecture.x86, "http://localhost:5001/")]
[InlineData(ServerType.Helios, KreFlavor.CoreClr, KreArchitecture.x64, "http://localhost:5001/")]
[InlineData(ServerType.Helios, KreFlavor.DesktopClr, KreArchitecture.x86, "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/")]
[InlineData(ServerType.Helios, KreFlavor.CoreClr, KreArchitecture.x64, "http://localhost:5001/")]
[InlineData(ServerType.WebListener, KreFlavor.DesktopClr, KreArchitecture.x64, "http://localhost:5002/")]
[InlineData(ServerType.Kestrel, KreFlavor.CoreClr, KreArchitecture.x64, "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);
Console.WriteLine("Variation Details : HostType = {0}, KreFlavor = {1}, Architecture = {2}, applicationBaseUrl = {3}", hostType, kreFlavor, architecture, applicationBaseUrl);
// Check if processor architecture is x64, else ship test
if (architecture == KreArchitecture.x64 && !Environment.Is64BitOperatingSystem)
{
Console.WriteLine("Skipping x64 test since machine is of type x86");
Assert.True(true);
return;
}
var testStartTime = DateTime.Now;
var musicStoreDbName = Guid.NewGuid().ToString().Replace("-", string.Empty);