|
10 | 10 | <!-- SourceLink variable--> |
11 | 11 | <DisableSourceLink>false</DisableSourceLink> |
12 | 12 |
|
13 | | - <!-- Use the NuGet.config with a local source for Package reference builds. --> |
14 | | - <NuGetConfigFile>$(RepoRoot)/NuGet.config</NuGetConfigFile> |
15 | | - <NuGetConfigFile Condition="'$(ReferenceType)' == 'Package'">$(NuGetConfigFile).local</NuGetConfigFile> |
16 | | - |
17 | 13 | <Configuration Condition="'$(Configuration)' == ''">Debug</Configuration> |
18 | 14 | <Platform Condition="'$(Platform)' == ''">AnyCPU</Platform> |
19 | 15 | <!-- Flag to control whether or not to build Microsoft.DotNet.GenAPI project in tools --> |
|
32 | 28 | <TargetNetFxVersion Condition="$(TargetGroup) == 'netfx' AND $(TargetNetFxVersion) == ''">$(TF)</TargetNetFxVersion> |
33 | 29 | <GenerateNuget Condition="'$(GenerateNuget)' == '' AND '$(IsEnabledWindows)' == 'true'">true</GenerateNuget> |
34 | 30 |
|
35 | | - <CommonProperties>Configuration=$(Configuration);ReferenceType=$(ReferenceType);RestoreConfigFile=$(NuGetConfigFile)</CommonProperties> |
| 31 | + <CommonProperties>Configuration=$(Configuration);ReferenceType=$(ReferenceType);</CommonProperties> |
36 | 32 | <SqlServerLibProperties>$(CommonProperties);AssemblyVersion=$(SqlServerAssemblyVersion);AssemblyFileVersion=$(SqlServerAssemblyFileVersion);Version=$(SqlServerPackageVersion);</SqlServerLibProperties> |
37 | 33 | <ProjectProperties>$(CommonProperties);AssemblyFileVersion=$(AssemblyFileVersion);TargetsWindows=$(TargetsWindows);TargetsUnix=$(TargetsUnix);</ProjectProperties> |
38 | 34 | <TestProjectProperties>$(ProjectProperties);BuildForRelease=false;TargetNetCoreVersion=$(TargetNetCoreVersion);TargetNetFxVersion=$(TargetNetFxVersion)</TestProjectProperties> |
|
52 | 48 |
|
53 | 49 | <!-- Test configuration properties --> |
54 | 50 | <PropertyGroup> |
55 | | - <FilterStatement>$(Filter)</FilterStatement> |
56 | | - <FilterStatement Condition="'$(FilterStatement)' == ''">category!=failing&category!=flaky</FilterStatement> |
57 | | - <!--Collect code coverage unless explicitly disabled--> |
58 | | - <CollectCodeCoverage Condition="'$(CollectCodeCoverage)' == ''">true</CollectCodeCoverage> |
59 | | - <CollectStatement Condition="'$(CollectCodeCoverage)' == 'true'">--collect "Code coverage"</CollectStatement> |
| 51 | + <!-- Set up default filters for tests to exclude failing and flaky tests --> |
| 52 | + <Filter Condition="'$(Filter)' == ''">category!=failing&category!=flaky</Filter> |
| 53 | + <FilterArgument>--filter "$(Filter)"</FilterArgument> |
| 54 | + |
| 55 | + <!-- Collect code coverage unless explicitly disabled --> |
| 56 | + <CollectCodeCoverage Condition="'$(CollectCodeCoverage)' == ''">true</CollectCodeCoverage> |
| 57 | + <CollectArgument Condition="'$(CollectCodeCoverage)' == 'true'">--collect "Code coverage"</CollectArgument> |
| 58 | + |
| 59 | + <!-- Set up tests to fail after hangs and report via blame --> |
| 60 | + <BlameArgument>$(Blame)</BlameArgument> |
| 61 | + <BlameArgument Condition="'$(BlameArgument)' == ''"> |
| 62 | + --blame-hang |
| 63 | + --blame-hang-dump-type full |
| 64 | + --blame-hang-timeout 10m |
| 65 | + </BlameArgument> |
60 | 66 | </PropertyGroup> |
61 | 67 |
|
62 | 68 | <!-- Release Build properties must be turned on for Release purposes, and turned off for Code Coverage calculations --> |
|
83 | 89 | <FunctionalTests Include="**/FunctionalTests/Microsoft.Data.SqlClient.FunctionalTests.csproj" /> |
84 | 90 | <FunctionalTestsProj Include="**/FunctionalTests/Microsoft.Data.SqlClient.FunctionalTests.csproj" /> |
85 | 91 |
|
86 | | - <ManualTests Include="**/Common/Common.csproj" /> |
87 | | - <ManualTests Include="**/ManualTests/SQL/UdtTest/UDTs/Address/Address.csproj" /> |
88 | | - <ManualTests Include="**/ManualTests/SQL/UdtTest/UDTs/Circle/Circle.csproj" /> |
89 | | - <ManualTests Include="**/ManualTests/SQL/UdtTest/UDTs/Shapes/Shapes.csproj" /> |
90 | | - <ManualTests Include="**/ManualTests/SQL/UdtTest/UDTs/Utf8String/Utf8String.csproj" /> |
91 | | - <ManualTests Include="**/tools/Microsoft.Data.SqlClient.TestUtilities/Microsoft.Data.SqlClient.TestUtilities.csproj" /> |
92 | | - <ManualTests Include="**/tools/CoreFx.Private.TestUtilities/CoreFx.Private.TestUtilities.csproj" /> |
93 | | - <ManualTests Include="**/tools/TDS/TDS/TDS.csproj" /> |
94 | | - <ManualTests Include="**/tools/TDS/TDS.EndPoint/TDS.EndPoint.csproj" /> |
95 | | - <ManualTests Include="**/tools/TDS/TDS.Servers/TDS.Servers.csproj" /> |
96 | | - <ManualTests Include="**/CustomConfigurableRetryLogic/CustomRetryLogicProvider.csproj" /> |
97 | 92 | <ManualTests Include="**/ManualTests/Microsoft.Data.SqlClient.ManualTests.csproj" /> |
98 | 93 | <ManualTestsProj Include="**/ManualTests/Microsoft.Data.SqlClient.ManualTests.csproj" /> |
99 | 94 | </ItemGroup> |
|
104 | 99 | <Target Name="BuildAllConfigurations" DependsOnTargets="Restore;BuildTools;BuildSqlServerLib;BuildNetFx;BuildNetCoreAllOS;BuildNetStandard;GenerateMdsPackage" /> |
105 | 100 | <Target Name="BuildSqlServerPackage" DependsOnTargets="BuildSqlServerLibAnyOS;GenerateSqlServerPackage"/> |
106 | 101 |
|
107 | | - <!-- @TODO: Manual tests have a reference to AKV provider, and AKV provider is not built on non-windows pipeline runs. Thus it is added to the dependencies of the build tests target. This is not good since it means AKV is built twice on windows and once on unix, in a mix of implicit and explicit. The pipeline should be modified to build it in both cases, or the build should be updated to have dotnet build the test projects. --> |
108 | | - <Target Name="BuildTestsNetCore" DependsOnTargets="RestoreTestsNetCore;BuildAKVNetCore;BuildManualTestsNetCore"/> |
109 | | - <Target Name="BuildTestsNetFx" DependsOnTargets="RestoreTestsNetFx;BuildAKVNetFx;BuildManualTestsNetFx" Condition="$(IsEnabledWindows) == 'true'"/> |
110 | | - |
111 | 102 | <!-- Abstractions Targets --> |
112 | 103 | <PropertyGroup> |
113 | 104 | <AbstractionsProperties>$(CommonProperties)</AbstractionsProperties> |
|
202 | 193 | <MSBuild Projects="@(NetCoreDriver)" Targets="restore" Properties="$(ProjectProperties)" /> |
203 | 194 | </Target> |
204 | 195 |
|
205 | | - <Target Name="RestoreTestsNetCore" DependsOnTargets="RestoreNetCore"> |
206 | | - <MSBuild Projects="@(ManualTests)" Targets="restore" Properties="$(TestProjectProperties)" /> |
207 | | - </Target> |
208 | | - |
209 | 196 | <Target Name="RestoreNetFx" DependsOnTargets="RestoreSqlServerLib;RestoreAbstractions" Condition="'$(IsEnabledWindows)' == 'true'"> |
210 | 197 | <MSBuild Projects="@(NetFxDriver)" Targets="restore" Properties="$(ProjectProperties)" /> |
211 | 198 | </Target> |
212 | 199 |
|
213 | | - <Target Name="RestoreTestsNetFx" DependsOnTargets="RestoreNetFx" Condition="'$(IsEnabledWindows)' == 'true'"> |
214 | | - <MSBuild Projects="@(ManualTests)" Targets="restore" Properties="$(TestProjectProperties)" /> |
215 | | - </Target> |
216 | | - |
217 | 200 | <Target Name="RestoreTools" Condition="'$(BuildTools)' == 'true'"> |
218 | 201 | <MSBuild Projects="@(Tools)" Targets="restore" Properties="$(CommonProperties)" /> |
219 | 202 | </Target> |
|
259 | 242 | <MSBuild Projects="@(NetStandardDriver)" Properties="$(CI);$(ProjectProperties);Platform=AnyCPU;OSGroup=AnyOS;BuildForLib=True" RemoveProperties="TargetsWindows;TargetsUnix;" /> |
260 | 243 | </Target> |
261 | 244 |
|
262 | | - <Target Name="BuildManualTestsNetCore" DependsOnTargets="RestoreTestsNetCore"> |
263 | | - <Message Text=">>> Building ManualTestsNetCore [TestTargetOS=$(TestOS)netcoreapp;$(TestProjectProperties);Platform=AnyCPU;ReferenceType=$(ReferenceType);] ..." Condition="!$(ReferenceType.Contains('Package'))" /> |
264 | | - <MSBuild Projects="@(ManualTests)" Properties="TestTargetOS=$(TestOS)netcoreapp;$(TestProjectProperties);Platform=AnyCPU;" Condition="!$(ReferenceType.Contains('Package'))" /> |
265 | | - |
266 | | - <!-- Only build platform specific builds for Package reference types --> |
267 | | - <Message Text=">>> Building ManualTestsNetCore [TestTargetOS=$(TestOS)netcoreapp;$(TestProjectProperties);Platform=$(Platform)] ..." Condition="$(ReferenceType.Contains('Package'))" /> |
268 | | - <MSBuild Projects="@(ManualTests)" Properties="TestTargetOS=$(TestOS)netcoreapp;$(TestProjectProperties);Platform=$(Platform);" Condition="$(ReferenceType.Contains('Package'))" /> |
269 | | - </Target> |
270 | | - |
271 | | - <Target Name="BuildManualTestsNetFx" DependsOnTargets="RestoreTestsNetFx" Condition="'$(IsEnabledWindows)' == 'true'"> |
272 | | - <Message Text=">>> Building ManualTestsNetFx [TestTargetOS=$(TestOS)netfx;$(TestProjectProperties);Platform=AnyCPU;] ..." Condition="!$(ReferenceType.Contains('Package'))" /> |
273 | | - <MSBuild Projects="@(ManualTests)" Properties="TestTargetOS=$(TestOS)netfx;$(TestProjectProperties);Platform=AnyCPU;" Condition="!$(ReferenceType.Contains('Package'))" /> |
274 | | - |
275 | | - <!-- Only build platform specific builds for Package reference types --> |
276 | | - <Message Text=">>> Building ManualTestsNetFx [TestTargetOS=$(TestOS)netfx;$(TestProjectProperties);Platform=$(Platform);] ..." Condition="$(ReferenceType.Contains('Package'))" /> |
277 | | - <MSBuild Projects="@(ManualTests)" Properties="TestTargetOS=$(TestOS)netfx;$(TestProjectProperties);Platform=$(Platform);" Condition="$(ReferenceType.Contains('Package'))" /> |
278 | | - </Target> |
279 | | - |
280 | 245 | <!-- Tests --> |
281 | 246 |
|
282 | 247 | <!-- Run all tests applicable to the host OS. --> |
|
296 | 261 | $(DotnetPath)dotnet test "@(UnitTestsProj)" |
297 | 262 | -f $(TF) |
298 | 263 | -p:Configuration=$(Configuration) |
299 | | - $(CollectStatement) |
| 264 | + $(FilterArgument) |
| 265 | + $(BlameArgument) |
| 266 | + $(CollectArgument) |
300 | 267 | --results-directory $(ResultsDirectory) |
301 | | - --filter "$(FilterStatement)" |
302 | 268 | --logger:"trx;LogFilePrefix=Unit-Windows$(TargetGroup)-$(TestSet)" |
303 | | - --blame-hang |
304 | | - --blame-hang-dump-type full |
305 | | - --blame-hang-timeout 10m |
306 | 269 | </TestCommand> |
307 | 270 | <!-- Convert more than one whitespace character into one space --> |
308 | 271 | <TestCommand>$([System.Text.RegularExpressions.Regex]::Replace($(TestCommand), "\s+", " "))</TestCommand> |
|
318 | 281 | $(DotnetPath)dotnet test "@(UnitTestsProj)" |
319 | 282 | -f $(TF) |
320 | 283 | -p:Configuration=$(Configuration) |
321 | | - $(CollectStatement) |
| 284 | + $(FilterArgument) |
| 285 | + $(BlameArgument) |
| 286 | + $(CollectArgument) |
322 | 287 | --results-directory $(ResultsDirectory) |
323 | | - --filter "$(FilterStatement)" |
324 | 288 | --logger:"trx;LogFilePrefix=Unit-Unixnetcoreapp-$(TestSet)" |
325 | | - --blame-hang |
326 | | - --blame-hang-dump-type full |
327 | | - --blame-hang-timeout 10m |
328 | 289 | </TestCommand> |
329 | 290 | <!-- Convert more than one whitespace character into one space --> |
330 | 291 | <TestCommand>$([System.Text.RegularExpressions.Regex]::Replace($(TestCommand), "\s+", " "))</TestCommand> |
|
346 | 307 | -p:ReferenceType=$(ReferenceType) |
347 | 308 | -p:AbstractionsPackageVersion=$(AbstractionsPackageVersion) |
348 | 309 | -p:MdsPackageVersion=$(MdsPackageVersion) |
349 | | - $(CollectStatement) |
| 310 | + $(FilterArgument) |
| 311 | + $(BlameArgument) |
| 312 | + $(CollectArgument) |
350 | 313 | --results-directory $(ResultsDirectory) |
351 | | - --filter "$(FilterStatement)" |
352 | 314 | --logger:"trx;LogFilePrefix=Functional-Windows$(TargetGroup)-$(TestSet)" |
353 | | - --blame-hang |
354 | | - --blame-hang-dump-type full |
355 | | - --blame-hang-timeout 10m |
356 | 315 | </TestCommand> |
357 | 316 | <!-- Convert more than one whitespace character into one space --> |
358 | 317 | <TestCommand>$([System.Text.RegularExpressions.Regex]::Replace($(TestCommand), "\s+", " "))</TestCommand> |
|
371 | 330 | -p:ReferenceType=$(ReferenceType) |
372 | 331 | -p:AbstractionsPackageVersion=$(AbstractionsPackageVersion) |
373 | 332 | -p:MdsPackageVersion=$(MdsPackageVersion) |
374 | | - $(CollectStatement) |
| 333 | + $(FilterArgument) |
| 334 | + $(BlameArgument) |
| 335 | + $(CollectArgument) |
375 | 336 | --results-directory $(ResultsDirectory) |
376 | | - --filter "$(FilterStatement)" |
377 | 337 | --logger:"trx;LogFilePrefix=Functional-Unixnetcoreapp-$(TestSet)" |
378 | | - --blame-hang |
379 | | - --blame-hang-dump-type full |
380 | | - --blame-hang-timeout 10m |
381 | 338 | </TestCommand> |
382 | 339 | <!-- Convert more than one whitespace character into one space --> |
383 | 340 | <TestCommand>$([System.Text.RegularExpressions.Regex]::Replace($(TestCommand), "\s+", " "))</TestCommand> |
|
394 | 351 | <PropertyGroup> |
395 | 352 | <TestCommand> |
396 | 353 | $(DotnetPath)dotnet test "@(ManualTestsProj)" |
397 | | - --no-build |
398 | | - -v n |
| 354 | + -f $(TF) |
399 | 355 | -p:Configuration=$(Configuration) |
400 | | - -p:Target$(TFGroup)Version=$(TF) |
401 | 356 | -p:ReferenceType=$(ReferenceType) |
402 | | - -p:TestSet=$(TestSet) |
403 | | - -p:TestTargetOS=Windows$(TargetGroup) |
404 | 357 | -p:AbstractionsPackageVersion=$(AbstractionsPackageVersion) |
405 | 358 | -p:MdsPackageVersion=$(MdsPackageVersion) |
406 | | - $(CollectStatement) |
| 359 | + $(FilterArgument) |
| 360 | + $(BlameArgument) |
| 361 | + $(CollectArgument) |
407 | 362 | --results-directory $(ResultsDirectory) |
408 | | - --filter "$(FilterStatement)" |
409 | 363 | --logger:"trx;LogFilePrefix=Manual-Windows$(TargetGroup)-$(TestSet)" |
410 | | - --blame-hang |
411 | | - --blame-hang-dump-type full |
412 | | - --blame-hang-timeout 10m |
413 | 364 | </TestCommand> |
414 | | - <TestCommand>$(TestCommand.Replace($([System.Environment]::NewLine), " "))</TestCommand> |
| 365 | + <!-- Add test set only if it was provided - otherwise it will be permanently set to '' --> |
| 366 | + <TestCommand Condition="'$(TestSet)' != ''"> |
| 367 | + $(TestCommand) |
| 368 | + -p:TestSet=$(TestSet) |
| 369 | + </TestCommand> |
| 370 | + |
| 371 | + <!-- Convert more than one whitespace character into one space --> |
| 372 | + <TestCommand>$([System.Text.RegularExpressions.Regex]::Replace($(TestCommand), "\s+", " "))</TestCommand> |
415 | 373 | </PropertyGroup> |
416 | 374 | <Message Text=">>> Running Manual test for Windows via command: $(TestCommand)" /> |
417 | 375 | <Exec ConsoleToMsBuild="true" Command="$(TestCommand)" /> |
|
422 | 380 | <PropertyGroup> |
423 | 381 | <TestCommand> |
424 | 382 | $(DotnetPath)dotnet test "@(ManualTestsProj)" |
425 | | - --no-build |
426 | | - -v n |
| 383 | + -f $(TF) |
427 | 384 | -p:Configuration=$(Configuration) |
428 | | - -p:TargetNetCoreVersion=$(TF) |
429 | 385 | -p:ReferenceType=$(ReferenceType) |
430 | | - -p:TestSet=$(TestSet) |
431 | | - -p:TestTargetOS=Unixnetcoreapp |
432 | 386 | -p:AbstractionsPackageVersion=$(AbstractionsPackageVersion) |
433 | 387 | -p:MdsPackageVersion=$(MdsPackageVersion) |
434 | | - $(CollectStatement) |
| 388 | + $(FilterArgument) |
| 389 | + $(BlameArgument) |
| 390 | + $(CollectArgument) |
435 | 391 | --results-directory $(ResultsDirectory) |
436 | | - --filter "$(FilterStatement)" |
437 | 392 | --logger:"trx;LogFilePrefix=Manual-Unixnetcoreapp-$(TestSet)" |
438 | | - --blame-hang |
439 | | - --blame-hang-dump-type full |
440 | | - --blame-hang-timeout 10m |
441 | 393 | </TestCommand> |
442 | | - <TestCommand>$(TestCommand.Replace($([System.Environment]::NewLine), " "))</TestCommand> |
| 394 | + |
| 395 | + <!-- Add test set only if it was provided - otherwise it will be permanently set to '' --> |
| 396 | + <TestCommand Condition="'$(TestSet)' != ''"> |
| 397 | + $(TestCommand) |
| 398 | + -p:TestSet=$(TestSet) |
| 399 | + </TestCommand> |
| 400 | + |
| 401 | + <!-- Convert more than one whitespace character into one space --> |
| 402 | + <TestCommand>$([System.Text.RegularExpressions.Regex]::Replace($(TestCommand), "\s+", " "))</TestCommand> |
443 | 403 | </PropertyGroup> |
444 | 404 | <Message Text=">>> Running Manual test for Unix via command: $(TestCommand)" /> |
445 | 405 | <Exec ConsoleToMsBuild="true" Command="$(TestCommand)" /> |
|
0 commit comments