-
Notifications
You must be signed in to change notification settings - Fork 256
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
3.4 is not working with Fakes #3003
Comments
Could you please provide some more details? Are you using |
I can only reproduce it on Azure DevOps, not locally; Pipeline bits
ProjectX
TestProject
TestProject\Fakes\ProjectX.fakes
If I build & run the tests locally in VS it works. Both running the tests in VS and running the .exe directly works. Also tried this in the pipeline with the same result:
|
what's the VS version on your local machine vs your CI? we recently updated the MSBuild props/targets files to include the Fakes dependencies in the executable's runtime configuration with older VS versions, assembly resolution only works via |
On local machine 1 I have So it is expected that Fakes with 3.4.x does not work with VS <17.10 unless using VSTest@2? |
Yes, that's expected. You'd need to have a custom assembly resolver to resolve the dlls from .exe's folder without the correct runtime configuration. |
So it's an undocumented breaking change, since 3.3.1 works fine? |
if it's been working via a @Evangelink are you aware of any changes to assembly resolution in MSTest? |
Outside of the bugs of 3.4.0 where the resolver wasn't triggered or the infinite recursion with resources not that I am aware of. |
@Evangelink What infinite recursion with resources are you referring to? I couldn't find any related bug.
Both with MSTest 3.3.1 and 3.4.0. However I cannot directly relate it to MSTest |
I am referring to #2692.
Could you please provide either a repro or diagnostic logs (see https://github.com/microsoft/vstest/blob/main/docs/diagnose.md) |
Ok, that is a different one.
If I can reproduce it reliably, I'll create an issue. Thanks. |
Awesome, thank you @cbersch |
VS was updated to 17.10 by actions/runner-images#9965 but I still see an 'invalid'
The |
ping @drognanar |
I just pushed a new package https://www.nuget.org/packages/Microsoft.Testing.Extensions.Fakes that should support Fakes and the new MSTest runner working side by side. If you replace the existing Microsoft.QualityTools.Testing.Fakes package reference with the new extension reference it will pick up all of the environment variables as well as add the relevant instrumentation files to the bin folder to ensure that shims can be executed. |
I think you forgot to push the dependency |
Thanks for letting me know. Will update on the thread, once new packages are built and published. |
Updated both of the packages |
The result seems to be the same with
Are you perhaps able to spin up an Azure DevOps build yourself and reproduce it? |
I rolled back the targets file change locally and was able to reproduce it. By bisecting the MSTest repo, the first package where this behaviour changed is this one #2654, so I'll let @Evangelink take a further look |
@Rans4ckeR could you please confirm that when using a more recent version of VS the extension is working fine? |
When locally using When compiling on Azure DevOps using The current runners on Azure DevOps are using The difference might be that |
I guess the difference is the version of MSBuild being inserted/available in For the change in the version of MSTest. We introduced support of assembly resolution for .NET Core in #2110 but received many bugs related to this new feature as it's impacting how assemblies are being resolved by .NET so we decided to only plug the assembly resolver (for .NET Core) when user is asking for You will either need to wait for AzDO to contain the correct preview version of VS that contains the fix (@drognanar could you please confirm the version) or you will need to use |
The Fakes changes that makes Fakes assemblies load even without a custom assembly loader |
Closing the issue as completed. |
3.4.0 and 3.4.1 are both not working while 3.3.1 was fine for this scenario:
The Fakes assemblies cannot be resolved, each test that uses them outputs:
System.IO.FileNotFoundException: Could not load file or assembly 'ProjectX.Fakes, Version=x.x.x.x, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.
.Where ProjectX.Fakes.dll is present in the output folder next to ProjectY.exe.
Originally posted by @Rans4ckeR in #2922 (comment)
The text was updated successfully, but these errors were encountered: