Skip to content

Commit 85da1f8

Browse files
committed
Fix manual test set filtering and test project references
1 parent 19ecb01 commit 85da1f8

3 files changed

Lines changed: 37 additions & 24 deletions

File tree

build.proj

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -333,13 +333,13 @@
333333
TestSet
334334
Applies to: TestSqlClientManual
335335
Description: Used to select a set of tests to run from the SqlClient manual tests project. If not
336-
specified, all tests will be executed.
336+
specified, all manual tests will be executed. In the manual test target, this
337+
value is converted into a Set trait filter and combined with any TestFilters.
337338
Default value: [blank]
338339
Allowed values: ([1][2][3][AE])
339340
Examples: "1", "12", "AE", "12AE"
340341
-->
341342
<TestSet Condition="'$(TestSet)' == ''" />
342-
<TestSetArgument Condition="'$(TestSet)' != ''">-p:TestSet="$(TestSet)"</TestSetArgument>
343343
</PropertyGroup>
344344

345345
<!-- ================================================================= -->
@@ -675,14 +675,27 @@
675675
<LogFilePrefix Condition="'$(TestFramework)' != ''">$(LogFilePrefix)-$(TestFramework)</LogFilePrefix>
676676
<LogFilePrefix Condition="'$(TestSet)' != ''">$(LogFilePrefix)-$(TestSet)</LogFilePrefix>
677677

678+
<!-- Join test sets together, if any were selected -->
679+
<NormalizedTestSet>$(TestSet.ToUpper())</NormalizedTestSet>
680+
<TestSetFilter Condition="$(NormalizedTestSet.Contains('1'))">Set=1</TestSetFilter>
681+
<TestSetFilter Condition="$(NormalizedTestSet.Contains('2'))">$(TestSetFilter)|Set=2</TestSetFilter>
682+
<TestSetFilter Condition="$(NormalizedTestSet.Contains('3'))">$(TestSetFilter)|Set=3</TestSetFilter>
683+
<TestSetFilter Condition="$(NormalizedTestSet.Contains('AE'))">$(TestSetFilter)|Set=AE</TestSetFilter>
684+
<TestSetFilter>$(TestSetFilter.Trim('|'))</TestSetFilter>
685+
686+
<!-- Combine existing filters with test set filters -->
687+
<ManualTestFilters Condition="'$(TestSetFilter)' != '' and '$(TestFilters)' != ''">$(TestFilters)&amp;($(TestSetFilter))</ManualTestFilters>
688+
<ManualTestFilters Condition="'$(TestSetFilter)' == ''">$(TestFilters)</ManualTestFilters>
689+
<ManualTestFilters Condition="'$(TestFilters)' == ''">$(TestSetFilter)</ManualTestFilters>
690+
<ManualTestFiltersArgument Condition="'$(ManualTestFilters)' != ''">--filter "$(ManualTestFilters)"</ManualTestFiltersArgument>
691+
678692
<DotnetCommand>
679693
"$(DotnetPath)dotnet" test "$(SqlClientManualTestProjectPath)"
680694
-p:Configuration=$(Configuration)
681695
$(TestBlameArgument)
682696
$(TestCodeCoverageArgument)
683-
$(TestFiltersArgument)
697+
$(ManualTestFiltersArgument)
684698
$(TestFrameworkArgument)
685-
$(TestSetArgument)
686699
--results-directory "$(TestResultsFolderPath)"
687700
--logger:"trx;LogFilePrefix=$(LogFilePrefix)"
688701

src/Microsoft.Data.SqlClient/tests/FunctionalTests/Microsoft.Data.SqlClient.FunctionalTests.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
PrivateAssets="all" />
8484

8585
<ProjectReference Include="$(RepoRoot)src/Microsoft.Data.SqlClient/tests/Common/Microsoft.Data.SqlClient.TestCommon.csproj" />
86-
<ProjectReference Include="$(RepoRoot)src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/UdtTest/UDTs/Address/Address.csproj" />
86+
<ProjectReference Include="$(RepoRoot)src/Microsoft.Data.SqlClient/tests/TestUdts/Address/Address.csproj" />
8787
<ProjectReference Include="$(RepoRoot)src/Microsoft.Data.SqlClient/tests/tools/Microsoft.Data.SqlClient.TestUtilities/Microsoft.Data.SqlClient.TestUtilities.csproj" />
8888
<ProjectReference Include="$(RepoRoot)src/Microsoft.Data.SqlClient/tests/tools/TDS/TDS/TDS.csproj" />
8989
<ProjectReference Include="$(RepoRoot)src/Microsoft.Data.SqlClient/tests/tools/TDS/TDS.EndPoint/TDS.EndPoint.csproj" />
@@ -113,7 +113,7 @@
113113
PrivateAssets="all" />
114114

115115
<ProjectReference Include="$(RepoRoot)src/Microsoft.Data.SqlClient/tests/Common/Microsoft.Data.SqlClient.TestCommon.csproj" />
116-
<ProjectReference Include="$(RepoRoot)src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/UdtTest/UDTs/Address/Address.csproj" />
116+
<ProjectReference Include="$(RepoRoot)src/Microsoft.Data.SqlClient/tests/TestUdts/Address/Address.csproj" />
117117
<ProjectReference Include="$(RepoRoot)src/Microsoft.Data.SqlClient/tests/tools/Microsoft.Data.SqlClient.TestUtilities/Microsoft.Data.SqlClient.TestUtilities.csproj" />
118118
<ProjectReference Include="$(RepoRoot)src/Microsoft.Data.SqlClient/tests/tools/TDS/TDS/TDS.csproj" />
119119
<ProjectReference Include="$(RepoRoot)src/Microsoft.Data.SqlClient/tests/tools/TDS/TDS.EndPoint/TDS.EndPoint.csproj" />

src/Microsoft.Data.SqlClient/tests/ManualTests/Microsoft.Data.SqlClient.ManualTests.csproj

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -114,15 +114,15 @@
114114

115115
<PackageReference Include="Microsoft.SqlServer.Server" />
116116
<ProjectReference Include="$(RepoRoot)src/Microsoft.Data.SqlClient/tests/Common/Microsoft.Data.SqlClient.TestCommon.csproj" />
117-
<ProjectReference Include="$(TestsPath)CustomConfigurableRetryLogic/CustomRetryLogicProvider.csproj" />
118-
<ProjectReference Include="$(TestsPath)TestUdts/Address/Address.csproj" />
119-
<ProjectReference Include="$(TestsPath)TestUdts/Circle/Circle.csproj" />
120-
<ProjectReference Include="$(TestsPath)TestUdts/Shapes/Shapes.csproj" />
121-
<ProjectReference Include="$(TestsPath)TestUdts/Utf8String/Utf8String.csproj" />
122-
<ProjectReference Include="$(TestsPath)tools/Microsoft.Data.SqlClient.TestUtilities/Microsoft.Data.SqlClient.TestUtilities.csproj" />
123-
<ProjectReference Include="$(TestsPath)tools/TDS/TDS/TDS.csproj" />
124-
<ProjectReference Include="$(TestsPath)tools/TDS/TDS.EndPoint/TDS.EndPoint.csproj" />
125-
<ProjectReference Include="$(TestsPath)tools/TDS/TDS.Servers/TDS.Servers.csproj" />
117+
<ProjectReference Include="$(RepoRoot)src/Microsoft.Data.SqlClient/tests/CustomConfigurableRetryLogic/CustomRetryLogicProvider.csproj" />
118+
<ProjectReference Include="$(RepoRoot)src/Microsoft.Data.SqlClient/tests/TestUdts/Address/Address.csproj" />
119+
<ProjectReference Include="$(RepoRoot)src/Microsoft.Data.SqlClient/tests/TestUdts/Circle/Circle.csproj" />
120+
<ProjectReference Include="$(RepoRoot)src/Microsoft.Data.SqlClient/tests/TestUdts/Shapes/Shapes.csproj" />
121+
<ProjectReference Include="$(RepoRoot)src/Microsoft.Data.SqlClient/tests/TestUdts/Utf8String/Utf8String.csproj" />
122+
<ProjectReference Include="$(RepoRoot)src/Microsoft.Data.SqlClient/tests/tools/Microsoft.Data.SqlClient.TestUtilities/Microsoft.Data.SqlClient.TestUtilities.csproj" />
123+
<ProjectReference Include="$(RepoRoot)src/Microsoft.Data.SqlClient/tests/tools/TDS/TDS/TDS.csproj" />
124+
<ProjectReference Include="$(RepoRoot)src/Microsoft.Data.SqlClient/tests/tools/TDS/TDS.EndPoint/TDS.EndPoint.csproj" />
125+
<ProjectReference Include="$(RepoRoot)src/Microsoft.Data.SqlClient/tests/tools/TDS/TDS.Servers/TDS.Servers.csproj" />
126126
</ItemGroup>
127127

128128
<!-- References for netcore -->
@@ -147,15 +147,15 @@
147147

148148
<PackageReference Include="Microsoft.SqlServer.Server" />
149149
<ProjectReference Include="$(RepoRoot)src/Microsoft.Data.SqlClient/tests/Common/Microsoft.Data.SqlClient.TestCommon.csproj" />
150-
<ProjectReference Include="$(TestsPath)TestUdts/Address/Address.csproj" />
151-
<ProjectReference Include="$(TestsPath)TestUdts/Circle/Circle.csproj" />
152-
<ProjectReference Include="$(TestsPath)TestUdts/Shapes/Shapes.csproj" />
153-
<ProjectReference Include="$(TestsPath)TestUdts/Utf8String/Utf8String.csproj" />
154-
<ProjectReference Include="$(TestsPath)CustomConfigurableRetryLogic/CustomRetryLogicProvider.csproj" />
155-
<ProjectReference Include="$(TestsPath)tools/Microsoft.Data.SqlClient.TestUtilities/Microsoft.Data.SqlClient.TestUtilities.csproj" />
156-
<ProjectReference Include="$(TestsPath)tools/TDS/TDS/TDS.csproj" />
157-
<ProjectReference Include="$(TestsPath)tools/TDS/TDS.EndPoint/TDS.EndPoint.csproj" />
158-
<ProjectReference Include="$(TestsPath)tools/TDS/TDS.Servers/TDS.Servers.csproj" />
150+
<ProjectReference Include="$(RepoRoot)src/Microsoft.Data.SqlClient/tests/TestUdts/Address/Address.csproj" />
151+
<ProjectReference Include="$(RepoRoot)src/Microsoft.Data.SqlClient/tests/TestUdts/Circle/Circle.csproj" />
152+
<ProjectReference Include="$(RepoRoot)src/Microsoft.Data.SqlClient/tests/TestUdts/Shapes/Shapes.csproj" />
153+
<ProjectReference Include="$(RepoRoot)src/Microsoft.Data.SqlClient/tests/TestUdts/Utf8String/Utf8String.csproj" />
154+
<ProjectReference Include="$(RepoRoot)src/Microsoft.Data.SqlClient/tests/CustomConfigurableRetryLogic/CustomRetryLogicProvider.csproj" />
155+
<ProjectReference Include="$(RepoRoot)src/Microsoft.Data.SqlClient/tests/tools/Microsoft.Data.SqlClient.TestUtilities/Microsoft.Data.SqlClient.TestUtilities.csproj" />
156+
<ProjectReference Include="$(RepoRoot)src/Microsoft.Data.SqlClient/tests/tools/TDS/TDS/TDS.csproj" />
157+
<ProjectReference Include="$(RepoRoot)src/Microsoft.Data.SqlClient/tests/tools/TDS/TDS.EndPoint/TDS.EndPoint.csproj" />
158+
<ProjectReference Include="$(RepoRoot)src/Microsoft.Data.SqlClient/tests/tools/TDS/TDS.Servers/TDS.Servers.csproj" />
159159
</ItemGroup>
160160

161161
</Project>

0 commit comments

Comments
 (0)