Skip to content

Commit bb38103

Browse files
committed
Merge pull request #114 from huangpf/dev
Dev
2 parents edd300f + 6b38643 commit bb38103

File tree

59 files changed

+1758
-198
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+1758
-198
lines changed

AzurePowershell.Test.targets

Lines changed: 39 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -42,34 +42,7 @@
4242
<TestTimeout Condition=" '$(TestTimeout)' == '' ">100000000</TestTimeout>
4343
</PropertyGroup>
4444

45-
<ItemGroup>
46-
<XUnitTests Include=".\src\ResourceManager\AzureBackup\Commands.AzureBackup.Test\bin\Debug\Microsoft.Azure.Commands.AzureBackup.Test.dll"/>
47-
<XUnitTests Include=".\src\ResourceManager\SiteRecovery\Commands.SiteRecovery.Test\bin\Debug\Microsoft.Azure.Commands.SiteRecovery.Test.dll"/>
48-
<XUnitTests Include=".\src\ServiceManagement\Common\Commands.Common.Test\bin\Debug\Microsoft.WindowsAzure.Commands.Common.Test.dll"/>
49-
<XUnitTests Include=".\src\ResourceManager\Sql\Commands.Sql.Test\bin\Debug\Microsoft.Azure.Commands.Sql.Test.dll"/>
50-
<XUnitTests Include=".\src\ServiceManagement\Services\Commands.Test\bin\Debug\Microsoft.WindowsAzure.Commands.Test.dll"/>
51-
<XUnitTests Include=".\src\ServiceManagement\StorSimple\Commands.StorSimple.Test\bin\Debug\Microsoft.WindowsAzure.Commands.StorSimple.Test.dll"/>
52-
<XUnitTests Include=".\src\ResourceManager\Resources\Commands.Resources.Test\bin\Debug\Microsoft.Azure.Commands.Resources.Test.dll"/>
53-
<XUnitTests Include=".\src\ResourceManager\Compute\Commands.Compute.Test\bin\Debug\Microsoft.Azure.Commands.Compute.Test.dll"/>
54-
<XUnitTests Include=".\src\ResourceManager\Network\Commands.Network.Test\bin\Debug\Microsoft.Azure.Commands.Network.Test.dll"/>
55-
<XUnitTests Include=".\src\ResourceManager\DataFactories\Commands.DataFactories.Test\bin\Debug\Microsoft.Azure.Commands.DataFactories.Test.dll"/>
56-
<XUnitTests Include=".\src\ResourceManager\Dns\Commands.Dns.Test\bin\Debug\Microsoft.Azure.Commands.Dns.Test.dll"/>
57-
<XUnitTests Include=".\src\ResourceManager\StreamAnalytics\Commands.StreamAnalytics.Test\bin\Debug\Microsoft.Azure.Commands.StreamAnalytics.Test.dll"/>
58-
<XUnitTests Include=".\src\ResourceManager\OperationalInsights\Commands.OperationalInsights.Test\bin\Debug\Microsoft.Azure.Commands.OperationalInsights.Test.dll"/>
59-
<XUnitTests Include=".\src\ResourceManager\AzureBatch\Commands.Batch.Test\bin\Debug\Microsoft.Azure.Commands.Batch.Test.dll"/>
60-
<XUnitTests Include=".\src\ResourceManager\Websites\Commands.Websites.Test\bin\Debug\Microsoft.Azure.Commands.Websites.Test.dll"/>
61-
<XUnitTests Include=".\src\ResourceManager\KeyVault\Commands.KeyVault.Test\bin\Debug\Microsoft.Azure.Commands.KeyVault.Test.dll"/>
62-
<XUnitTests Include=".\src\ResourceManager\UsageAggregates\Commands.UsageAggregates.Test\bin\Debug\Microsoft.Azure.Commands.UsageAggregates.Test.dll"/>
63-
<XUnitTests Include=".\src\ServiceManagement\ManagedCache\Commands.ManagedCache.Test\bin\Debug\Microsoft.Azure.Commands.ManagedCache.Test.dll"/>
64-
<XUnitTests Include=".\src\ServiceManagement\RemoteApp\Commands.RemoteApp.Test\bin\Debug\Microsoft.Azure.Commands.RemoteApp.Tests.dll"/>
65-
<XUnitTests Include=".\src\ServiceManagement\Common\Commands.ScenarioTest\bin\Debug\Microsoft.WindowsAzure.Commands.ScenarioTest.dll"/>
66-
<XUnitTests Include=".\src\ServiceManagement\RecoveryServices\Commands.RecoveryServices.Test\bin\Debug\Microsoft.Azure.Commands.RecoveryServices.Test.dll"/>
67-
<XUnitTests Include=".\src\ResourceManager\TrafficManager\Commands.TrafficManager2.Test\bin\Debug\Microsoft.Azure.Commands.TrafficManager.Test.ScenarioTests.dll"/>
68-
<XUnitTests Include=".\src\ServiceManagement\Network\Commands.Network.Test\bin\Debug\Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Test.dll"/>
69-
<XUnitTests Include=".\src\ResourceManager\ApiManagement\Commands.ApiManagement.Test\bin\Debug\Microsoft.Azure.Commands.ApiManagement.Test.dll"/>
70-
<XUnitTests Include=".\src\ResourceManager\Profile\Commands.Profile.Test\bin\Debug\Microsoft.Azure.Commands.Profile.Test.dll"/>
71-
</ItemGroup>
72-
45+
7346
<Target Name="InvokeMSTest">
7447
<!--Remove existing test result; otherwise mstest will error-->
7548
<Delete Files="$(_testResult)"/>
@@ -79,11 +52,48 @@
7952
</Target>
8053

8154
<Target Name="InvokeXUnit">
55+
<ItemGroup>
56+
<AsmXUnitTests Include=".\src\ServiceManagement\Common\Commands.Common.Test\bin\Debug\Microsoft.WindowsAzure.Commands.Common.Test.dll"/>
57+
<AsmXUnitTests Include=".\src\ServiceManagement\Services\Commands.Test\bin\Debug\Microsoft.WindowsAzure.Commands.Test.dll"/>
58+
<AsmXUnitTests Include=".\src\ServiceManagement\StorSimple\Commands.StorSimple.Test\bin\Debug\Microsoft.WindowsAzure.Commands.StorSimple.Test.dll"/>
59+
<AsmXUnitTests Include=".\src\ServiceManagement\ManagedCache\Commands.ManagedCache.Test\bin\Debug\Microsoft.Azure.Commands.ManagedCache.Test.dll"/>
60+
<AsmXUnitTests Include=".\src\ServiceManagement\RemoteApp\Commands.RemoteApp.Test\bin\Debug\Microsoft.Azure.Commands.RemoteApp.Tests.dll"/>
61+
<AsmXUnitTests Include=".\src\ServiceManagement\Common\Commands.ScenarioTest\bin\Debug\Microsoft.WindowsAzure.Commands.ScenarioTest.dll"/>
62+
<AsmXUnitTests Include=".\src\ServiceManagement\RecoveryServices\Commands.RecoveryServices.Test\bin\Debug\Microsoft.Azure.Commands.RecoveryServices.Test.dll"/>
63+
<AsmXUnitTests Include=".\src\ServiceManagement\Network\Commands.Network.Test\bin\Debug\Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Test.dll"/>
64+
</ItemGroup>
65+
<ItemGroup Condition=" '$(scope)' == '' ">
66+
<XUnitTests Include=".\src\ResourceManager\SiteRecovery\Commands.SiteRecovery.Test\bin\Debug\Microsoft.Azure.Commands.SiteRecovery.Test.dll"/>
67+
<XUnitTests Include=".\src\ResourceManager\Sql\Commands.Sql.Test\bin\Debug\Microsoft.Azure.Commands.Sql.Test.dll"/>
68+
<XUnitTests Include=".\src\ResourceManager\Resources\Commands.Resources.Test\bin\Debug\Microsoft.Azure.Commands.Resources.Test.dll"/>
69+
<XUnitTests Include=".\src\ResourceManager\Compute\Commands.Compute.Test\bin\Debug\Microsoft.Azure.Commands.Compute.Test.dll"/>
70+
<XUnitTests Include=".\src\ResourceManager\Network\Commands.Network.Test\bin\Debug\Microsoft.Azure.Commands.Network.Test.dll"/>
71+
<XUnitTests Include=".\src\ResourceManager\DataFactories\Commands.DataFactories.Test\bin\Debug\Microsoft.Azure.Commands.DataFactories.Test.dll"/>
72+
<XUnitTests Include=".\src\ResourceManager\Dns\Commands.Dns.Test\bin\Debug\Microsoft.Azure.Commands.Dns.Test.dll"/>
73+
<XUnitTests Include=".\src\ResourceManager\StreamAnalytics\Commands.StreamAnalytics.Test\bin\Debug\Microsoft.Azure.Commands.StreamAnalytics.Test.dll"/>
74+
<XUnitTests Include=".\src\ResourceManager\OperationalInsights\Commands.OperationalInsights.Test\bin\Debug\Microsoft.Azure.Commands.OperationalInsights.Test.dll"/>
75+
<XUnitTests Include=".\src\ResourceManager\AzureBatch\Commands.Batch.Test\bin\Debug\Microsoft.Azure.Commands.Batch.Test.dll"/>
76+
<XUnitTests Include=".\src\ResourceManager\Websites\Commands.Websites.Test\bin\Debug\Microsoft.Azure.Commands.Websites.Test.dll"/>
77+
<XUnitTests Include=".\src\ResourceManager\KeyVault\Commands.KeyVault.Test\bin\Debug\Microsoft.Azure.Commands.KeyVault.Test.dll"/>
78+
<XUnitTests Include=".\src\ResourceManager\UsageAggregates\Commands.UsageAggregates.Test\bin\Debug\Microsoft.Azure.Commands.UsageAggregates.Test.dll"/>
79+
<XUnitTests Include=".\src\ResourceManager\TrafficManager\Commands.TrafficManager2.Test\bin\Debug\Microsoft.Azure.Commands.TrafficManager.Test.ScenarioTests.dll"/>
80+
<XUnitTests Include=".\src\ResourceManager\ApiManagement\Commands.ApiManagement.Test\bin\Debug\Microsoft.Azure.Commands.ApiManagement.Test.dll"/>
81+
<XUnitTests Include=".\src\ResourceManager\Profile\Commands.Profile.Test\bin\Debug\Microsoft.Azure.Commands.Profile.Test.dll"/>
82+
<XUnitTests Include=".\src\ResourceManager\AzureBackup\Commands.AzureBackup.Test\bin\Debug\Microsoft.Azure.Commands.AzureBackup.Test.dll"/>
83+
<XUnitTests Include="@(AsmXUnitTests)"/>
84+
</ItemGroup>
85+
<ItemGroup Condition=" '$(scope)' == 'ServiceManagement' ">
86+
<XUnitTests Include="@(AsmXUnitTests)"/>
87+
</ItemGroup>
88+
<ItemGroup Condition=" '$(scope)' !='' and '$(scope)' != 'ServiceManagement' ">
89+
<XUnitTests Include="$(MSBuildProjectDirectory)\src\ResourceManager\$(scope)\*\bin\Debug\*.Test.dll"/>
90+
</ItemGroup>
91+
8292
<Message Importance="high" Text="Running XUnit tests" />
8393
<MakeDir Directories="$(TestOutputDirectory)" ContinueOnError="false" />
8494
<Exec
8595
Command="$(MSBuildProjectDirectory)\packages\xunit.runner.console.2.0.0\tools\xunit.console.x86.exe &quot;%(XUnitTests.Identity)&quot; -parallel none -maxthreads 0 -trait &quot;AcceptanceType=CheckIn&quot; -html &quot;$(TestOutputDirectory)\%(XUnitTests.Filename).html&quot;"
86-
Timeout="$(TestTimeout)" ContinueOnError="false"/>
96+
Timeout="$(TestTimeout)" ContinueOnError="false" Condition=" @(XUnitTests) != '' "/>
8797
<OnError ExecuteTargets="TimeoutErrorHandler"/>
8898
</Target>
8999

@@ -101,7 +111,6 @@
101111
</Target>
102112

103113
<Target Name="BeforeRunTests">
104-
<Message Importance="high" Text="You are required to have installed a version of Visual Studio with support for MSTest (and MSTest on your path)." />
105114
<MakeDir Directories="$(TestOutputDirectory)" ContinueOnError="false" />
106115
</Target>
107116

build.proj

Lines changed: 23 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@
3939
<NuGetPublishingSource Condition=" '$(NuGetPublishingSource)' != '' ">http://psget/PSGallery/api/v2/</NuGetPublishingSource>
4040
</PropertyGroup>
4141
<ItemGroup>
42-
<AzureResourceManagerSln Include=".\src\ResourceManager.sln" />
43-
<AzureServiceManagementSln Include=".\src\ServiceManagement.sln" />
42+
<CmdletSolutionsToBuild Include=".\src\ResourceManager.sln;.\src\ServiceManagement.sln" Condition=" '$(Scope)' == '' "/>
43+
<CmdletSolutionsToBuild Include=".\src\$(Scope).sln" Condition=" '$(Scope)' != '' "/>
4444
<SetupSln Include=".\setup\azurepowershell.sln" />
4545
<SetupPowershellGetSln Include=".\setup-powershellget\powershellget.sln" />
4646
</ItemGroup>
@@ -64,28 +64,19 @@
6464

6565
<!-- Clean the build in all configurations -->
6666
<Target Name="Clean">
67-
<!-- Clean the solutions -->
6867
<Message Importance="high" Text="Cleaning Cmdlets..." ContinueOnError="false" />
6968
<MSBuild
70-
Projects="@(AzureResourceManagerSln)"
71-
Targets="Clean"
72-
Properties="Configuration=$(Configuration);Platform=Any CPU"
73-
ContinueOnError="false" />
74-
<MSBuild
75-
Projects="@(AzureServiceManagementSln)"
76-
Targets="Clean"
77-
Properties="Configuration=$(Configuration);Platform=Any CPU"
78-
ContinueOnError="false" />
79-
<MSBuild
80-
Projects="@(SetupSln)"
69+
Projects="@(CmdletSolutionsToBuild)"
8170
Targets="Clean"
8271
Properties="Configuration=$(Configuration);Platform=Any CPU"
8372
ContinueOnError="false" />
73+
8474
<MSBuild
8575
Projects="@(SetupPowershellGetSln)"
8676
Targets="Clean"
8777
Properties="Configuration=$(Configuration);Platform=Any CPU"
88-
ContinueOnError="false" />
78+
ContinueOnError="false"
79+
Condition=" '$(Scope)' == '' "/>
8980

9081
<!-- Delete the publish files -->
9182
<Message Importance="high" Text="Cleaning publish files..." ContinueOnError="false" />
@@ -140,8 +131,12 @@
140131
<Exec Command="$(NuGetCommand) sources add -Name LocalFeed -Source &quot;$(MSBuildProjectDirectory)\tools\LocalFeed&quot; $(NuGetRestoreConfigSwitch)"/>
141132

142133
<!-- Restore packages -->
143-
<Exec Command="$(NuGetCommand) restore $(MSBuildProjectDirectory)\src\ResourceManager.sln $(NuGetRestoreConfigSwitch)" ContinueOnError="false" />
144-
<Exec Command="$(NuGetCommand) restore $(MSBuildProjectDirectory)\src\ServiceManagement.sln $(NuGetRestoreConfigSwitch)" ContinueOnError="false" />
134+
<Exec Command="$(NuGetCommand) restore $(MSBuildProjectDirectory)\src\ResourceManager.sln $(NuGetRestoreConfigSwitch)" ContinueOnError="false"
135+
Condition="$(Scope) == ''" />
136+
<Exec Command="$(NuGetCommand) restore $(MSBuildProjectDirectory)\src\ServiceManagement.sln $(NuGetRestoreConfigSwitch)" ContinueOnError="false"
137+
Condition="$(Scope) == ''" />
138+
<Exec Command="$(NuGetCommand) restore $(MSBuildProjectDirectory)\src\$(Scope).sln $(NuGetRestoreConfigSwitch)" ContinueOnError="false"
139+
Condition="$(Scope) != ''" />
145140

146141
<!--Restore the xunit runner needed to run unit tests-->
147142
<Exec Command="$(NuGetCommand) restore $(MSBuildProjectDirectory)\packages.config -PackagesDirectory $(MSBuildProjectDirectory)\packages" />
@@ -153,15 +148,11 @@
153148
<Target Name="Build" DependsOnTargets="RestoreNugetPackages;BuildMsBuildTask">
154149
<Message Importance="high" Text="Building Cmdlets..." />
155150
<MSBuild
156-
Projects="@(AzureResourceManagerSln)"
151+
Projects="@(CmdletSolutionsToBuild)"
157152
Targets="Build"
158153
Properties="Configuration=$(Configuration);Platform=Any CPU"
159-
BuildInParallel="$(BuildInParallel)" ContinueOnError="false" />
160-
<MSBuild
161-
Projects="@(AzureServiceManagementSln)"
162-
Targets="Build"
163-
Properties="Configuration=$(Configuration);Platform=Any CPU"
164-
BuildInParallel="$(BuildInParallel)" ContinueOnError="false" />
154+
BuildInParallel="$(BuildInParallel)"
155+
ContinueOnError="false" />
165156

166157
<CallTarget Targets="CodeSignBinaries" Condition=" '$(CodeSign)' == 'true' " />
167158

@@ -170,14 +161,18 @@
170161
Projects="@(SetupPowershellGetSln)"
171162
Targets="Build"
172163
Properties="Configuration=$(Configuration);Platform=Any CPU"
173-
ContinueOnError="false" />
164+
ContinueOnError="false"
165+
Condition=" '$(Scope)' == '' "/>
166+
174167
<MSBuild
175168
Projects="@(SetupSln)"
176169
Targets="Build"
177170
Properties="Configuration=$(Configuration);Platform=Any CPU"
178-
ContinueOnError="false" />
171+
ContinueOnError="false"
172+
Condition=" '$(Scope)' == '' "/>
179173

180-
<CallTarget Targets="CodeSignInstaller" Condition=" '$(CodeSign)' == 'true' " />
174+
<CallTarget Targets="CodeSignInstaller"
175+
Condition=" '$(CodeSign)' == 'true' and '$(Scope)' == ''" />
181176
</Target>
182177

183178
<!-- Do everything possible -->
@@ -305,7 +300,7 @@
305300
<Import Project="$(MSBuildThisFileDirectory)AzurePowershell.test.targets"/>
306301

307302
<!-- Run checkin tests for each pull request -->
308-
<Target Name="Test" DependsOnTargets="Build;BeforeRunTests">
303+
<Target Name="Test" DependsOnTargets="BeforeRunTests">
309304
<Message Importance="high" Text="Running check in tests..." />
310305
<CallTarget Targets="InvokeXUnit"/>
311306
</Target>

0 commit comments

Comments
 (0)