Open steveharter opened 3 months ago
Tagging subscribers to this area: @dotnet/runtime-infrastructure See info in area-owners.md if you want to be subscribed.
Tagging subscribers to this area: @dotnet/area-infrastructure-libraries See info in area-owners.md if you want to be subscribed.
I wonder if this is due to how the test is referencing the src library? @steveharter could you share the change you tried that didn't work here?
FWIW, I see the product test uses the following frameworks. https://github.com/dotnet/runtime/blob/a4407a106f883a6593105a660d44da6f8fa4017c/src/libraries/System.Data.OleDb/tests/System.Data.OleDb.Tests.csproj#L3
I could imagine if the trimming test wasn't using the same it might hit a case where the assembly it needed wasn't built in a vertical build - since the vertical build will only build a subset of the frameworks.
When trimming tests are added to an OOB assembly, such as
System.Data.OleDb
, the build\test command results in error messages like this due to the source assembly not being found. This is due to missing target architecture in the path:In this case, there is no
net9.0
subfolder, but there isnet9.0-windows
,net9.0-unix
, etc.FWIW adding trimming tests include:
ILLink.Descriptors.xml
file to the library'stests
folder with a reference to that in the test'scproj
file like this:<TrimmerRootDescriptor Include="$(MSBuildThisFileDirectory)ILLink.Descriptors.xml" />
TrimmingTests
folder to the library'stests
folder which includes a.proj
file as well as.cs
files for the tests.build.cmd -s libs.tests /p:TestAssemblies=false /p:TestTrimming=true
Linking https://github.com/dotnet/runtime/issues/102244 for the need to add OOB trimming tests.