Adding kestrel variation of the MusicStore tests
Variation added for both Desktop & CoreCLR. Added some more diagnostics to help better trouble shoot with more variations.
This commit is contained in:
parent
ecbf6e27fa
commit
974bfcab7a
|
|
@ -5,6 +5,7 @@
|
|||
"description": "Music store application on K",
|
||||
"version": "1.0.0-*",
|
||||
"dependencies": {
|
||||
"Kestrel": "1.0.0-*",
|
||||
"Microsoft.AspNet.Server.IIS": "1.0.0-*",
|
||||
"Microsoft.AspNet.Mvc": "6.0.0-*",
|
||||
"Microsoft.AspNet.Server.WebListener": "1.0.0-*",
|
||||
|
|
@ -18,13 +19,12 @@
|
|||
"Microsoft.Framework.OptionsModel": "1.0.0-*"
|
||||
},
|
||||
"commands": {
|
||||
"web": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.WebListener --server.urls http://localhost:5002",
|
||||
"WebListener": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.WebListener --server.urls http://localhost:5002",
|
||||
"Kestrel": "Microsoft.AspNet.Hosting --server Kestrel --server.urls http://localhost:5004",
|
||||
"run": "run server.urls=http://localhost:5003"
|
||||
},
|
||||
"configurations": {
|
||||
"net451": {
|
||||
},
|
||||
"k10": {
|
||||
}
|
||||
"net451": { },
|
||||
"k10": { }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ namespace E2ETests
|
|||
|
||||
private const string APP_RELATIVE_PATH = @"..\..\src\MusicStore\";
|
||||
|
||||
public static Process StartApplication(HostType hostType, KreFlavor kreFlavor, string identityDbName)
|
||||
public static Process StartApplication(ServerType 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
|
||||
|
|
@ -53,13 +53,13 @@ namespace E2ETests
|
|||
Environment.SetEnvironmentVariable("KRE_DEFAULT_LIB", string.Empty);
|
||||
Process hostProcess = null;
|
||||
|
||||
if (hostType == HostType.Helios)
|
||||
if (hostType == ServerType.Helios)
|
||||
{
|
||||
hostProcess = StartHeliosHost(applicationPath);
|
||||
}
|
||||
else
|
||||
{
|
||||
hostProcess = StartSelfHost(applicationPath, identityDbName);
|
||||
hostProcess = StartSelfHost(hostType, applicationPath, identityDbName);
|
||||
}
|
||||
|
||||
//Restore the KRE_DEFAULT_LIB after starting the host process
|
||||
|
|
@ -85,12 +85,14 @@ namespace E2ETests
|
|||
return hostProcess;
|
||||
}
|
||||
|
||||
private static Process StartSelfHost(string applicationPath, string identityDbName)
|
||||
private static Process StartSelfHost(ServerType hostType, string applicationPath, string identityDbName)
|
||||
{
|
||||
Console.WriteLine(string.Format("Executing klr.exe --appbase {0} \"Microsoft.Framework.ApplicationHost\" {1}", applicationPath, hostType.ToString()));
|
||||
|
||||
var startInfo = new ProcessStartInfo
|
||||
{
|
||||
FileName = "klr.exe",
|
||||
Arguments = string.Format("--appbase {0} \"Microsoft.Framework.ApplicationHost\" web", applicationPath),
|
||||
Arguments = string.Format("--appbase {0} \"Microsoft.Framework.ApplicationHost\" {1}", applicationPath, hostType.ToString()),
|
||||
UseShellExecute = true,
|
||||
CreateNoWindow = true
|
||||
};
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@
|
|||
<Compile Include="DeploymentUtility.cs" />
|
||||
<Compile Include="DbUtils.cs" />
|
||||
<Compile Include="Extensions.cs" />
|
||||
<Compile Include="HostType.cs" />
|
||||
<Compile Include="ServerType.cs" />
|
||||
<Compile Include="HtmlDOMHelper.cs" />
|
||||
<Compile Include="KreFlavor.cs" />
|
||||
<Compile Include="SmokeTests.cs" />
|
||||
|
|
|
|||
|
|
@ -1,8 +0,0 @@
|
|||
namespace E2ETests
|
||||
{
|
||||
public enum HostType
|
||||
{
|
||||
Helios,
|
||||
SelfHost
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
namespace E2ETests
|
||||
{
|
||||
public enum ServerType
|
||||
{
|
||||
Helios,
|
||||
WebListener,
|
||||
Kestrel
|
||||
}
|
||||
}
|
||||
|
|
@ -16,12 +16,16 @@ namespace E2ETests
|
|||
private HttpClientHandler httpClientHandler;
|
||||
|
||||
[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)
|
||||
[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)
|
||||
{
|
||||
Console.WriteLine("Variation Details : HostType = {0}, KreFlavor = {1}, applicationBaseUrl = {2}", hostType, kreFlavor, applicationBaseUrl);
|
||||
|
||||
var testStartTime = DateTime.Now;
|
||||
var musicStoreDbName = Guid.NewGuid().ToString().Replace("-", string.Empty);
|
||||
var musicStoreIdentityDbName = Guid.NewGuid().ToString().Replace("-", string.Empty);
|
||||
|
|
@ -35,6 +39,7 @@ namespace E2ETests
|
|||
|
||||
ApplicationBaseUrl = applicationBaseUrl;
|
||||
Process hostProcess = null;
|
||||
bool testSuccessful = false;
|
||||
|
||||
try
|
||||
{
|
||||
|
|
@ -103,9 +108,15 @@ namespace E2ETests
|
|||
var testCompletionTime = DateTime.Now;
|
||||
Console.WriteLine("[Time]: All tests completed in '{0}' seconds", (testCompletionTime - initializationCompleteTime).TotalSeconds);
|
||||
Console.WriteLine("[Time]: Total time taken for this test variation '{0}' seconds", (testCompletionTime - testStartTime).TotalSeconds);
|
||||
testSuccessful = true;
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (!testSuccessful)
|
||||
{
|
||||
Console.WriteLine("Some tests failed. Proceeding with cleanup.");
|
||||
}
|
||||
|
||||
if (hostProcess != null && !hostProcess.HasExited)
|
||||
{
|
||||
//Shutdown the host process
|
||||
|
|
|
|||
Loading…
Reference in New Issue