Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ jobs:
- name: Run manual build steps
if: matrix.build-mode == 'manual'
shell: bash
run: dotnet build src/Microsoft.Data.SqlClient.slnx
run: dotnet build build.proj -t:BuildAll
Comment thread
paulmedynski marked this conversation as resolved.

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v4
Expand Down
133 changes: 126 additions & 7 deletions build.proj
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- Imports ========================================================= -->
<Import Project="src/Directory.Build.props" />

Expand Down Expand Up @@ -329,11 +329,14 @@
<!-- Top Level/Miscellaneous Targets -->

<!--
Build: Builds all packages
Build: Builds all driver projects. This is the default target.
Note: These have been ordered in a vague attempt to minimize multiple rebuilds of dependencies.
-->
<Target Name="Build" DependsOnTargets="BuildLogging;BuildAbstractions;BuildSqlClient;BuildAzure;BuildAkvProvider;BuildSqlServer" />

<!-- Build all projects in the repo, for all supported OS and TargetFramework combinations.-->
<Target Name="BuildAll" DependsOnTargets="Build;BuildTests;BuildSamples;BuildTools" />
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devs can use this with local changes to be pretty confident they didn't break compilation, regardless of their host OS.

Comment thread
paulmedynski marked this conversation as resolved.
Outdated

Comment thread
paulmedynski marked this conversation as resolved.
<!-- Clean: Convenience target to remove build/test output -->
<Target Name="Clean">
<!-- Remove known build output paths -->
Expand All @@ -346,16 +349,18 @@
</Target>

<!--
Pack: Packages all packages
Pack: Packages all driver projects.
Note: These have been ordered in a vague attempt to minimize multiple rebuilds of dependencies.
-->
<Target Name="Pack" DependsOnTargets="PackLogging;PackAbstractions;PackSqlClient;PackAzure;PackAkvProvider;PackSqlServer" />

<!--
Test: Run all test targets for all packages.
Note: This will run for a *very* long time and it is not recommended, even in automated test
environments. Please consider running project specific test targets or specific test sets
within the project.
Test: Run all test targets for all driver projects.

Note: This requires local and remote SQL Server setups with corresponding JSON configuration
files. It will run for a *very* long time and it is not recommended, even in automated test
environments. Please consider running project specific test targets or specific test sets within
the project.
-->
<Target Name="Test" DependsOnTargets="TestAbstractions;TestAzure;TestSqlClient" />

Expand Down Expand Up @@ -618,7 +623,7 @@
<DotnetCommand>$([System.Text.RegularExpressions.Regex]::Replace($(DotnetCommand), "\s+", " "))</DotnetCommand>
</PropertyGroup>
<Message Text=">>> Running manual tests for SqlClient via command: $(DotnetCommand)" />
<Exec ConsoleToMsBuild="true" Command="$(DotnetCommand)" />

Check failure on line 626 in build.proj

View check run for this annotation

Azure Pipelines / PR-SqlClient-Project (Ubuntu22_Sql22 net8_0_AnyCPU_ManagedSNI_2)

build.proj#L626

build.proj(626,5): Error MSB3073: The command " "dotnet" test "/mnt/vss/_work/1/s/src/../src/Microsoft.Data.SqlClient/tests/ManualTests/Microsoft.Data.SqlClient.ManualTests.csproj" -p:Configuration=Debug --blame-hang --blame-hang-dump-type full --blame-hang-timeout 10m --filter "category=flaky" -f net8.0 -p:TestSet="2" --results-directory "TestResults" --logger:"trx;LogFilePrefix=SqlClientManual-Unix-net8.0-2" -p:AbstractionsPackageVersion=1.0.0-ci13406 -p:LoggingPackageVersion=1.0.0-ci13406 -p:SqlClientPackageVersion=7.1.0-preview1ci13406 " exited with code 1.

Check failure on line 626 in build.proj

View check run for this annotation

Azure Pipelines / PR-SqlClient-Project (Ubuntu22_Sql22 net9_0_AnyCPU_ManagedSNI_3)

build.proj#L626

build.proj(626,5): Error MSB3073: The command " "dotnet" test "/mnt/vss/_work/1/s/src/../src/Microsoft.Data.SqlClient/tests/ManualTests/Microsoft.Data.SqlClient.ManualTests.csproj" -p:Configuration=Debug --blame-hang --blame-hang-dump-type full --blame-hang-timeout 10m --filter "category=flaky" -f net9.0 -p:TestSet="3" --results-directory "TestResults" --logger:"trx;LogFilePrefix=SqlClientManual-Unix-net9.0-3" -p:AbstractionsPackageVersion=1.0.0-ci13406 -p:LoggingPackageVersion=1.0.0-ci13406 -p:SqlClientPackageVersion=7.1.0-preview1ci13406 " exited with code 1.

Check failure on line 626 in build.proj

View check run for this annotation

Azure Pipelines / PR-SqlClient-Project (Ubuntu22_Sql22 net8_0_AnyCPU_ManagedSNI_3)

build.proj#L626

build.proj(626,5): Error MSB3073: The command " "dotnet" test "/mnt/vss/_work/1/s/src/../src/Microsoft.Data.SqlClient/tests/ManualTests/Microsoft.Data.SqlClient.ManualTests.csproj" -p:Configuration=Debug --blame-hang --blame-hang-dump-type full --blame-hang-timeout 10m --filter "category=flaky" -f net8.0 -p:TestSet="3" --results-directory "TestResults" --logger:"trx;LogFilePrefix=SqlClientManual-Unix-net8.0-3" -p:AbstractionsPackageVersion=1.0.0-ci13406 -p:LoggingPackageVersion=1.0.0-ci13406 -p:SqlClientPackageVersion=7.1.0-preview1ci13406 " exited with code 1.

Check failure on line 626 in build.proj

View check run for this annotation

Azure Pipelines / PR-SqlClient-Project (Ubuntu22_Azure_Sql net9_0_AnyCPU_ManagedSNI_3)

build.proj#L626

build.proj(626,5): Error MSB3073: The command " "dotnet" test "/mnt/vss/_work/1/s/src/../src/Microsoft.Data.SqlClient/tests/ManualTests/Microsoft.Data.SqlClient.ManualTests.csproj" -p:Configuration=Debug --blame-hang --blame-hang-dump-type full --blame-hang-timeout 10m --filter "category=flaky" -f net9.0 -p:TestSet="3" --results-directory "TestResults" --logger:"trx;LogFilePrefix=SqlClientManual-Unix-net9.0-3" -p:AbstractionsPackageVersion=1.0.0-ci13406 -p:LoggingPackageVersion=1.0.0-ci13406 -p:SqlClientPackageVersion=7.1.0-preview1ci13406 " exited with code 1.

Check failure on line 626 in build.proj

View check run for this annotation

Azure Pipelines / PR-SqlClient-Project (Ubuntu22_Azure_Sql net8_0_AnyCPU_ManagedSNI_3)

build.proj#L626

build.proj(626,5): Error MSB3073: The command " "dotnet" test "/mnt/vss/_work/1/s/src/../src/Microsoft.Data.SqlClient/tests/ManualTests/Microsoft.Data.SqlClient.ManualTests.csproj" -p:Configuration=Debug --blame-hang --blame-hang-dump-type full --blame-hang-timeout 10m --filter "category=flaky" -f net8.0 -p:TestSet="3" --results-directory "TestResults" --logger:"trx;LogFilePrefix=SqlClientManual-Unix-net8.0-3" -p:AbstractionsPackageVersion=1.0.0-ci13406 -p:LoggingPackageVersion=1.0.0-ci13406 -p:SqlClientPackageVersion=7.1.0-preview1ci13406 " exited with code 1.
</Target>

<!-- TestSqlClientUnit: Runs unit tests for SqlClient -->
Expand Down Expand Up @@ -646,7 +651,7 @@
<DotnetCommand>$([System.Text.RegularExpressions.Regex]::Replace($(DotnetCommand), "\s+", " "))</DotnetCommand>
</PropertyGroup>
<Message Text=">>> Running unit tests for SqlClient via command: $(DotnetCommand)" />
<Exec ConsoleToMsBuild="true" Command="$(DotnetCommand)" />

Check failure on line 654 in build.proj

View check run for this annotation

Azure Pipelines / PR-SqlClient-Project (Ubuntu22_Sql22 net8_0_AnyCPU_ManagedSNI_1)

build.proj#L654

build.proj(654,5): Error MSB3073: The command " "dotnet" test "/mnt/vss/_work/1/s/src/../src/Microsoft.Data.SqlClient/tests/UnitTests/Microsoft.Data.SqlClient.UnitTests.csproj" -p:Configuration=Debug --blame-hang --blame-hang-dump-type full --blame-hang-timeout 10m --collect "Code coverage" --settings "/mnt/vss/_work/1/s/src/../src/Microsoft.Data.SqlClient/tests/tools/Microsoft.Data.SqlClient.TestUtilities/CodeCoverage.runsettings" --filter "category!=failing&category!=flaky&category!=interactive" -f net8.0 --results-directory "TestResults" --logger:"trx;LogFilePrefix=SqlClientUnit-Unix-net8.0" " exited with code 1.

Check failure on line 654 in build.proj

View check run for this annotation

Azure Pipelines / PR-SqlClient-Project (Win22_Sql19 net8_0_AnyCPU_ManagedSNI_3)

build.proj#L654

build.proj(654,5): Error MSB3073: The command " "dotnet" test "D:\a\_work\1\s\src\..\src/Microsoft.Data.SqlClient/tests/UnitTests/Microsoft.Data.SqlClient.UnitTests.csproj" -p:Configuration=Debug --blame-hang --blame-hang-dump-type full --blame-hang-timeout 10m --filter "category=flaky" -f net8.0 --results-directory "TestResults" --logger:"trx;LogFilePrefix=SqlClientUnit-Windows_NT-net8.0" " exited with code 1.

Check failure on line 654 in build.proj

View check run for this annotation

Azure Pipelines / PR-SqlClient-Project (Win22_Sql19_x86 net462_AnyCPU_3)

build.proj#L654

build.proj(654,5): Error MSB3073: The command " "C:\x86\dotnet" test "D:\a\_work\1\s\src\..\src/Microsoft.Data.SqlClient/tests/UnitTests/Microsoft.Data.SqlClient.UnitTests.csproj" -p:Configuration=Debug --blame-hang --blame-hang-dump-type full --blame-hang-timeout 10m --filter "category=flaky" -f net462 --results-directory "TestResults" --logger:"trx;LogFilePrefix=SqlClientUnit-Windows_NT-net462" " exited with code 1.

Check failure on line 654 in build.proj

View check run for this annotation

Azure Pipelines / PR-SqlClient-Project (Win22_Sql22_Named_Instance net462_AnyCPU_2)

build.proj#L654

build.proj(654,5): Error MSB3073: The command " "dotnet" test "D:\a\_work\1\s\src\..\src/Microsoft.Data.SqlClient/tests/UnitTests/Microsoft.Data.SqlClient.UnitTests.csproj" -p:Configuration=Debug --blame-hang --blame-hang-dump-type full --blame-hang-timeout 10m --collect "Code coverage" --settings "D:\a\_work\1\s\src\..\src/Microsoft.Data.SqlClient/tests/tools/Microsoft.Data.SqlClient.TestUtilities/CodeCoverage.runsettings" --filter "category!=failing&category!=flaky&category!=interactive" -f net462 --results-directory "TestResults" --logger:"trx;LogFilePrefix=SqlClientUnit-Windows_NT-net462" " exited with code 1.

Check failure on line 654 in build.proj

View check run for this annotation

Azure Pipelines / PR-SqlClient-Project (Win11_ARM64_Azure_Sql net9_0_AnyCPU_NativeSNI_1)

build.proj#L654

build.proj(654,5): Error MSB3073: The command " "dotnet" test "D:\a\_work\1\s\src\..\src/Microsoft.Data.SqlClient/tests/UnitTests/Microsoft.Data.SqlClient.UnitTests.csproj" -p:Configuration=Debug --blame-hang --blame-hang-dump-type full --blame-hang-timeout 10m --filter "category=flaky" -f net9.0 --results-directory "TestResults" --logger:"trx;LogFilePrefix=SqlClientUnit-Windows_NT-net9.0" " exited with code 1.

Check failure on line 654 in build.proj

View check run for this annotation

Azure Pipelines / PR-SqlClient-Project (Win11_ARM64_Azure_Sql net9_0_AnyCPU_ManagedSNI_2)

build.proj#L654

build.proj(654,5): Error MSB3073: The command " "dotnet" test "D:\a\_work\1\s\src\..\src/Microsoft.Data.SqlClient/tests/UnitTests/Microsoft.Data.SqlClient.UnitTests.csproj" -p:Configuration=Debug --blame-hang --blame-hang-dump-type full --blame-hang-timeout 10m --filter "category=flaky" -f net9.0 --results-directory "TestResults" --logger:"trx;LogFilePrefix=SqlClientUnit-Windows_NT-net9.0" " exited with code 1.

Check failure on line 654 in build.proj

View check run for this annotation

Azure Pipelines / PR-SqlClient-Project (Win22_Sql19 net462_AnyCPU_1)

build.proj#L654

build.proj(654,5): Error MSB3073: The command " "dotnet" test "D:\a\_work\1\s\src\..\src/Microsoft.Data.SqlClient/tests/UnitTests/Microsoft.Data.SqlClient.UnitTests.csproj" -p:Configuration=Debug --blame-hang --blame-hang-dump-type full --blame-hang-timeout 10m --filter "category=flaky" -f net462 --results-directory "TestResults" --logger:"trx;LogFilePrefix=SqlClientUnit-Windows_NT-net462" " exited with code 1.

Check failure on line 654 in build.proj

View check run for this annotation

Azure Pipelines / PR-SqlClient-Project (Win11_ARM64_Azure_Sql net462_AnyCPU_3)

build.proj#L654

build.proj(654,5): Error MSB3073: The command " "dotnet" test "D:\a\_work\1\s\src\..\src/Microsoft.Data.SqlClient/tests/UnitTests/Microsoft.Data.SqlClient.UnitTests.csproj" -p:Configuration=Debug --blame-hang --blame-hang-dump-type full --blame-hang-timeout 10m --filter "category=flaky" -f net462 --results-directory "TestResults" --logger:"trx;LogFilePrefix=SqlClientUnit-Windows_NT-net462" " exited with code 1.

Check failure on line 654 in build.proj

View check run for this annotation

Azure Pipelines / PR-SqlClient-Project (Win11_ARM64_Azure_Sql net8_0_AnyCPU_ManagedSNI_1)

build.proj#L654

build.proj(654,5): Error MSB3073: The command " "dotnet" test "D:\a\_work\1\s\src\..\src/Microsoft.Data.SqlClient/tests/UnitTests/Microsoft.Data.SqlClient.UnitTests.csproj" -p:Configuration=Debug --blame-hang --blame-hang-dump-type full --blame-hang-timeout 10m --filter "category=flaky" -f net8.0 --results-directory "TestResults" --logger:"trx;LogFilePrefix=SqlClientUnit-Windows_NT-net8.0" " exited with code 1.

Check failure on line 654 in build.proj

View check run for this annotation

Azure Pipelines / PR-SqlClient-Project (Win11_ARM64_Azure_Sql net462_AnyCPU_1)

build.proj#L654

build.proj(654,5): Error MSB3073: The command " "dotnet" test "D:\a\_work\1\s\src\..\src/Microsoft.Data.SqlClient/tests/UnitTests/Microsoft.Data.SqlClient.UnitTests.csproj" -p:Configuration=Debug --blame-hang --blame-hang-dump-type full --blame-hang-timeout 10m --filter "category=flaky" -f net462 --results-directory "TestResults" --logger:"trx;LogFilePrefix=SqlClientUnit-Windows_NT-net462" " exited with code 1.

Check failure on line 654 in build.proj

View check run for this annotation

Azure Pipelines / PR-SqlClient-Project (Win11_ARM64_Azure_Sql net9_0_AnyCPU_ManagedSNI_3)

build.proj#L654

build.proj(654,5): Error MSB3073: The command " "dotnet" test "D:\a\_work\1\s\src\..\src/Microsoft.Data.SqlClient/tests/UnitTests/Microsoft.Data.SqlClient.UnitTests.csproj" -p:Configuration=Debug --blame-hang --blame-hang-dump-type full --blame-hang-timeout 10m --filter "category=flaky" -f net9.0 --results-directory "TestResults" --logger:"trx;LogFilePrefix=SqlClientUnit-Windows_NT-net9.0" " exited with code 1.

Check failure on line 654 in build.proj

View check run for this annotation

Azure Pipelines / PR-SqlClient-Project (Win11_Azure_Sql net462_AnyCPU_1)

build.proj#L654

build.proj(654,5): Error MSB3073: The command " "dotnet" test "D:\a\_work\1\s\src\..\src/Microsoft.Data.SqlClient/tests/UnitTests/Microsoft.Data.SqlClient.UnitTests.csproj" -p:Configuration=Debug --blame-hang --blame-hang-dump-type full --blame-hang-timeout 10m --filter "category=flaky" -f net462 --results-directory "TestResults" --logger:"trx;LogFilePrefix=SqlClientUnit-Windows_NT-net462" " exited with code 1.

Check failure on line 654 in build.proj

View check run for this annotation

Azure Pipelines / PR-SqlClient-Project (Win11_ARM64_Azure_Sql net8_0_AnyCPU_ManagedSNI_3)

build.proj#L654

build.proj(654,5): Error MSB3073: The command " "dotnet" test "D:\a\_work\1\s\src\..\src/Microsoft.Data.SqlClient/tests/UnitTests/Microsoft.Data.SqlClient.UnitTests.csproj" -p:Configuration=Debug --blame-hang --blame-hang-dump-type full --blame-hang-timeout 10m --filter "category=flaky" -f net8.0 --results-directory "TestResults" --logger:"trx;LogFilePrefix=SqlClientUnit-Windows_NT-net8.0" " exited with code 1.

Check failure on line 654 in build.proj

View check run for this annotation

Azure Pipelines / PR-SqlClient-Project (Win11_ARM64_Azure_Sql net462_AnyCPU_2)

build.proj#L654

build.proj(654,5): Error MSB3073: The command " "dotnet" test "D:\a\_work\1\s\src\..\src/Microsoft.Data.SqlClient/tests/UnitTests/Microsoft.Data.SqlClient.UnitTests.csproj" -p:Configuration=Debug --blame-hang --blame-hang-dump-type full --blame-hang-timeout 10m --filter "category=flaky" -f net462 --results-directory "TestResults" --logger:"trx;LogFilePrefix=SqlClientUnit-Windows_NT-net462" " exited with code 1.

Check failure on line 654 in build.proj

View check run for this annotation

Azure Pipelines / PR-SqlClient-Project (Win11_Azure_Sql net462_AnyCPU_2)

build.proj#L654

build.proj(654,5): Error MSB3073: The command " "dotnet" test "D:\a\_work\1\s\src\..\src/Microsoft.Data.SqlClient/tests/UnitTests/Microsoft.Data.SqlClient.UnitTests.csproj" -p:Configuration=Debug --blame-hang --blame-hang-dump-type full --blame-hang-timeout 10m --filter "category=flaky" -f net462 --results-directory "TestResults" --logger:"trx;LogFilePrefix=SqlClientUnit-Windows_NT-net462" " exited with code 1.

Check failure on line 654 in build.proj

View check run for this annotation

Azure Pipelines / PR-SqlClient-Project (Win11_ARM64_Azure_Sql net8_0_AnyCPU_NativeSNI_1)

build.proj#L654

build.proj(654,5): Error MSB3073: The command " "dotnet" test "D:\a\_work\1\s\src\..\src/Microsoft.Data.SqlClient/tests/UnitTests/Microsoft.Data.SqlClient.UnitTests.csproj" -p:Configuration=Debug --blame-hang --blame-hang-dump-type full --blame-hang-timeout 10m --filter "category=flaky" -f net8.0 --results-directory "TestResults" --logger:"trx;LogFilePrefix=SqlClientUnit-Windows_NT-net8.0" " exited with code 1.

Check failure on line 654 in build.proj

View check run for this annotation

Azure Pipelines / PR-SqlClient-Project (Win11_ARM64_Azure_Sql net8_0_AnyCPU_ManagedSNI_2)

build.proj#L654

build.proj(654,5): Error MSB3073: The command " "dotnet" test "D:\a\_work\1\s\src\..\src/Microsoft.Data.SqlClient/tests/UnitTests/Microsoft.Data.SqlClient.UnitTests.csproj" -p:Configuration=Debug --blame-hang --blame-hang-dump-type full --blame-hang-timeout 10m --filter "category=flaky" -f net8.0 --results-directory "TestResults" --logger:"trx;LogFilePrefix=SqlClientUnit-Windows_NT-net8.0" " exited with code 1.

Check failure on line 654 in build.proj

View check run for this annotation

Azure Pipelines / PR-SqlClient-Project (Win11_ARM64_Azure_Sql net8_0_AnyCPU_NativeSNI_2)

build.proj#L654

build.proj(654,5): Error MSB3073: The command " "dotnet" test "D:\a\_work\1\s\src\..\src/Microsoft.Data.SqlClient/tests/UnitTests/Microsoft.Data.SqlClient.UnitTests.csproj" -p:Configuration=Debug --blame-hang --blame-hang-dump-type full --blame-hang-timeout 10m --filter "category=flaky" -f net8.0 --results-directory "TestResults" --logger:"trx;LogFilePrefix=SqlClientUnit-Windows_NT-net8.0" " exited with code 1.

Check failure on line 654 in build.proj

View check run for this annotation

Azure Pipelines / PR-SqlClient-Project (Win11_Azure_Sql net9_0_AnyCPU_ManagedSNI_3)

build.proj#L654

build.proj(654,5): Error MSB3073: The command " "dotnet" test "D:\a\_work\1\s\src\..\src/Microsoft.Data.SqlClient/tests/UnitTests/Microsoft.Data.SqlClient.UnitTests.csproj" -p:Configuration=Debug --blame-hang --blame-hang-dump-type full --blame-hang-timeout 10m --filter "category=flaky" -f net9.0 --results-directory "TestResults" --logger:"trx;LogFilePrefix=SqlClientUnit-Windows_NT-net9.0" " exited with code 1.
</Target>

<!-- ================================================================= -->
Expand Down Expand Up @@ -985,4 +990,118 @@
<Message Text=">>> Packaging Microsoft.SqlServer.Server via command: $(DotnetCommand)" />
<Exec ConsoleToMsBuild="true" Command="$(DotnetCommand)" />
</Target>

<!-- ================================================================= -->
<!-- Ancillary Targets -->

<!-- Set up the list of supported OSes. -->
<PropertyGroup>
<_OsList>Windows_NT;Unix</_OsList>
</PropertyGroup>
<ItemGroup>
<_OsValues Include="$(_OsList)" />
</ItemGroup>

<!-- Supply a common set of arguments to dotnet build. -->
<PropertyGroup>
<_DotnetArguments>
-p:Configuration=$(Configuration)

<!-- Versioning arguments -->
$(BuildNumberArgument)
$(BuildSuffixArgument)

<!-- Reference Type Arguments -->
$(ReferenceTypeArgument)
$(PackageVersionAbstractionsArgument)
$(PackageVersionAkvProviderArgument)
$(PackageVersionAzureArgument)
$(PackageVersionLoggingArgument)
$(PackageVersionSqlClientArgument)
$(PackageVersionSqlServerArgument)
</_DotnetArguments>
<!-- Convert more than one whitespace character into one space -->
<_DotnetArguments>$([System.Text.RegularExpressions.Regex]::Replace($(_DotnetArguments), "\s+", " "))</_DotnetArguments>
</PropertyGroup>

<!--
Define all of the ancillary project file paths.

These aren't all of the possible projects - only the top-level ones that, in turn, will
transitively build all ancillary projects.
-->
<PropertyGroup>
<AbstractionsTestsProjectPath>$(RepoRoot)src/Microsoft.Data.SqlClient.Extensions/Abstractions/test/Abstractions.Test.csproj</AbstractionsTestsProjectPath>
<UnitTestsProjectPath>$(RepoRoot)src/Microsoft.Data.SqlClient/tests/UnitTests/Microsoft.Data.SqlClient.UnitTests.csproj</UnitTestsProjectPath>
<FunctionalTestsProjectPath>$(RepoRoot)src/Microsoft.Data.SqlClient/tests/FunctionalTests/Microsoft.Data.SqlClient.FunctionalTests.csproj</FunctionalTestsProjectPath>
<ManualTestsProjectPath>$(RepoRoot)src/Microsoft.Data.SqlClient/tests/ManualTests/Microsoft.Data.SqlClient.ManualTests.csproj</ManualTestsProjectPath>
<PerformanceTestsProjectPath>$(RepoRoot)src/Microsoft.Data.SqlClient/tests/PerformanceTests/Microsoft.Data.SqlClient.PerformanceTests.csproj</PerformanceTestsProjectPath>
<StressTestsProjectPath>$(RepoRoot)src/Microsoft.Data.SqlClient/tests/StressTests/SqlClient.Stress.Runner/SqlClient.Stress.Runner.csproj</StressTestsProjectPath>
<AzureTestsProjectPath>$(RepoRoot)src/Microsoft.Data.SqlClient.Extensions/Azure/test/Azure.Test.csproj</AzureTestsProjectPath>

<SamplesProjectPath>$(RepoRoot)doc/samples/Microsoft.Data.SqlClient.Samples.csproj</SamplesProjectPath>

<GenApiProjectPath>$(RepoRoot)tools/GenAPI/Microsoft.DotNet.GenAPI/Microsoft.DotNet.GenAPI.csproj</GenApiProjectPath>
</PropertyGroup>

<!-- Build all test projects. -->
<Target Name="BuildTests">

<!-- SqlServer has no tests to build. -->

<!-- Logging has no tests to build. -->

<!-- Build Abstractions tests, which don't have conditional TFMs. -->
<Message Text=">>> Building Abstractions.Tests with arguments: $(_DotnetArguments)"/>
<Exec ConsoleToMsBuild="true"
Command="&quot;$(DotnetPath)dotnet&quot; build &quot;$(AbstractionsTestsProjectPath)&quot; $(_DotnetArguments)" />

<!-- Build SqlClient UnitTests (project references only, no ReferenceType). -->
<Message Text=">>> Building SqlClient UnitTests for %(_OsValues.Identity)"/>
<Exec ConsoleToMsBuild="true"
Command="&quot;$(DotnetPath)dotnet&quot; build &quot;$(UnitTestsProjectPath)&quot; -p:Configuration=$(Configuration) -p:OS=%(_OsValues.Identity)" />
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MSBuild performs one exec for each element in _OsValues, so this builds our Windows and Unix code.


Comment thread
paulmedynski marked this conversation as resolved.
<!-- Build SqlClient FunctionalTests. -->
<Message Text=">>> Building SqlClient FunctionalTests for %(_OsValues.Identity) with arguments: $(_DotnetArguments)"/>
<Exec ConsoleToMsBuild="true"
Command="&quot;$(DotnetPath)dotnet&quot; build &quot;$(FunctionalTestsProjectPath)&quot; $(_DotnetArguments) -p:OS=%(_OsValues.Identity)" />

<!-- Build SqlClient ManualTests. -->
<Message Text=">>> Building SqlClient ManualTests for %(_OsValues.Identity) with arguments: $(_DotnetArguments)"/>
<Exec ConsoleToMsBuild="true"
Command="&quot;$(DotnetPath)dotnet&quot; build &quot;$(ManualTestsProjectPath)&quot; $(_DotnetArguments) -p:OS=%(_OsValues.Identity)" />

<!-- Build SqlClient PerformanceTests. -->
<Message Text=">>> Building SqlClient PerformanceTests for %(_OsValues.Identity) with arguments: $(_DotnetArguments)"/>
<Exec ConsoleToMsBuild="true"
Command="&quot;$(DotnetPath)dotnet&quot; build &quot;$(PerformanceTestsProjectPath)&quot; $(_DotnetArguments) -p:OS=%(_OsValues.Identity)" />

<!-- Build SqlClient StressTests. -->
<Message Text=">>> Building SqlClient StressTests for %(_OsValues.Identity) with arguments: $(_DotnetArguments)"/>
<Exec ConsoleToMsBuild="true"
Command="&quot;$(DotnetPath)dotnet&quot; build &quot;$(StressTestsProjectPath)&quot; $(_DotnetArguments) -p:OS=%(_OsValues.Identity)" />

<!-- Build Azure tests. -->
<Message Text=">>> Building Azure.Tests for %(_OsValues.Identity) with arguments: $(_DotnetArguments)"/>
<Exec ConsoleToMsBuild="true"
Command="&quot;$(DotnetPath)dotnet&quot; build &quot;$(AzureTestsProjectPath)&quot; $(_DotnetArguments) -p:OS=%(_OsValues.Identity)" />

<!-- AKV Provider has no tests to build. -->

Comment thread
paulmedynski marked this conversation as resolved.
</Target>

<!-- Build all sample projects. -->
<Target Name="BuildSamples">
<Message Text=">>> Building Samples with arguments: $(_DotnetArguments)"/>
<Exec ConsoleToMsBuild="true"
Command="&quot;$(DotnetPath)dotnet&quot; build &quot;$(SamplesProjectPath)&quot; $(_DotnetArguments)" />
Comment thread
paulmedynski marked this conversation as resolved.
Outdated
</Target>

<!-- Build all tools projects. -->
<Target Name="BuildTools">
<Message Text=">>> Building GenAPI with arguments: $(_DotnetArguments)"/>
<Exec ConsoleToMsBuild="true"
Command="&quot;$(DotnetPath)dotnet&quot; build &quot;$(GenApiProjectPath)&quot; $(_DotnetArguments)" />
</Target>

</Project>
8 changes: 6 additions & 2 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only build.proj has a default target. Build doesn't exist here anyway, so this was just cruft.

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<!--
"ReferenceType" property supports below options:
Expand Down Expand Up @@ -35,7 +35,11 @@
<!-- Versioning ====================================================== -->
<!--
Versions for packages are assigned in the project's Versions.props file. Below, we provide
defaults for components of versions that are shared across all projects
defaults for components of versions that are shared across all projects.

Directory.Build.props evaluates before Directory.Packages.props, so defining these here
ensures FileVersionBuildNumber is set before any Versions.props runs (including those
imported by Directory.Packages.props in Package mode).
-->
<PropertyGroup>
<!--
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@
Condition="'$(IsCrossTargetingBuild)' != 'true' AND '$(GenerateDocumentationFile)' == 'true'">

<PropertyGroup>
<PowerShellCommand Condition="'$(OS)' == 'Windows_NT'">powershell.exe</PowerShellCommand>
<PowerShellCommand Condition="'$(OS)' != 'Windows_NT'">pwsh</PowerShellCommand>
<PowerShellCommand Condition="$([MSBuild]::IsOSPlatform('Windows'))">powershell.exe</PowerShellCommand>
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BuildAll sets $(OS) to whatever it wants, regardless of the actual host OS. This will be clobbered by @mdaigle 's pwsh tool changes anyway, so it's a temp fix.

<PowerShellCommand Condition="!$([MSBuild]::IsOSPlatform('Windows'))">pwsh</PowerShellCommand>
<PowerShellCommand>
$(PowerShellCommand)
-NonInteractive
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;
using System.Collections;
using System.Collections.Generic;

#nullable enable

namespace Microsoft.Data.SqlClient.Tests.Common
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.using System;
// See the LICENSE file in the project root for more information.

using System;
using System.Collections.Generic;
using Azure.Core;
using Azure.Security.KeyVault.Keys;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,10 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Threading;

namespace Microsoft.Data.SqlClient.Tests.Common.Fixtures;

Expand Down Expand Up @@ -110,7 +107,7 @@ protected X509Certificate2 CreateCertificate(string subjectName, IEnumerable<str
ephemeral.Export(X509ContentType.Pkcs12, password),
password,
keyStorageFlags,
new Pkcs12LoaderLimits(Pkcs12LoaderLimits.Defaults)
new Pkcs12LoaderLimits(Pkcs12LoaderLimits.Defaults)
{
PreserveStorageProvider = true,
PreserveKeyName = true
Expand Down Expand Up @@ -211,7 +208,7 @@ exit 1
for (int attempt = 1; attempt <= retries; ++attempt)
{
using Process psProcess = new() { StartInfo = startInfo };

psProcess.Start();
commandOutput = psProcess.StandardOutput.ReadToEnd();

Expand All @@ -227,15 +224,15 @@ exit 1
{
return new X509Certificate2(Convert.FromBase64String(commandOutput), password, X509KeyStorageFlags.Exportable);
}

Console.WriteLine(
$"PowerShell command failed with exit code {code} on " +
$"attempt {attempt} of {retries}; " +
$"retrying in {delay} seconds...");

Thread.Sleep(TimeSpan.FromSeconds(delay));
}

throw new Exception(
"PowerShell command raised exception: " +
$"{commandOutput}; command was: {formattedCommand}");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;
using System.Security.Cryptography.X509Certificates;
using System.Security.Principal;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;
using System.Security.Cryptography.X509Certificates;

namespace Microsoft.Data.SqlClient.Tests.Common.Fixtures;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;
using System.Text;
using System.Threading;

namespace Microsoft.Data.SqlClient.Tests.Common.Fixtures.DatabaseObjects;

Expand Down Expand Up @@ -170,7 +168,7 @@ public static string GenerateLongName(string prefix, bool escape = true)
///
/// The GUID parts will be the characters from the 1st and 4th blocks
/// from a traditional string representation, as shown here:
///
///
/// <code>
/// 7ff01cb8-88c7-11f0-b433-00155d7e531e
/// ^^^^^^^^ ^^^^
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;
using System.Reflection;
using System.Threading;

namespace Microsoft.Data.SqlClient.Tests.Common;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
<PropertyGroup>
<AssemblyName>Microsoft.Data.SqlClient.TestCommon</AssemblyName>
<RootNamespace>Microsoft.Data.SqlClient.TestCommon</RootNamespace>

<ImplicitUsings>enable</ImplicitUsings>
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reduces 'using' noise.

<Nullable>enable</Nullable>

<!--
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<RuleSet Name="Microsoft Managed Recommended Rules" Description="These rules focus on the most critical problems in your code, including potential security holes, application crashes, and other important logic and design errors. It is recommended to include this rule set in any custom rule set you create for your projects." ToolsVersion="Latest">
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ToolsVersion is an obsolete attribute we don't need any more.

<RuleSet Name="Microsoft Managed Recommended Rules" Description="These rules focus on the most critical problems in your code, including potential security holes, application crashes, and other important logic and design errors. It is recommended to include this rule set in any custom rule set you create for your projects.">
<Localization ResourceAssembly="Microsoft.VisualStudio.CodeAnalysis.RuleSets.Strings.dll" ResourceBaseName="Microsoft.VisualStudio.CodeAnalysis.RuleSets.Strings.Localized">
<Name Resource="MinimumRecommendedRules_Name" />
<Description Resource="MinimumRecommendedRules_Description" />
Expand Down Expand Up @@ -71,4 +71,4 @@
<Rules AnalyzerId="xunit.analyzers" RuleNamespace="xunit.analyzers">
<Rule Id="xUnit1024" Action="Info" />
</Rules>
</RuleSet>
</RuleSet>
2 changes: 1 addition & 1 deletion tools/props/AssemblyInfo.props
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Description>Microsoft.Data.SqlClient</Description>
<Authors>Microsoft</Authors>
Expand Down
2 changes: 1 addition & 1 deletion tools/props/AssemblyRef.props
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<MicrosoftVSDesigner>"Microsoft.VSDesigner, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"</MicrosoftVSDesigner>
<SystemDrawing>"System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"</SystemDrawing>
Expand Down
2 changes: 1 addition & 1 deletion tools/targets/RepositoryInfo.targets
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ file to you under the MIT license. -->
$(_TranslateUrlPattern), $(_TranslateUrlReplacement)))</ScmRepositoryUrl>
</SourceRoot>
</ItemGroup>
<Message Text="Final Translated ScmRepositoryUrl to $(ScmRepositoryUrl)" Importance="high" />
<Message Text="Final Translated ScmRepositoryUrl to $(ScmRepositoryUrl)" />
</Target>
</Project>
Loading