Permalink
Browse files

Finalized integration testing harness as defined in #213

User will still have to manually configure IIS since scripts would have to have administrative privileges to configure it automatically.
  • Loading branch information...
1 parent 0ba3bc0 commit 82633e81e7ddd45da71fe8c6a6586c24bbe215ee @nikmd23 nikmd23 committed Jan 14, 2013
View
26 default.ps1
@@ -196,15 +196,31 @@ task push {
task buildjs {
}
-task int {
+task integrate {
"Integration Testing"
+ " Clean Glimpse.Test.Integration"
+ Delete-Directory "$source_dir\Glimpse.Test.Integration\bin"
+ Delete-Directory "$source_dir\Glimpse.Test.Integration\obj"
+
+ " Clean Glimpse.Test.Integration.Site"
+ Delete-Directory "$source_dir\Glimpse.Test.Integration.Site\bin"
+ Delete-Directory "$source_dir\Glimpse.Test.Integration.Site\obj"
+
+ "`nBuild Integration Sln"
+ exec { msbuild $base_dir\Glimpse.Integration.sln /p:Configuration=$config /nologo /verbosity:minimal }
+
"`nGlimpse must be manually installed while waiting for http://nuget.codeplex.com/workitem/2730"
#cd $base_dir\.NuGet
#nuget update -source "c:\glimpse\builds\local" -Id Glimpse.MVC3;Glimpse.AspNet;Glimpse -Verbose "c:\glimpse\source\Glimpse.Test.Integration.Site\packages.config"
#exec { & .\nuget.exe update -source $build_dir\local -id "Glimpse.MVC3;Glimpse.AspNet;Glimpse" -Verbose "$source_dir\Glimpse.Test.Integration.Site\packages.config" }
+ "`nIIS must be set up with Administrative privledges. Run: "
+ "C:\Windows\System32\inetsrv\appcmd.exe add site /name:""Glimpse Integration Test Site"" /bindings:""http/*:1155:"" /physicalPath:""C:\Glimpse\source\Glimpse.Test.Integration.Site"
+ "to support IIS testing"
+
+
"`nEnding Cassini"
kill -name WebDev.WebServer*
@@ -219,19 +235,21 @@ task int {
$exists = Test-Path($cassiniPath)
if ($exists -eq $false)
{
- throw "Add directory containing 'WebDev.WebServer40.EXE' to PATH environment variable."
+ "Using WebDev.WebServer40.EXE from PATH. Add directory containing 'WebDev.WebServer40.EXE' to PATH environment variable."
+ $cassiniPath = "WebDev.WebServer40.EXE"
}
}
$iisExpressPath = "C:\Program Files (x86)\IIS Express\iisexpress.exe"
$exists = Test-Path($iisExpressPath)
if ($exists -eq $false)
{
- $iisExpressPath = "C:\Program Files (x86)\IIS Express\iisexpress.exe"
+ $iisExpressPath = "C:\Program Files\IIS Express\iisexpress.exe"
$exists = Test-Path($iisExpressPath)
if ($exists -eq $false)
{
- throw "Add directory containing 'iisexpress.exe' to PATH environment variable."
+ "Using iisexpress.exe from PATH. Add directory containing 'iisexpress.exe' to PATH environment variable."
+ $iisExpressPath = "iisexpress.exe"
}
}
View
2 source/Glimpse.Test.Integration.Site/Controllers/HomeController.cs
@@ -8,7 +8,7 @@ public ActionResult Index(string id)
{
HttpContext.Items.Add(IntegrationTestTab.Expected, id);
- return View();
+ return View(model: id);
}
}
}
View
21 source/Glimpse.Test.Integration.Site/Views/Home/Index.cshtml
@@ -1,3 +1,20 @@
-@model dynamic
+@model string
-<h2>abc</h2>
+<h2>Home/Index</h2>
+
+<p>This is a <em>very</em> generic test page, typically used just to make sure there is not an exception thrown. The test harness will simply check Glimpse to ensure the value '@Model' is present.</p>
+
+<p>This test requires may require IIS, IIS Express or Cassini to be running. Cassini and IIS Express run with non-Administrator credentials and should have been setup automatically via the psake script. IIS requires manual configuration.</p>
+
+<p>
+ The following ports are used consistently across the test harness:
+
+ <ul>
+ <li><strong>234:</strong> Cassini (<a href="http://localhost:234">http://localhost:234</a>)</li>
+ <li><strong>1153:</strong> IIS Express (<a href="http://localhost:1153">http://localhost:1153</a>)</li>
+ <li>
+ <strong>1155:</strong> IIS (<a href="http://localhost:1155">http://localhost:1155</a>)<br/>
+ <em>In addition, IIS should have a virtual directory named '<a href="http://localhost:1155/virdir">virdir</a>' pointed at the same application root.</em>
+ </li>
+ </ul>
+</p>
View
33 source/Glimpse.Test.Integration.Site/Web.config
@@ -4,6 +4,7 @@
http://go.microsoft.com/fwlink/?LinkId=152368
-->
<configuration>
+
<configSections>
<section name="glimpse" type="Glimpse.Core.Configuration.GlimpseSection, Glimpse.Core" />
</configSections>
@@ -43,15 +44,17 @@
<add path="glimpse.axd" verb="GET" type="Glimpse.AspNet.HttpHandler, Glimpse.AspNet" />
</httpHandlers>
</system.web>
- <system.webServer>
- <validation validateIntegratedModeConfiguration="false" />
- <modules runAllManagedModulesForAllRequests="true">
- <add name="Glimpse" type="Glimpse.AspNet.HttpModule, Glimpse.AspNet" preCondition="integratedMode" />
- </modules>
- <handlers>
- <add name="Glimpse" path="glimpse.axd" verb="GET" type="Glimpse.AspNet.HttpHandler, Glimpse.AspNet" preCondition="integratedMode" />
- </handlers>
- </system.webServer>
+ <location inheritInChildApplications="false"> <!-- Stole this idea from Rick Strahl to enable virdir to work: http://www.west-wind.com/weblog/posts/2007/Aug/11/IISASPNET-Settings-and-Virtual-Directory-Inheritance -->
+ <system.webServer>
+ <validation validateIntegratedModeConfiguration="false" />
+ <modules runAllManagedModulesForAllRequests="true">
+ <add name="Glimpse" type="Glimpse.AspNet.HttpModule, Glimpse.AspNet" preCondition="integratedMode" />
+ </modules>
+ <handlers>
+ <add name="Glimpse" path="glimpse.axd" verb="GET" type="Glimpse.AspNet.HttpHandler, Glimpse.AspNet" preCondition="integratedMode" />
+ </handlers>
+ </system.webServer>
+ </location>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
@@ -68,4 +71,16 @@
</ignoredTypes>
</runtimePolicies>
</glimpse>
+<!-- <location path=".">
+ <system.webServer>
+ <modules runAllManagedModulesForAllRequests="true">
+ <remove name="Glimpse"/>
+ <add name="Glimpse" type="Glimpse.AspNet.HttpModule, Glimpse.AspNet" preCondition="integratedMode" />
+ </modules>
+ <handlers>
+ <remove name="Glimpse"/>
+ <add name="Glimpse" path="glimpse.axd" verb="GET" type="Glimpse.AspNet.HttpHandler, Glimpse.AspNet" preCondition="integratedMode" />
+ </handlers>
+ </system.webServer>
+ </location>-->
</configuration>
View
BIN source/Glimpse.Test.Integration/Tests.xls
Binary file not shown.

0 comments on commit 82633e8

Please sign in to comment.