Skip to content

Commit 173a7ff

Browse files
ericstjgithub-actions
authored andcommitted
Remove package references from library tests (#106737)
* Remove package references from library tests These tests should be referencing the product assemblies so that they test latest and not old bits. * Reference the OOB version of SRSF and make sure it's copied
1 parent 7832c5d commit 173a7ff

File tree

8 files changed

+24
-18
lines changed

8 files changed

+24
-18
lines changed

eng/Versions.props

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,6 @@
163163
<MicrosoftDiaSymReaderVersion>2.0.0</MicrosoftDiaSymReaderVersion>
164164
<MicrosoftDiaSymReaderNativeVersion>17.10.0-beta1.24272.1</MicrosoftDiaSymReaderNativeVersion>
165165
<SystemCommandLineVersion>2.0.0-beta4.24324.3</SystemCommandLineVersion>
166-
<!-- This package provides working implementation of BinaryFormatter and is used only by test projects -->
167-
<SystemRuntimeSerializationFormattersVersion>9.0.0-preview.7.24327.2</SystemRuntimeSerializationFormattersVersion>
168166
<TraceEventVersion>3.1.7</TraceEventVersion>
169167
<NETStandardLibraryRefVersion>2.1.0</NETStandardLibraryRefVersion>
170168
<NetStandardLibraryVersion>2.0.3</NetStandardLibraryVersion>

eng/references.targets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
<ItemGroup>
4040
<ProjectReferenceWithConfiguration PrivateAssets="all"
4141
Private="false"
42-
Condition="$(NetCoreAppLibrary.Contains('%(Filename);'))" />
42+
Condition="$(NetCoreAppLibrary.Contains('%(Filename);')) and '%(ProjectReferenceWithConfiguration.Private)' == ''" />
4343
</ItemGroup>
4444
</Target>
4545

src/libraries/System.Formats.Nrbf/tests/System.Formats.Nrbf.Tests.csproj

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,14 @@
1515
</ItemGroup>
1616

1717
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework'">
18-
<PackageReference Include="System.Text.Json" Version="$(SystemTextJsonVersion)" />
18+
<ProjectReference Include="$(LibrariesProjectRoot)System.Text.Json\src\System.Text.Json.csproj" />
1919
</ItemGroup>
20-
20+
2121
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' != '.NETFramework'">
22-
<PackageReference Include="System.Runtime.Serialization.Formatters" Version="$(SystemRuntimeSerializationFormattersVersion)" />
22+
<!-- Reference the `NetCoreAppMinimum` build which has a functional BinaryFormatter and force a private copy to ensure it's not excluded -->
23+
<ProjectReference Include="$(LibrariesProjectRoot)System.Runtime.Serialization.Formatters\src\System.Runtime.Serialization.Formatters.csproj"
24+
Private="true"
25+
SetTargetFramework="TargetFramework=$(NetCoreAppMinimum)" />
2326
</ItemGroup>
2427

2528
</Project>

src/libraries/System.Net.Http/tests/FunctionalTests/System.Net.Http.Functional.Tests.csproj

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -331,11 +331,9 @@
331331
<ItemGroup>
332332
<PackageReference Include="System.Net.TestData" Version="$(SystemNetTestDataVersion)" />
333333
<ProjectReference Include="$(LibrariesProjectRoot)System.DirectoryServices.Protocols\src\System.DirectoryServices.Protocols.csproj" />
334+
<ProjectReference Include="$(LibrariesProjectRoot)System.IO.Pipelines\src\System.IO.Pipelines.csproj" />
334335
</ItemGroup>
335336
<ItemGroup>
336337
<ProjectReference Include="$(CommonTestPath)StreamConformanceTests\StreamConformanceTests.csproj" />
337338
</ItemGroup>
338-
<ItemGroup>
339-
<PackageReference Include="System.IO.Pipelines" Version="7.0.0" />
340-
</ItemGroup>
341339
</Project>

src/libraries/System.Net.ServerSentEvents/tests/System.Net.ServerSentEvents.Tests.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@
1010

1111
<ItemGroup>
1212
<ProjectReference Include="..\src\System.Net.ServerSentEvents.csproj"/>
13+
<ProjectReference Include="$(LibrariesProjectRoot)System.Text.Json\gen\System.Text.Json.SourceGeneration.Roslyn4.4.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" SetTargetFramework="TargetFramework=netstandard2.0" />
1314
</ItemGroup>
1415

1516
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework'">
16-
<PackageReference Include="System.Text.Json" Version="$(SystemTextJsonVersion)" />
17+
<ProjectReference Include="$(LibrariesProjectRoot)System.Text.Json\src\System.Text.Json.csproj" />
1718
</ItemGroup>
1819

1920
</Project>

src/libraries/System.Resources.Extensions/tests/BinaryFormatTests/System.Resources.Extensions.BinaryFormat.Tests.csproj

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,15 @@
3232
</EmbeddedResource>
3333
<EmbeddedResource Include="TestResources.resx" LogicalName="TestResources.resources" />
3434
</ItemGroup>
35-
35+
3636
<ItemGroup>
3737
<PackageReference Include="System.Drawing.Common.TestData" Version="$(SystemDrawingCommonTestDataVersion)" />
3838
<ProjectReference Include="..\..\src\System.Resources.Extensions.csproj" />
3939
<PackageReference Include="System.Drawing.Common" Version="$(SystemDrawingCommonVersion)" />
40-
<PackageReference Include="System.Runtime.Serialization.Formatters" Version="$(SystemRuntimeSerializationFormattersVersion)" />
40+
<!-- Reference the `NetCoreAppMinimum` build which has a functional BinaryFormatter and force a private copy to ensure it's not excluded -->
41+
<ProjectReference Include="$(LibrariesProjectRoot)System.Runtime.Serialization.Formatters\src\System.Runtime.Serialization.Formatters.csproj"
42+
Private="true"
43+
SetTargetFramework="TargetFramework=$(NetCoreAppMinimum)" />
4144
</ItemGroup>
4245

4346
<ItemGroup>

src/libraries/System.Resources.Extensions/tests/CompatTests/System.Resources.Extensions.Compat.Tests.csproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,16 @@
1818
</ItemGroup>
1919
<ItemGroup>
2020
<PackageReference Include="System.Drawing.Common.TestData" Version="$(SystemDrawingCommonTestDataVersion)" />
21-
<PackageReference Include="System.Runtime.Serialization.Formatters" Version="$(SystemRuntimeSerializationFormattersVersion)" />
2221
<ProjectReference Include="..\..\src\System.Resources.Extensions.csproj" />
2322
</ItemGroup>
24-
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp'">
23+
<ItemGroup>
2524
<PackageReference Include="System.Drawing.Common" Version="$(SystemDrawingCommonVersion)" />
25+
<!-- Reference the `NetCoreAppMinimum` build which has a functional BinaryFormatter and force a private copy to ensure it's not excluded -->
26+
<ProjectReference Include="$(LibrariesProjectRoot)System.Runtime.Serialization.Formatters\src\System.Runtime.Serialization.Formatters.csproj"
27+
Private="true"
28+
SetTargetFramework="TargetFramework=$(NetCoreAppMinimum)" />
2629
<ProjectReference Include="$(LibrariesProjectRoot)System.Windows.Extensions\src\System.Windows.Extensions.csproj" Condition="'$(TargetPlatformIdentifier)' == 'windows'" />
2730
</ItemGroup>
28-
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework'">
29-
<PackageReference Include="System.ValueTuple" Version="$(SystemValueTupleVersion)" />
30-
</ItemGroup>
3131
<ItemGroup>
3232
<!-- Apple mobile trimming descriptor for Mono runtime -->
3333
<TrimmerRootDescriptor Condition="'$(TargetsAppleMobile)' == 'true' and '$(EnableAggressiveTrimming)' == 'true' and '$(UseNativeAotRuntime)' != 'true'" Include="$(MSBuildThisFileDirectory)ILLink.Descriptors.xml" />

src/libraries/System.Resources.Extensions/tests/System.Resources.Extensions.Tests.csproj

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@
2121
</ItemGroup>
2222
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp'">
2323
<PackageReference Include="System.Drawing.Common" Version="$(SystemDrawingCommonVersion)" />
24-
<PackageReference Include="System.Runtime.Serialization.Formatters" Version="$(SystemRuntimeSerializationFormattersVersion)" />
24+
<!-- Reference the `NetCoreAppMinimum` build which has a functional BinaryFormatter and force a private copy to ensure it's not excluded -->
25+
<ProjectReference Include="$(LibrariesProjectRoot)System.Runtime.Serialization.Formatters\src\System.Runtime.Serialization.Formatters.csproj"
26+
Private="true"
27+
SetTargetFramework="TargetFramework=$(NetCoreAppMinimum)" />
2528
<ProjectReference Include="$(LibrariesProjectRoot)System.Windows.Extensions\src\System.Windows.Extensions.csproj" Condition="'$(TargetPlatformIdentifier)' == 'windows'" />
2629
</ItemGroup>
2730
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework'">

0 commit comments

Comments
 (0)