From f8644d14d08577cedeae85ea3dd870bf487761fd Mon Sep 17 00:00:00 2001 From: Eric StJohn Date: Tue, 1 Jun 2021 14:45:14 -0700 Subject: [PATCH 1/8] Change package testing to use RuntimeTargets rather than RID-specific restore --- .../frameworkSettings/net5.0/settings.targets | 3 - .../netcoreapp/settings.targets | 4 - .../netcoreapp1.0/settings.targets | 32 ------ .../netcoreapp1.1/settings.targets | 34 ------ .../netcoreapp2.0/settings.targets | 8 -- src/libraries/pkg/test/packageTest.targets | 101 +++++++++--------- .../pkg/test/project.csproj.template | 3 +- src/libraries/pkg/test/testPackages.proj | 26 +---- 8 files changed, 55 insertions(+), 156 deletions(-) delete mode 100644 src/libraries/pkg/test/frameworkSettings/netcoreapp1.0/settings.targets delete mode 100644 src/libraries/pkg/test/frameworkSettings/netcoreapp1.1/settings.targets delete mode 100644 src/libraries/pkg/test/frameworkSettings/netcoreapp2.0/settings.targets diff --git a/src/libraries/pkg/test/frameworkSettings/net5.0/settings.targets b/src/libraries/pkg/test/frameworkSettings/net5.0/settings.targets index a8fa34134f435..bc6aa5222f105 100644 --- a/src/libraries/pkg/test/frameworkSettings/net5.0/settings.targets +++ b/src/libraries/pkg/test/frameworkSettings/net5.0/settings.targets @@ -1,7 +1,4 @@ - - $(MicrosoftNETCoreAppVersion) - diff --git a/src/libraries/pkg/test/frameworkSettings/netcoreapp/settings.targets b/src/libraries/pkg/test/frameworkSettings/netcoreapp/settings.targets index ce47469c3e060..6a7fbbe96d647 100644 --- a/src/libraries/pkg/test/frameworkSettings/netcoreapp/settings.targets +++ b/src/libraries/pkg/test/frameworkSettings/netcoreapp/settings.targets @@ -4,10 +4,6 @@ true true - - - true - true diff --git a/src/libraries/pkg/test/frameworkSettings/netcoreapp1.0/settings.targets b/src/libraries/pkg/test/frameworkSettings/netcoreapp1.0/settings.targets deleted file mode 100644 index f319b95868991..0000000000000 --- a/src/libraries/pkg/test/frameworkSettings/netcoreapp1.0/settings.targets +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/libraries/pkg/test/frameworkSettings/netcoreapp1.1/settings.targets b/src/libraries/pkg/test/frameworkSettings/netcoreapp1.1/settings.targets deleted file mode 100644 index 846df54fdc37b..0000000000000 --- a/src/libraries/pkg/test/frameworkSettings/netcoreapp1.1/settings.targets +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/libraries/pkg/test/frameworkSettings/netcoreapp2.0/settings.targets b/src/libraries/pkg/test/frameworkSettings/netcoreapp2.0/settings.targets deleted file mode 100644 index 4cfa63c93a5f0..0000000000000 --- a/src/libraries/pkg/test/frameworkSettings/netcoreapp2.0/settings.targets +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/src/libraries/pkg/test/packageTest.targets b/src/libraries/pkg/test/packageTest.targets index 81bb15d99b925..3234450ffcda0 100644 --- a/src/libraries/pkg/test/packageTest.targets +++ b/src/libraries/pkg/test/packageTest.targets @@ -1,10 +1,12 @@ - - + <_targetFrameworkVersionIndex>$(TargetFramework.IndexOfAny(".-0123456789")) <_targetFrameworkIdentifier Condition="'$(_runtimeOSVersionIndex)' != '-1'">$(TargetFramework.SubString(0, $(_targetFrameworkVersionIndex))) <_targetFrameworkIdentifier Condition="'$(_targetFrameworkIdentifier)' == 'net' and !$(TargetFramework.StartsWith('net4'))">netcoreapp + + + $(MSBuildThisFileDirectory)tools\ @@ -31,17 +33,14 @@ + - - <_message>Testing $(TestPackageID) TFM=$(TargetFramework) - <_message Condition="'$(RuntimeIdentifier)' != ''">$(_message) RID=$(RuntimeIdentifier) - - + + Condition="'$(ShouldVerifyClosure)' == 'true'"> <_refClosureFileNames Include="@(ReferencePath->'%(FileName)')"> %(Identity) @@ -57,7 +56,7 @@ + Condition="'$(ShouldVerifyTypes)' == 'true'"> <_refTypesFileNames Include="@(ReferencePath->'%(FileName)')"> %(Identity) @@ -71,11 +70,36 @@ IgnoredTypes="@(IgnoredTypes)" /> + + + + + + + + + + + + <_runtimeCopyLocalItemsPackages Include="@(RuntimeCopyLocalItems->'%(NuGetPackageId)')" + Exclude="@(ReferencePath->'%(NuGetPackageId)');$(TestPackageId)" /> + + + + + + + + + Inputs="%(RuntimeLibToTest.RuntimeIdentifier)" + Outputs="unused" + DependsOnTargets="PrepareForRuntimeTesting" + Condition="'$(ShouldVerifyClosure)' == 'true' and '$(SkipVerifyClosureForRuntime)' != 'true'"> + - <_runClosureFileNames Include="@(ReferenceCopyLocalPaths->'%(FileName)')"> + <_runClosureFileNames Include="@(RuntimeLibToTestDependency->'%(FileName)');@(RuntimeLibToTest->'%(FileName)')"> %(Identity) <_runClosureFileNamesFiltered Include="@(_runClosureFileNames)" Exclude="@(ExcludeFromClosure);@(ExcludeFromClosure->'%(Identity).ni')"/> @@ -88,10 +112,13 @@ + Inputs="%(RuntimeLibToTest.RuntimeIdentifier)" + Outputs="unused" + DependsOnTargets="PrepareForRuntimeTesting" + Condition="'$(ShouldVerifyTypes)' == 'true'"> + - <_runTypesFileNames Include="@(ReferenceCopyLocalPaths->'%(FileName)')"> + <_runTypesFileNames Include="@(RuntimeLibToTestDependency->'%(FileName)');@(RuntimeLibToTest->'%(FileName)')"> %(Identity) <_runTypesFileNamesFiltered Include="@(_runTypesFileNames)" Exclude="@(ExcludeFromTypes);@(ExcludeFromTypes->'%(Identity).ni')"/> @@ -105,55 +132,27 @@ + Condition="'$(_ShortFrameworkIdentifier)' == 'net' AND '$(_TargetFrameworkVersionWithoutV)' >= '4.6.1' AND '$(DisableVerifyNotDependsOnNetStandardTest)' != 'true'"> - <_testDependsOn> + LogBeginTest; VerifyNotDependsOnNetStandard; VerifyReferenceClosure; VerifyReferenceTypes; VerifyRuntimeClosure; VerifyRuntimeTypes; - + + + _ComputeTargetFrameworkItems + - - - - - - - - - <_projectRuntime Include="$(RuntimeIdentifiers)" /> - - - - $(IntermediateOutputPath)\.testComplete - - - $(IntermediateOutputPath)\%(_projectRuntime.Identity).testComplete - RuntimeIdentifier=%(_projectRuntime.Identity) - - - - - - - _getTestProjects - - $(TestDependsOn);ResolveReferences - - + DependsOnTargets="$(TestDependsOn)"> + diff --git a/src/libraries/pkg/test/project.csproj.template b/src/libraries/pkg/test/project.csproj.template index 9e6ab08111971..eb0b959b521e6 100644 --- a/src/libraries/pkg/test/project.csproj.template +++ b/src/libraries/pkg/test/project.csproj.template @@ -1,8 +1,7 @@ - {TFM} - {RIDs} + {TFMs} {PackageId} {PackageVersion} diff --git a/src/libraries/pkg/test/testPackages.proj b/src/libraries/pkg/test/testPackages.proj index 2dcacddce6c57..58a9c20092540 100644 --- a/src/libraries/pkg/test/testPackages.proj +++ b/src/libraries/pkg/test/testPackages.proj @@ -91,7 +91,7 @@ - $(TestProjectDir)%(Identity)/%(TargetFrameworkShort)/ + $(TestProjectDir)%(Identity)/ %(ProjectDir)project.csproj @@ -114,23 +114,6 @@ - - - <_supportedPackageRuntimes Remove="@(_supportedPackageRuntimes)" /> - <_supportedPackageRuntimes Include="%(SupportedPackage.RuntimeIdentifiers)" /> - - <_supportedPackageRuntimesToRemove Include="@(_supportedPackageRuntimes)" Exclude="@(RuntimesToInclude)" Condition="'@(RuntimesToInclude)' != ''" /> - <_filteredSupportedPackageRuntimes Include="@(_supportedPackageRuntimes)" Exclude="@(RuntimesToExclude);@(_supportedPackageRuntimesToRemove)" /> - - - @(_filteredSupportedPackageRuntimes) - - - - %(SupportedPackage.ProjectFile) <_packageId>%(SupportedPackage.Identity) <_packageVersion>%(SupportedPackage.Version) - <_projectTFM>%(SupportedPackage.TargetFrameworkShort) - <_projectRIDs>%(SupportedPackage.RuntimeIdentifiers) + <_projectTFMs>@(SupportedPackage->'%(TargetFrameworkShort)') - + From 62eb8717da666edf3bf0d308cbb5eb96268fc95e Mon Sep 17 00:00:00 2001 From: Eric StJohn Date: Wed, 2 Jun 2021 00:07:27 -0700 Subject: [PATCH 2/8] Upload binlogs for package testing --- src/libraries/sendtohelixhelp.proj | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libraries/sendtohelixhelp.proj b/src/libraries/sendtohelixhelp.proj index 3001a00bc110e..9b07398312b83 100644 --- a/src/libraries/sendtohelixhelp.proj +++ b/src/libraries/sendtohelixhelp.proj @@ -80,6 +80,7 @@ dotnet msbuild %HELIX_CORRELATION_PAYLOAD%\test.msbuild + $(HelixCommand) /bl:%HELIX_WORKITEM_UPLOAD_ROOT%\msbuild.binlog $(HelixCommand) /warnaserror $(HelixCommand) /p:PackageTestProjectsDir=%HELIX_WORKITEM_PAYLOAD% $(HelixCommand) /p:RestorePackagesPath=%HELIX_WORKITEM_PAYLOAD%\packages From ead401c7929f44bf8f746e8f1d49c6ddcc7456a6 Mon Sep 17 00:00:00 2001 From: Eric StJohn Date: Fri, 4 Jun 2021 11:17:13 -0700 Subject: [PATCH 3/8] Address feedback Simplify outer build of package tests to just use InnerTargets extension point. Use Helix's work-item isolated packages folder Give a better name to binlogs --- src/libraries/pkg/test/packageTest.targets | 11 +++-------- src/libraries/pkg/test/test.msbuild | 2 +- src/libraries/sendtohelixhelp.proj | 5 ++--- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/src/libraries/pkg/test/packageTest.targets b/src/libraries/pkg/test/packageTest.targets index 3234450ffcda0..dd5ebc4ae300c 100644 --- a/src/libraries/pkg/test/packageTest.targets +++ b/src/libraries/pkg/test/packageTest.targets @@ -137,7 +137,7 @@ - + LogBeginTest; VerifyNotDependsOnNetStandard; VerifyReferenceClosure; @@ -145,14 +145,9 @@ VerifyRuntimeClosure; VerifyRuntimeTypes; - - _ComputeTargetFrameworkItems - + Test - - - + diff --git a/src/libraries/pkg/test/test.msbuild b/src/libraries/pkg/test/test.msbuild index 6d0a6a47c6d11..e7ad573abf4df 100644 --- a/src/libraries/pkg/test/test.msbuild +++ b/src/libraries/pkg/test/test.msbuild @@ -27,6 +27,6 @@ - + \ No newline at end of file diff --git a/src/libraries/sendtohelixhelp.proj b/src/libraries/sendtohelixhelp.proj index 9b07398312b83..e048a7101c743 100644 --- a/src/libraries/sendtohelixhelp.proj +++ b/src/libraries/sendtohelixhelp.proj @@ -54,7 +54,7 @@ - + true true @@ -80,10 +80,9 @@ dotnet msbuild %HELIX_CORRELATION_PAYLOAD%\test.msbuild - $(HelixCommand) /bl:%HELIX_WORKITEM_UPLOAD_ROOT%\msbuild.binlog + $(HelixCommand) /bl:%HELIX_WORKITEM_UPLOAD_ROOT%\%HELIX_WORKITEM_FRIENDLYNAME%.package.test.binlog $(HelixCommand) /warnaserror $(HelixCommand) /p:PackageTestProjectsDir=%HELIX_WORKITEM_PAYLOAD% - $(HelixCommand) /p:RestorePackagesPath=%HELIX_WORKITEM_PAYLOAD%\packages $(HelixCommand) /p:LocalPackagesPath="%HELIX_CORRELATION_PAYLOAD%\packages\" From b3ed7fb43a799f279d5421921508e0b5431069b9 Mon Sep 17 00:00:00 2001 From: Eric StJohn Date: Fri, 4 Jun 2021 15:08:43 -0700 Subject: [PATCH 4/8] Cleanup old suppressions --- .../netstandard2.1/settings.targets | 90 ------------------- .../settings.targets | 7 -- .../settings.targets | 7 -- .../portable-net45+win8/settings.targets | 7 -- .../portable45-net45+win8/settings.targets | 7 -- .../portable46-net451+win81/settings.targets | 7 -- src/libraries/pkg/test/testPackages.proj | 4 - 7 files changed, 129 deletions(-) delete mode 100644 src/libraries/pkg/test/frameworkSettings/netstandard2.1/settings.targets delete mode 100644 src/libraries/pkg/test/frameworkSettings/portable-net45+win8+wp8+wpa81/settings.targets delete mode 100644 src/libraries/pkg/test/frameworkSettings/portable-net45+win8+wpa81/settings.targets delete mode 100644 src/libraries/pkg/test/frameworkSettings/portable-net45+win8/settings.targets delete mode 100644 src/libraries/pkg/test/frameworkSettings/portable45-net45+win8/settings.targets delete mode 100644 src/libraries/pkg/test/frameworkSettings/portable46-net451+win81/settings.targets diff --git a/src/libraries/pkg/test/frameworkSettings/netstandard2.1/settings.targets b/src/libraries/pkg/test/frameworkSettings/netstandard2.1/settings.targets deleted file mode 100644 index 1fbde1af9ed94..0000000000000 --- a/src/libraries/pkg/test/frameworkSettings/netstandard2.1/settings.targets +++ /dev/null @@ -1,90 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/libraries/pkg/test/frameworkSettings/portable-net45+win8+wp8+wpa81/settings.targets b/src/libraries/pkg/test/frameworkSettings/portable-net45+win8+wp8+wpa81/settings.targets deleted file mode 100644 index 72095adf9916e..0000000000000 --- a/src/libraries/pkg/test/frameworkSettings/portable-net45+win8+wp8+wpa81/settings.targets +++ /dev/null @@ -1,7 +0,0 @@ - - - .NETPortable - v4.5 - Profile259 - - \ No newline at end of file diff --git a/src/libraries/pkg/test/frameworkSettings/portable-net45+win8+wpa81/settings.targets b/src/libraries/pkg/test/frameworkSettings/portable-net45+win8+wpa81/settings.targets deleted file mode 100644 index 77255b7800253..0000000000000 --- a/src/libraries/pkg/test/frameworkSettings/portable-net45+win8+wpa81/settings.targets +++ /dev/null @@ -1,7 +0,0 @@ - - - .NETPortable - v4.5 - Profile111 - - \ No newline at end of file diff --git a/src/libraries/pkg/test/frameworkSettings/portable-net45+win8/settings.targets b/src/libraries/pkg/test/frameworkSettings/portable-net45+win8/settings.targets deleted file mode 100644 index e488ebf9aa53a..0000000000000 --- a/src/libraries/pkg/test/frameworkSettings/portable-net45+win8/settings.targets +++ /dev/null @@ -1,7 +0,0 @@ - - - .NETPortable - v4.5 - Profile7 - - \ No newline at end of file diff --git a/src/libraries/pkg/test/frameworkSettings/portable45-net45+win8/settings.targets b/src/libraries/pkg/test/frameworkSettings/portable45-net45+win8/settings.targets deleted file mode 100644 index e488ebf9aa53a..0000000000000 --- a/src/libraries/pkg/test/frameworkSettings/portable45-net45+win8/settings.targets +++ /dev/null @@ -1,7 +0,0 @@ - - - .NETPortable - v4.5 - Profile7 - - \ No newline at end of file diff --git a/src/libraries/pkg/test/frameworkSettings/portable46-net451+win81/settings.targets b/src/libraries/pkg/test/frameworkSettings/portable46-net451+win81/settings.targets deleted file mode 100644 index 463ffc65f149f..0000000000000 --- a/src/libraries/pkg/test/frameworkSettings/portable46-net451+win81/settings.targets +++ /dev/null @@ -1,7 +0,0 @@ - - - .NETPortable - v4.6 - Profile44 - - \ No newline at end of file diff --git a/src/libraries/pkg/test/testPackages.proj b/src/libraries/pkg/test/testPackages.proj index 58a9c20092540..872a3da0a1f64 100644 --- a/src/libraries/pkg/test/testPackages.proj +++ b/src/libraries/pkg/test/testPackages.proj @@ -12,7 +12,6 @@ - @@ -26,9 +25,6 @@ - - - From 990c9fde58180c2fb4f2af513cf970cd9ef7ffd1 Mon Sep 17 00:00:00 2001 From: Eric StJohn Date: Fri, 4 Jun 2021 16:47:18 -0700 Subject: [PATCH 5/8] Use ReferenceCopyLocalPaths for runtime testing This item will be conflict-resolved whereas RuntimeCopyLocalItems was not. Also fix the case where a package intentionally provides no assets (yet installs) --- src/libraries/pkg/test/packageTest.targets | 24 +++++++++++++--------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/libraries/pkg/test/packageTest.targets b/src/libraries/pkg/test/packageTest.targets index dd5ebc4ae300c..1645211257e00 100644 --- a/src/libraries/pkg/test/packageTest.targets +++ b/src/libraries/pkg/test/packageTest.targets @@ -16,6 +16,9 @@ https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6-transport/nuget/v3/index.json; $(LocalPackagesPath) + + + true @@ -72,24 +75,25 @@ - - + + + - - - <_runtimeCopyLocalItemsPackages Include="@(RuntimeCopyLocalItems->'%(NuGetPackageId)')" + + + <_referenceCopyLocalPathsPackages Include="@(ReferenceCopyLocalPaths->'%(NuGetPackageId)')" + Condition="'%(ReferenceCopyLocalPaths.RuntimeIdentifier)' == ''" Exclude="@(ReferencePath->'%(NuGetPackageId)');$(TestPackageId)" /> - + - + - + - + <_runTypesFileNames Include="@(RuntimeLibToTestDependency->'%(FileName)');@(RuntimeLibToTest->'%(FileName)')"> %(Identity) From a0db9db0731b78bc4c89ed5005b2915f87f1cdd3 Mon Sep 17 00:00:00 2001 From: Eric StJohn Date: Sun, 6 Jun 2021 14:07:35 -0700 Subject: [PATCH 6/8] Don't include runtime dependencies when reference was excluded by conflict resolution --- src/libraries/pkg/test/packageTest.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libraries/pkg/test/packageTest.targets b/src/libraries/pkg/test/packageTest.targets index 1645211257e00..6c2328cbd1d7d 100644 --- a/src/libraries/pkg/test/packageTest.targets +++ b/src/libraries/pkg/test/packageTest.targets @@ -87,7 +87,7 @@ <_referenceCopyLocalPathsPackages Include="@(ReferenceCopyLocalPaths->'%(NuGetPackageId)')" Condition="'%(ReferenceCopyLocalPaths.RuntimeIdentifier)' == ''" - Exclude="@(ReferencePath->'%(NuGetPackageId)');$(TestPackageId)" /> + Exclude="@(ReferencePath->'%(NuGetPackageId)');@(_ConflictPackageFiles->'%(NuGetPackageId)');$(TestPackageId)" /> From 6e98ff699924675a5cb1383ce3710552a7adc099 Mon Sep 17 00:00:00 2001 From: Eric StJohn Date: Mon, 7 Jun 2021 10:35:18 -0700 Subject: [PATCH 7/8] Fix import conventions in outer build --- src/libraries/pkg/test/packageTest.targets | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libraries/pkg/test/packageTest.targets b/src/libraries/pkg/test/packageTest.targets index 6c2328cbd1d7d..abc49c2feb872 100644 --- a/src/libraries/pkg/test/packageTest.targets +++ b/src/libraries/pkg/test/packageTest.targets @@ -26,8 +26,8 @@ - - + + From 6c60a8ff8a92c199ed8cf5cc71a816f59e12ff85 Mon Sep 17 00:00:00 2001 From: Eric StJohn Date: Mon, 7 Jun 2021 10:36:31 -0700 Subject: [PATCH 8/8] Workaround conflict resolution on .NETStandard runtime .NETStandard doesn't conflict resolve runtime assets. Workaround by feeding .NETStandard references as runtime for purposes of conflict resolution. --- .../test/frameworkSettings/netstandard/settings.targets | 8 ++++++++ src/libraries/pkg/test/packageTest.targets | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/libraries/pkg/test/frameworkSettings/netstandard/settings.targets b/src/libraries/pkg/test/frameworkSettings/netstandard/settings.targets index af593ca8234cb..e25068d3eceb1 100644 --- a/src/libraries/pkg/test/frameworkSettings/netstandard/settings.targets +++ b/src/libraries/pkg/test/frameworkSettings/netstandard/settings.targets @@ -14,4 +14,12 @@ + + + + + <_RuntimeAssetsForConflictResolution Include="@(Reference)" Condition="'%(Reference.NuGetPackageId)' == 'NETStandard.Library' or '%(Reference.NuGetPackageId)' == 'NETStandard.Library.Ref'" /> + + \ No newline at end of file diff --git a/src/libraries/pkg/test/packageTest.targets b/src/libraries/pkg/test/packageTest.targets index abc49c2feb872..29015e217fd70 100644 --- a/src/libraries/pkg/test/packageTest.targets +++ b/src/libraries/pkg/test/packageTest.targets @@ -87,7 +87,7 @@ <_referenceCopyLocalPathsPackages Include="@(ReferenceCopyLocalPaths->'%(NuGetPackageId)')" Condition="'%(ReferenceCopyLocalPaths.RuntimeIdentifier)' == ''" - Exclude="@(ReferencePath->'%(NuGetPackageId)');@(_ConflictPackageFiles->'%(NuGetPackageId)');$(TestPackageId)" /> + Exclude="@(ReferencePath->'%(NuGetPackageId)');$(TestPackageId)" />