Skip to content
This repository has been archived by the owner on Jan 21, 2022. It is now read-only.

Commit

Permalink
Add integration test target to build.proj
Browse files Browse the repository at this point in the history
  • Loading branch information
Vlad Iovanov authored and mihaibuzgau committed Jun 19, 2015
1 parent 66e9e75 commit 92de41b
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 1 deletion.
1 change: 1 addition & 0 deletions CodeCoverage.runsettings
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
</Include>
<Exclude>
<ModulePath>.*\.Test\..*</ModulePath>
<ModulePath>.*\.IntegrationTests\..*</ModulePath>
<ModulePath>.*\.Client\..*</ModulePath>
<ModulePath>.*\.Common\..*</ModulePath>
</Exclude>
Expand Down
41 changes: 40 additions & 1 deletion build.proj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@
/t:UnitTest
Runs unit tests
/t:IntegrationTests
Runs integration tests
/t:RestoreNugetPackages
Restores nuget packages
Expand Down Expand Up @@ -105,6 +108,42 @@
<Exec Command="$(ReportGeneratorCommand) -reports:&quot;$(CoverageXml)&quot; -targetdir:&quot;$(CoverageHtmlDir)&quot;" />
</Target>

<!-- Target for running integration tests-->
<Target Name="IntegrationTest">
<ItemGroup>
<TestDlls Include=".\lib\tests\CloudFoundry.Build.Tasks.IntegrationTests.dll"/>
<ConfigFile Include=".\lib\tests\CloudFoundry.Build.Tasks.IntegrationTests.dll.config"/>
</ItemGroup>


<Warning Text="The CFMSBuildTestsOrganization property not set, value from app.config will be used." Condition="'$(CFMSBuildTestsOrganization)' == ''" />
<Warning Text="The CFMSBuildTestsSpace property not set, value from app.config will be used." Condition="'$(CFMSBuildTestsSpace)' == ''" />
<Warning Text="The CFMSBuildTestsStack property not set, value from app.config will be used." Condition="'$(CFMSBuildTestsStack)' == ''" />
<Warning Text="The CFMSBuildTestsServiceType property not set, value from app.config will be used." Condition="'$(CFMSBuildTestsServiceType)' == ''" />
<Warning Text="The CFMSBuildTestsServicePlan property not set, value from app.config will be used." Condition="'$(CFMSBuildTestsServicePlan)' == ''" />
<Warning Text="The CFMSBuildTestsUser property not set, value from app.config will be used." Condition="'$(CFMSBuildTestsUser)' == ''" />
<Warning Text="The CFMSBuildTestsPassword property not set, value from app.config will be used." Condition="'$(CFMSBuildTestsPassword)' == ''" />
<Warning Text="The CFMSBuildTestsServerUri property not set, value from app.config will be used." Condition="'$(CFMSBuildTestsServerUri)' == ''" />
<Warning Text="The CFMSBuildTestsRoute property not set, value from app.config will be used." Condition="'$(CFMSBuildTestsRoute)' == ''" />

<Message Text="Updating config file at %(ConfigFile.Identity)" />

<XmlPoke Condition="'$(CFMSBuildTestsOrganization)' != ''" XmlInputPath="%(ConfigFile.Identity)" Query="/configuration/userSettings/CloudFoundry.Build.Tasks.IntegrationTests.Properties.Settings/setting[@name='Organization']/value" Value="$(CFMSBuildTestsOrganization)"/>
<XmlPoke Condition="'$(CFMSBuildTestsSpace)' != ''" XmlInputPath="%(ConfigFile.Identity)" Query="/configuration/userSettings/CloudFoundry.Build.Tasks.IntegrationTests.Properties.Settings/setting[@name='Space']/value" Value="$(CFMSBuildTestsSpace)"/>
<XmlPoke Condition="'$(CFMSBuildTestsStack)' != ''" XmlInputPath="%(ConfigFile.Identity)" Query="/configuration/userSettings/CloudFoundry.Build.Tasks.IntegrationTests.Properties.Settings/setting[@name='Stack']/value" Value="$(CFMSBuildTestsStack)"/>
<XmlPoke Condition="'$(CFMSBuildTestsServiceType)' != ''" XmlInputPath="%(ConfigFile.Identity)" Query="/configuration/userSettings/CloudFoundry.Build.Tasks.IntegrationTests.Properties.Settings/setting[@name='ServiceType']/value" Value="$(CFMSBuildTestsServiceType)"/>
<XmlPoke Condition="'$(CFMSBuildTestsServicePlan)' != ''" XmlInputPath="%(ConfigFile.Identity)" Query="/configuration/userSettings/CloudFoundry.Build.Tasks.IntegrationTests.Properties.Settings/setting[@name='ServicePlan']/value" Value="$(CFMSBuildTestsServicePlan)"/>
<XmlPoke Condition="'$(CFMSBuildTestsUser)' != ''" XmlInputPath="%(ConfigFile.Identity)" Query="/configuration/userSettings/CloudFoundry.Build.Tasks.IntegrationTests.Properties.Settings/setting[@name='User']/value" Value="$(CFMSBuildTestsUser)"/>
<XmlPoke Condition="'$(CFMSBuildTestsPassword)' != ''" XmlInputPath="%(ConfigFile.Identity)" Query="/configuration/userSettings/CloudFoundry.Build.Tasks.IntegrationTests.Properties.Settings/setting[@name='Password']/value" Value="$(CFMSBuildTestsPassword)"/>
<XmlPoke Condition="'$(CFMSBuildTestsServerUri)' != ''" XmlInputPath="%(ConfigFile.Identity)" Query="/configuration/userSettings/CloudFoundry.Build.Tasks.IntegrationTests.Properties.Settings/setting[@name='ServerUri']/value" Value="$(CFMSBuildTestsServerUri)"/>
<XmlPoke Condition="'$(CFMSBuildTestsRoute)' != ''" XmlInputPath="%(ConfigFile.Identity)" Query="/configuration/userSettings/CloudFoundry.Build.Tasks.IntegrationTests.Properties.Settings/setting[@name='Route']/value" Value="$(CFMSBuildTestsRoute)"/>

<Exec Command="$(VSTestCommand) %(TestDlls.Identity) /inIsolation /settings:CodeCoverage.runsettings /logger:trx" ConsoleToMSBuild="true">
<Output TaskParameter="ExitCode" PropertyName="ErrorCode"/>
<Output TaskParameter="ConsoleOutput" PropertyName="OutputOfTestRun" />
</Exec>
</Target>

<!-- Target for restoring nuget packages -->
<Target Name="RestoreNugetPackages">
<Exec Command="$(NuGetCommand) restore $(SDKMSBuildTasksSolution)"/>
Expand Down

0 comments on commit 92de41b

Please sign in to comment.