-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change package testing to use RuntimeTargets rather than RID-specific restore #53575
Conversation
Tagging subscribers to this area: @Anipik, @safern, @ViktorHofer Issue DetailsFixes #2017 @Anipik and I were playing around with this today and realized we were very close to enabling package testing using just single restore. I went ahead and finished our prototype. This should greatly reduce the restore cost and total duration of package testing. @ViktorHofer this should unblock #53439
|
<RuntimeLibToTestDependency Include="@(ReferencePath)" Condition="'%(ReferencePath.NuGetPackageId)' != '$(TestPackageId)'" /> | ||
|
||
<!-- Some dependent packages may be excluded from compile, consider these as candiates as well. | ||
We assume they must expose a RID agnostic asset, thus we only check RuntimeCopyLocalItems. --> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be more correct / replicate the actual runtime behavior here we would need to replicate the host selection logic to test with the right runtime assets for dependencies. It's not so interesting to do this type of testing since the SDK doesn't make it possible for a library to reference a runtime specific asset of another library or project, and we don't typically do this with our custom config system. It's bad practice for library to depend on implementation-only publics of another library; if one library needed it why wouldn't a customer library need it?
So the asset analysis ends up looking like this:
- Package under test: Foreach runtime asset group
- Package dependencies w/ exclude=comple: RID-less runtime asset group
- Package dependencies w/o exclude=compile: compile asset group
- Framework: ref-pack / reference assemblies only.
Note that 2-4 are changes from what we previously did, but these are "safe" changes, since if these validations succeed then API compat will ensure that transitively things should succeed.
I broke this in a hilarious way. The structure of the package testing projects used to be
I removed the TFM since I can make the projects cross-target now that they don't need RIDs
When hexlix runs these, it's removing the packageId folder and placing the project in the root. In the same directory as the
Then what happens is all the package content gets globbed as Guess I need to restructure the helix test directories for these 😆. |
As an alternative, you could also disable the globbing. |
As you are removing some of the frameworkSettings files, why not remove the portable and netcore50 as well? |
I'm removing the ones that were no longer needed due to the change I made, since they were related to using the RuntimeIdentifier, or testing against runtime assemblies. I'll consider cleaning others if they're clearly dead code, but I don't want to feature creep this PR.
I don't think that's necessary. Better to keep projects simple rather than mess with them to accommodate a wacky thing that customers should never do (putting packages restore folder under project). |
So it turns out we can even delete the custom packages folder as Helix already does this for us: I'm looking into keeping the binlog, but only uploading it when there is a failure. |
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
This item will be conflict-resolved whereas RuntimeCopyLocalItems was not. Also fix the case where a package intentionally provides no assets (yet installs)
PKCS test is failing due to dotnet/sdk#18129. I'm planning to change how I did the workaround for this. Previously I was relying on conflict resolution dropping a compile asset to indicate what package references should not be considered when evaluating closure of runtimes, but this doesn't work if the packages that should have been dropped were Exclude=compile. I'm either going to feed all the ref-pack assets into conflict resolution for consideration at runtime as well, or I'll leverage the |
.NETStandard doesn't conflict resolve runtime assets. Workaround by feeding .NETStandard references as runtime for purposes of conflict resolution.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
Fixes #2017
@Anipik and I were playing around with this today and realized we were very close to enabling package testing using just single restore. I went ahead and finished our prototype. This should greatly reduce the restore cost and total duration of package testing.
@ViktorHofer this should unblock #53439