-
Notifications
You must be signed in to change notification settings - Fork 153
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
Integrate TestAssemblyLoadContext changes to version315 #1376
Integrate TestAssemblyLoadContext changes to version315 #1376
Conversation
@OsirisTerje - This is probably more complicated than I'm assuming you were expecting when you suggested raising this PR for If you do still want to go ahead with this, is there anything that I need to know around building/testing the changes that were done to the different packages files (cake/choco/msi)? |
I think we should try to move on with this. There are a comprehensive suite of tests in the console. Do all of them run?
PS: I am on travel now, and my laptop doesnt have all the frameworks installed, and slow internet lines, so I can't check it. I also got some vulnerability warnings. |
Okay, finally found a few minutes to troubleshoot this. Had to add some extra dependencies for .NET 5 and .NET 6. Verified tests all pass on Windows, I don't have any way to easily test on other platforms. Attached build/test log given the above command. |
@OsirisTerje - Quick bump in case this you missed this one. |
Not missed, but lack of time. I need to work through the different changes you have done, to ensure the bugs in 3.16.X is not coming over. Even if you're pretty sure it is, a second look here should be done. |
Sounds good! Absolutely no pressure intended from my end. I'm not blocked in any way, just wanted to make sure it wasn't lost in the cracks (because I took so long for the original follow up). |
|
Cherry-picked from 3f854b2
Cherry picked from f11499a
Try to load assembly from trusted list, before to start using some complex logic and enumerate AdditinalFrameworkDirectories Improve logging for assembly resolving process
(cherry picked from commit f642e99)
Loading of unmanaged assemblies suffers from the same issues as loading managed assemblies in that the wrong deps.json is used by default. This updates the TestAssemblyLoadContext to use the exact same pattern for loading unmanaged assemblies as managed assemblies. 1. Use the default assembly loading logic (I'm unsure if we actually need this since, in both managed and unmanaged, the base AssemblyLoadContext logic is a no-op and it's actually the VM that has some logic for loading assemblies). 2. Use an AssemblyDependencyResolver for the test assembly. 3. Check in the same folder as the test assembly (in case the dependencies are not fully specified in deps.json). Resolves nunit#1253
696af74
to
87d6996
Compare
…hich were added/merged after this PR was created.
Okay, I just rebased this onto version3X and retargeted the PR. I had to make some extra changes because .NET 7 and 8 support were added, but everything seems to build and test fine now.
Is there some semi-automated way to do this? I got as far as figuring out how the nunit3-vs-adapter repo builds, and I feel like I would need to publish a NuGet package with my updated binaries, then rebuild the adapter and then pull it into a test project. I did the bare minimum testing and it seemed to work:
|
@veleek I merged this now, but noticed that the |
As part of PR nunit#1376, 3f854b2 was integrated into the `version3X` branch. The `main` branch only includes net6.0 in the package so it copies all dependencies into the root folder and references them from there (including Microsoft.Extensions.DependencyModel.dll). In `version3X` the package includes both net6.0 and net8.0 dependencies so the binaries are referenced from sub-folders, so when the change was merged, it was referencing `Microsoft.Extensions.DependencyModel.dll` when it should have been looking in `net6.0/Microsoft.Extensions.DependencyModel.dll`.
I just opened #1406 to deal with this. |
As per discussion in #1370, this change integrates all of the updates to TestAssembyLoadContext (nee CustomAssemblyLoadContext) from the
main
to theversion315
branch. Unfortunately, there have been some changes to some of the packaging bits and pieces in order to add in the extra library used by TestAssemblyResolver, so I had to get those changes all merged as well.Here is the set of commits that touched
TestAssemblyLoadContext.cs
andTestAssemblyResolver.cs
(from oldest to newest) and what I did to resolve them:3f854b2 - Manual resolution needed to deal with packaging changes due to new dependency.
f11499a - Do we need this change? I merged the modifications to TestAssemblyLoadContext but just ignored everything else related to project changes for extra tests.
485153d - Clean
b01ad3e - Clean
38d141e - Clean
462d9d2 - Clean