Skip to content

Commit 65a4c3a

Browse files
committed
Merge pull request #191 from stankovski/build
Grouped xunit tests together
2 parents cbeef4c + e72149a commit 65a4c3a

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

AzurePowershell.Test.targets

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,35 @@
3232
<AzureRTSeqAllFilter>"AzureRTUpload|Sequential|Network"</AzureRTSeqAllFilter>
3333
</PropertyGroup>
3434

35+
<ItemGroup>
36+
<XUnitTests Include=".\src\Common\Commands.Common.Test\bin\Debug\Microsoft.WindowsAzure.Commands.Common.Test.dll"/>
37+
<XUnitTests Include=".\src\ResourceManager\Sql\Commands.Sql.Test\bin\Debug\Microsoft.Azure.Commands.Sql.Test.dll"/>
38+
<XUnitTests Include=".\src\ServiceManagement\Services\Commands.Test\bin\Debug\Microsoft.WindowsAzure.Commands.Test.dll"/>
39+
<XUnitTests Include=".\src\ResourceManager\Resources\Commands.Resources.Test\bin\Debug\Microsoft.Azure.Commands.Resources.Test.dll"/>
40+
<XUnitTests Include=".\src\ResourceManager\DataFactories\Commands.DataFactories.Test\bin\Debug\Microsoft.Azure.Commands.DataFactories.Test.dll"/>
41+
<XUnitTests Include=".\src\ResourceManager\StreamAnalytics\Commands.StreamAnalytics.Test\bin\Debug\Microsoft.Azure.Commands.StreamAnalytics.Test.dll"/>
42+
<XUnitTests Include=".\src\ResourceManager\Batch\Commands.Batch.Test\bin\Debug\Microsoft.Azure.Commands.Batch.Test.dll"/>
43+
<XUnitTests Include=".\src\ResourceManager\KeyVault\Commands.KeyVault.Test\bin\Debug\Microsoft.Azure.Commands.KeyVault.Test.dll"/>
44+
<XUnitTests Include=".\src\ServiceManagement\ManagedCache\Commands.ManagedCache.Test\bin\Debug\Microsoft.Azure.Commands.ManagedCache.Test.dll"/>
45+
<XUnitTests Include=".\src\Common\Commands.ScenarioTest\bin\Debug\Microsoft.WindowsAzure.Commands.ScenarioTest.dll"/>
46+
<XUnitTests Include=".\src\ServiceManagement\RecoveryServices\Commands.RecoveryServices.Test\bin\Debug\Microsoft.Azure.Commands.RecoveryServices.Test.dll"/>
47+
<XUnitTests Include=".\src\ServiceManagement\StorSimple\Commands.StorSimple.Test\bin\Debug\Microsoft.WindowsAzure.Commands.StorSimple.Test.dll"/>
48+
</ItemGroup>
49+
3550
<Target Name="InvokeMSTest">
3651
<!--Remove existing test result; otherwsie mstest will error-->
3752
<Delete Files="$(_testResult)"/>
3853
<Exec
3954
Command="MSTest.exe /testcontainer:$(_testAssembly) /testsettings:$(_testSettings) /category:$(_testFilter) /resultsfile:$(_testResult)"
4055
ContinueOnError="false" />
4156
</Target>
57+
58+
<Target Name="InvokeXUnit">
59+
<Message Importance="high" Text="Running XUnit tests" />
60+
<MakeDir Directories="$(TestOutputDirectory)" ContinueOnError="false" />
61+
<Xunit.Runner.MSBuild.xunit Assemblies="@(XUnitTests)" Html="$(TestOutputDirectory)\xunit.tests.dll.html" Verbose="true"
62+
ExcludeTraits="$(XUnitExcludedTrait)" MaxParallelThreads="0" ParallelizeAssemblies="false" ParallelizeTestCollections="false"/>
63+
</Target>
4264

4365
<Target Name="BeforeRunTests">
4466
<Message Importance="high" Text="You are required to have installed a version of Visual Studio with support for MSTest (and MSTest on your path)." />

build.proj

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
<TestOutputDirectory>$(PublishDirectory)\TestResults</TestOutputDirectory>
1818
<DebugBuildConfig>Configuration=Debug;Platform=Any CPU</DebugBuildConfig>
1919
<ReleaseBuildConfig>Configuration=Release;Platform=Any CPU</ReleaseBuildConfig>
20+
<BuildInParallel Condition="'$(BuildInParallel)' == ''">true</BuildInParallel>
2021
</PropertyGroup>
2122
<ItemGroup>
2223
<AzurePowerShellSln Include=".\src\AzurePowerShell.sln" />
@@ -104,11 +105,13 @@
104105
Projects="@(AzurePowerShellSln)"
105106
Targets="Build"
106107
Properties="$(DebugBuildConfig)"
108+
BuildInParallel="$(BuildInParallel)"
107109
ContinueOnError="false" />
108110
<MSBuild
109111
Projects="@(AzurePowerShellSln)"
110112
Targets="Build"
111113
Properties="$(ReleaseBuildConfig)"
114+
BuildInParallel="$(BuildInParallel)"
112115
ContinueOnError="false" />
113116
</Target>
114117

@@ -160,6 +163,7 @@
160163
Projects="@(AzurePowerShellSln)"
161164
Targets="Build"
162165
Properties="$(ReleaseBuildConfig)"
166+
BuildInParallel="$(BuildInParallel)"
163167
ContinueOnError="false" />
164168
</Target>
165169

@@ -170,6 +174,7 @@
170174
Projects="@(AzurePowerShellSln)"
171175
Targets="Build"
172176
Properties="$(DebugBuildConfig)"
177+
BuildInParallel="$(BuildInParallel)"
173178
ContinueOnError="false" />
174179
</Target>
175180

@@ -183,7 +188,7 @@
183188
<!-- Run checkin tests for each pull request -->
184189
<Target Name="Test" DependsOnTargets="BuildDebug;BeforeRunTests">
185190
<Message Importance="high" Text="Running check in tests..." />
186-
<CallTarget Targets="KeyVaultTests; SqlTests; CommonTests; TestManagement; TestHDInsight; TestManagedCache; TestServiceManagement; TestServiceManagementExtensions; TestSqlDatabase; TestStorage; TestResourceManager; MockedScenarioTests; TestDSCExtension_x64; TestBatch; TestDataFactoryManager; TestRecoveryServices; TestStreamAnalyticsManager; TestStorSimple"/>
191+
<CallTarget Targets="InvokeXUnit; TestHDInsight; TestServiceManagement; TestServiceManagementExtensions; TestSqlDatabase; TestStorage; TestDSCExtension_x64"/>
187192
</Target>
188193

189194
<!-- Run Full switch with scenario tests -->

0 commit comments

Comments
 (0)