forked from Azzhag/azure-sdk-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
AzurePowershell.Test.targets
300 lines (261 loc) · 17.3 KB
/
AzurePowershell.Test.targets
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
<?xml version="1.0" encoding="utf-8"?>
<Project
xmlns="http://schemas.microsoft.com/developer/msbuild/2003"
ToolsVersion="4.0">
<PropertyGroup>
<TestSettings>.\src\Local.testsettings</TestSettings>
<TestSettings_x64>.\src\Local.x64.testsettings</TestSettings_x64>
<ScenarioTestDebug>.\src\Common\Commands.ScenarioTest\bin\Debug\Microsoft.WindowsAzure.Commands.ScenarioTest.dll</ScenarioTestDebug>
<CommonTestDebug>.\src\Common\Commands.Common.Test\bin\Debug\Microsoft.WindowsAzure.Commands.Common.Test.dll</CommonTestDebug>
<SqlTestDebug>.\src\ResourceManager\Sql\Commands.Sql.Test\bin\Debug\Microsoft.Azure.Commands.Sql.Test.dll</SqlTestDebug>
<AzureRTTestSettings>.\src\AzureRT.testsettings</AzureRTTestSettings>
<AzureRTTestContainer>.\src\ServiceManagement\Compute\Commands.ServiceManagement.Test\bin\Debug\Microsoft.WindowsAzure.Commands.ServiceManagement.Test.dll</AzureRTTestContainer>
<StorageScenarioTestDebug>src\ServiceManagement\Storage\Commands.Storage.ScenarioTest\bin\Debug\CLITest.dll</StorageScenarioTestDebug>
<ManagementTestDebug>.\src\ServiceManagement\Services\Commands.Test\bin\Debug\Microsoft.WindowsAzure.Commands.Test.dll</ManagementTestDebug>
<ResourceManagerTestDebug>.\src\ResourceManager\Resources\Commands.Resources.Test\bin\Debug\Microsoft.Azure.Commands.Resources.Test.dll</ResourceManagerTestDebug>
<ServiceManagementTestDebug>.\src\ServiceManagement\Compute\Commands.ServiceManagement.Test\bin\Debug\Microsoft.WindowsAzure.Commands.ServiceManagement.Test.dll</ServiceManagementTestDebug>
<ServiceManagementExtensionsTestDebug>.\src\ServiceManagement\Compute\Commands.ServiceManagement.Extensions.Test\bin\Debug\Microsoft.WindowsAzure.Commands.ServiceManagement.Extensions.Test.dll</ServiceManagementExtensionsTestDebug>
<SqlDatabaseTestDebug>.\src\ServiceManagement\Sql\Commands.SqlDatabase.Test\bin\Debug\Microsoft.WindowsAzure.Commands.SqlDatabase.Test.dll</SqlDatabaseTestDebug>
<HDInsightTestDebug>.\src\ServiceManagement\HDInsight\Commands.HDInsight.Test\bin\Debug\Microsoft.WindowsAzure.Commands.HDInsight.Test.dll</HDInsightTestDebug>
<StorageTestDebug>.\src\ServiceManagement\Storage\Commands.Storage.Test\bin\Debug\Microsoft.WindowsAzure.Commands.Storage.Test.dll</StorageTestDebug>
<TestFilter>"!Functional&!Scenario&!AzureRTScenario&!Sequential&!PIRTest&!Preview&!ADDomain"</TestFilter>
<ScenarioTestFilter>All</ScenarioTestFilter>
<MockTestFilter>CheckIn</MockTestFilter>
<OneSDKCITFilter>"OneSDK&CIT"</OneSDKCITFilter>
<MediaServiceBVTFilter>"MediaServices&BVT"</MediaServiceBVTFilter>
<WebsiteBVTFilter>"Websites&BVT"</WebsiteBVTFilter>
<CloudServiceBVTFilter>"CloudService&BVT"</CloudServiceBVTFilter>
<StorageBVTFilter>"Storage&BVT"</StorageBVTFilter>
<ManagementBVTFilter>"Management&BVT"</ManagementBVTFilter>
<ManagedCacheBVTFilter>"ManagedCache&BVT"</ManagedCacheBVTFilter>
<ServiceBusBVTFilter>"ServiceBus&BVT"</ServiceBusBVTFilter>
<AzureRTAllTestFilter>"Functional|AzureRTScenario"</AzureRTAllTestFilter>
<AzureRTAllTestFilter2>"Functional|AzureRTScenario|Preview"</AzureRTAllTestFilter2>
<AzureRTAllTestFilter3>"Functional|AzureRTScenario|Sequential"</AzureRTAllTestFilter3>
</PropertyGroup>
<Target Name="InvokeMSTest">
<!--Remove existing test result; otherwsie mstest will error-->
<Delete Files="$(_testResult)"/>
<Exec
Command="MSTest.exe /testcontainer:$(_testAssembly) /testsettings:$(_testSettings) /category:$(_testFilter) /resultsfile:$(_testResult)"
ContinueOnError="false" />
</Target>
<Target Name="BeforeRunTests">
<Message Importance="high" Text="You are required to have installed a version of Visual Studio with support for MSTest (and MSTest on your path)." />
<MakeDir Directories="$(TestOutputDirectory)" ContinueOnError="false" />
</Target>
<Target Name="TestManagement">
<Xunit.Runner.MSBuild.xunit Assembly="$(ManagementTestDebug)" Html="$(TestOutputDirectory)\ManagementDebug.xunit.dll.html" Verbose="true"/>
</Target>
<Target Name="TestManagedCache">
<PropertyGroup>
<_ManagedCacheTestAssembly>.\src\ServiceManagement\ManagedCache\Commands.ManagedCache.Test\bin\Debug\Microsoft.Azure.Commands.ManagedCache.Test.dll</_ManagedCacheTestAssembly>
</PropertyGroup>
<Xunit.Runner.MSBuild.xunit Assembly="$(_ManagedCacheTestAssembly)" Html="$(TestOutputDirectory)\ManagedCache.xunit.dll.html" Verbose="true"/>
</Target>
<Target Name="TestResourceManager">
<Xunit.Runner.MSBuild.xunit Assembly="$(ResourceManagerTestDebug)" Html="$(TestOutputDirectory)\ResourceManagerTestDebug.xunit.dll.html" Verbose="true"/>
</Target>
<Target Name="TestServiceManagement">
<MSBuild Targets="InvokeMSTest"
Properties="_testAssembly=$(ServiceManagementTestDebug);_testSettings=$(TestSettings);_testFilter=$(TestFilter);_testResult=$(TestOutputDirectory)\ServiceManagementDebug.trx"
Projects="build.proj"/>
</Target>
<Target Name="TestServiceManagementExtensions">
<MSBuild Targets="InvokeMSTest"
Properties="_testAssembly=$(ServiceManagementExtensionsTestDebug);_testSettings=$(TestSettings);_testFilter=$(TestFilter);_testResult=$(TestOutputDirectory)\ServiceManagementExtensionsDebug.trx"
Projects="build.proj"/>
</Target>
<Target Name="TestSqlDatabase">
<MSBuild Targets="InvokeMSTest"
Properties="_testAssembly=$(SqlDatabaseTestDebug);_testSettings=$(TestSettings);_testFilter=$(TestFilter);_testResult=$(TestOutputDirectory)\SqlDatabaseDebug.trx"
Projects="build.proj"/>
</Target>
<Target Name="TestHDInsight">
<MSBuild Targets="InvokeMSTest"
Properties="_testAssembly=$(HDInsightTestDebug);_testSettings=$(TestSettings);_testFilter=$(TestFilter);_testResult=$(TestOutputDirectory)\HDInsightDebug.trx"
Projects="build.proj"/>
</Target>
<Target Name="TestStorage">
<MSBuild Targets="InvokeMSTest"
Properties="_testAssembly=$(StorageTestDebug);_testSettings=$(TestSettings);_testFilter=$(TestFilter);_testResult=$(TestOutputDirectory)\StorageDebug.trx"
Projects="build.proj"/>
</Target>
<!-- Run the scenario tests -->
<Target Name="ScenarioTest" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
<Message Importance="high" Text="Running scenario tests..." />
<MSBuild Targets="InvokeMSTest"
Properties="_testAssembly=$(ScenarioTestDebug);_testSettings=$(TestSettings);_testFilter=$(ScenarioTestFilter);_testResult=$(TestOutputDirectory)\ScenarioTestDebug.trx"
Projects="build.proj"/>
<MSBuild Targets="InvokeMSTest"
Properties="_testAssembly=$(StorageScenarioTestDebug);_testSettings=$(TestSettings);_testFilter=$(ScenarioTestFilter);_testResult=$(TestOutputDirectory)\StorageScenarioTestDebug.trx"
Projects="build.proj"/>
</Target>
<!-- Run the common tests -->
<Target Name="CommonTests">
<Message Importance="high" Text="Running Common tests" />
<Xunit.Runner.MSBuild.xunit Assembly="$(CommonTestDebug)" Html="$(TestOutputDirectory)\CommonTests.xunit.dll.html" Verbose="true"/>
</Target>
<!-- Run the sql tests -->
<Target Name="SqlTests">
<Message Importance="high" Text="Running Sql tests" />
<Xunit.Runner.MSBuild.xunit Assembly="$(SqlTestDebug)" Html="$(TestOutputDirectory)\SqlTests.xunit.dll.html" Verbose="true"/>
</Target>
<!-- Run the scenario tests with Mocks -->
<Target Name="MockedScenarioTests">
<Message Importance="high" Text="Running scenario tests with Mocks" />
<Xunit.Runner.MSBuild.xunit Assembly="$(ScenarioTestDebug)" Html="$(TestOutputDirectory)\MockedScenarioTests.xunit.dll.html" Verbose="true"/>
</Target>
<!-- Run the MediaService Scenario Tests -->
<Target Name="RunMediaServiceBVTs" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
<Message Importance="high" Text="Running Media Service Scenario tests:" />
<Delete Files="$(TestOutputDirectory)\RunMediaServiceBVTDebug.trx" />
<Exec
Command="MSTest.exe /testcontainer:$(ScenarioTestDebug) /testsettings:$(TestSettings) /category:$(MediaServiceBVTFilter) /resultsfile:$(TestOutputDirectory)\RunMediaServiceBVTDebug.trx"
ContinueOnError="false" EnvironmentVariables="AZURE_TEST_MODE=None" />
</Target>
<!-- Run the CloudService Scenario Tests -->
<Target Name="RunCloudServiceBVTs" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
<Message Importance="high" Text="Running Cloud Service Scenario tests:" />
<Delete Files="$(TestOutputDirectory)\RunCloudServiceBVTDebug.trx" />
<Exec
Command="MSTest.exe /testcontainer:$(ScenarioTestDebug) /testsettings:$(TestSettings) /category:$(CloudServiceBVTFilter) /resultsfile:$(TestOutputDirectory)\RunCloudServiceBVTDebug.trx"
ContinueOnError="false" />
</Target>
<!-- Run the Storage Scenario Tests -->
<Target Name="RunStorageBVTs" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
<Message Importance="high" Text="Running Storage Scenario tests:" />
<Delete Files="$(TestOutputDirectory)\RunStorageBVTDebug.trx" />
<Exec
Command="MSTest.exe /testcontainer:$(ScenarioTestDebug) /testsettings:$(TestSettings) /category:$(StorageBVTFilter) /resultsfile:$(TestOutputDirectory)\RunStorageBVTDebug.trx"
ContinueOnError="false" />
</Target>
<!-- Run the Management Scenario Tests -->
<Target Name="RunManagementBVTs" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
<Message Importance="high" Text="Running Management Scenario tests:" />
<Delete Files="$(TestOutputDirectory)\RunManagementBVTDebug.trx" />
<Exec
Command="MSTest.exe /testcontainer:$(ScenarioTestDebug) /testsettings:$(TestSettings) /category:$(ManagementBVTFilter) /resultsfile:$(TestOutputDirectory)\RunManagementBVTDebug.trx"
ContinueOnError="false" />
</Target>
<!-- Run the Managed Cache Scenario Tests -->
<Target Name="RunManagedCacheBVTs" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
<Message Importance="high" Text="Running Managed Cache Service BVTs..." />
<Delete Files="$(TestOutputDirectory)\RunManagedCacheBVTDebug.trx" />
<Exec
Command="MSTest.exe /testcontainer:$(ScenarioTestDebug) /testsettings:$(TestSettings) /category:$(ManagedCacheBVTFilter) /resultsfile:$(TestOutputDirectory)\RunManagedCacheBVTDebug.trx"
ContinueOnError="false" EnvironmentVariables="AZURE_TEST_MODE=None" />
</Target>
<!-- Run the Website Scenario Tests -->
<Target Name="RunWebsiteBVTs" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
<Message Importance="high" Text="Running Website BVTs..." />
<Delete Files="$(TestOutputDirectory)\RunWebsiteBVTDebug.trx" />
<Exec
Command="MSTest.exe /testcontainer:$(ScenarioTestDebug) /testsettings:$(TestSettings) /category:$(WebsiteBVTFilter) /resultsfile:$(TestOutputDirectory)\RunWebsiteBVTDebug.trx"
ContinueOnError="false" EnvironmentVariables="AZURE_TEST_MODE=None"/>
</Target>
<!-- Run the ServiceBus Scenario Tests -->
<Target Name="RunServiceBusBVTs" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
<Message Importance="high" Text="Running Service Bus Scenario tests:" />
<Delete Files="$(TestOutputDirectory)\RunServiceBusBVTDebug.trx" />
<Exec
Command="MSTest.exe /testcontainer:$(ScenarioTestDebug) /testsettings:$(TestSettings) /category:$(ServiceBusBVTFilter) /resultsfile:$(TestOutputDirectory)\RunServiceBusBVTDebug.trx"
ContinueOnError="false" />
</Target>
<Target Name="RunOneSDKCIT" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
<Message Importance="high" Text="Running CIT Scenario tests..." />
<Delete Files="$(TestOutputDirectory)\RunOneSDKCITDebug.trx" />
<Exec
Command="MSTest.exe /testcontainer:$(ScenarioTestDebug) /testsettings:$(TestSettings) /category:$(OneSDKCITFilter) /resultsfile:$(TestOutputDirectory)\RunOneSDKCITDebug.trx"
ContinueOnError="false" />
</Target>
<!-- Run the AzureRT tests -->
<Target Name="AzureRTBVTs" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
<Message Importance="high" Text="Running AzureRT BVT tests..." />
<Delete Files="$(TestOutputDirectory)\RTBVTDebug.trx" />
<Exec
Command="MSTest.exe /testcontainer:$(AzureRTTestContainer) /testsettings:$(AzureRTTestSettings) /category:BVT /resultsfile:$(TestOutputDirectory)\RTBVTDebug.trx"
ContinueOnError="false" />
</Target>
<Target Name="AzureRTBVTsSeq" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
<Message Importance="high" Text="Running AzureRT BVT tests..." />
<Delete Files="$(TestOutputDirectory)\RTBVTDebug.trx" />
<Exec
Command="MSTest.exe /testcontainer:$(AzureRTTestContainer) /testsettings:$(TestSettings) /category:BVT /resultsfile:$(TestOutputDirectory)\RTBVTDebug.trx"
ContinueOnError="false" />
</Target>
<Target Name="AzureRTOne" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
<Message Importance="high" Text="Running a specific tests..." />
<Delete Files="$(TestOutputDirectory)\RTFunctionalDebug.trx" />
<Exec
Command="MSTest.exe /testcontainer:$(AzureRTTestContainer) /testsettings:$(TestSettings) /test:$(TestName) /resultsfile:$(TestOutputDirectory)\RTFunctionalDebug.trx"
ContinueOnError="false" />
</Target>
<Target Name="AzureRTMulti" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
<Message Importance="high" Text="Running tests:" />
<Delete Files="$(TestOutputDirectory)\RTFunctionalDebug.trx" />
<Exec
Command="MSTest.exe /testcontainer:$(AzureRTTestContainer) /testsettings:$(TestSettings) $(TestParams) /resultsfile:$(TestOutputDirectory)\RTFunctionalDebug.trx"
ContinueOnError="false" />
</Target>
<Target Name="AzureRTAll" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
<Message Importance="high" Text="Running AzureRT all tests..." />
<Delete Files="$(TestOutputDirectory)\RTDebug.trx" />
<Exec
Command="MSTest.exe /testcontainer:$(AzureRTTestContainer) /testsettings:$(TestSettings) /category:$(AzureRTAllTestFilter3) /resultsfile:$(TestOutputDirectory)\RTDebug.trx"
ContinueOnError="false" />
</Target>
<Target Name="AzureRTAllFast" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
<Message Importance="high" Text="Running AzureRT all tests..." />
<Delete Files="$(TestOutputDirectory)\RTSequentialDebug.trx" />
<Delete Files="$(TestOutputDirectory)\RTDebug.trx" />
<Exec
Command="MSTest.exe /testcontainer:$(AzureRTTestContainer) /testsettings:$(TestSettings) /category:Sequential /resultsfile:$(TestOutputDirectory)\RTSequentialDebug.trx"
ContinueOnError="true" />
<Exec
Command="MSTest.exe /testcontainer:$(AzureRTTestContainer) /testsettings:$(AzureRTTestSettings) /category:$(AzureRTAllTestFilter) /resultsfile:$(TestOutputDirectory)\RTDebug.trx"
ContinueOnError="false" />
</Target>
<Target Name="AzureRTSeq" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
<Message Importance="high" Text="Running AzureRT all tests..." />
<Delete Files="$(TestOutputDirectory)\RTSequentialDebug.trx" />
<Delete Files="$(TestOutputDirectory)\RTDebug.trx" />
<Exec
Command="MSTest.exe /testcontainer:$(AzureRTTestContainer) /testsettings:$(TestSettings) /category:Sequential /resultsfile:$(TestOutputDirectory)\RTSequentialDebug.trx"
ContinueOnError="true" />
</Target>
<Target Name="AzureRTPar" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
<Message Importance="high" Text="Running AzureRT all tests..." />
<Delete Files="$(TestOutputDirectory)\RTSequentialDebug.trx" />
<Delete Files="$(TestOutputDirectory)\RTDebug.trx" />
<Exec
Command="MSTest.exe /testcontainer:$(AzureRTTestContainer) /testsettings:$(AzureRTTestSettings) /category:$(AzureRTAllTestFilter) /resultsfile:$(TestOutputDirectory)\RTDebug.trx"
ContinueOnError="false" />
</Target>
<Target Name="AzureRTAllPreview" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
<Message Importance="high" Text="Running AzureRT all tests..." />
<Delete Files="$(TestOutputDirectory)\RTAddVhdDebug.trx" />
<Delete Files="$(TestOutputDirectory)\RTDebug.trx" />
<Exec
Command="MSTest.exe /testcontainer:$(AzureRTTestContainer) /testsettings:$(TestSettings) /category:Sequential /resultsfile:$(TestOutputDirectory)\RTAddVhdDebug.trx"
ContinueOnError="true" />
<Exec
Command="MSTest.exe /testcontainer:$(AzureRTTestContainer) /testsettings:$(AzureRTTestSettings) /category:$(AzureRTAllTestFilter2) /resultsfile:$(TestOutputDirectory)\RTDebug.trx"
ContinueOnError="false" />
</Target>
<Target Name="AzureRTPreview" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
<Message Importance="high" Text="Running AzureRT all tests..." />
<Delete Files="$(TestOutputDirectory)\RTPreviewDebug.trx" />
<Exec
Command="MSTest.exe /testcontainer:$(AzureRTTestContainer) /testsettings:$(AzureRTTestSettings) /category:Preview /resultsfile:$(TestOutputDirectory)\RTPreviewDebug.trx"
ContinueOnError="false" />
</Target>
<!-- DSC extension related targets -->
<Target Name="TestDSCExtension_x64">
<Message Importance="high" Text="Running DSC extension BVT x64 tests..." />
<Delete Files="$(TestOutputDirectory)\DSCExtensionDebug_x64.trx" />
<Exec
Command="MSTest.exe /testcontainer:$(ServiceManagementExtensionsTestDebug) /testsettings:$(TestSettings_x64) /category:x64_only /resultsfile:$(TestOutputDirectory)\DSCExtensionDebug_x64.trx"
ContinueOnError="false" />
</Target>
</Project>