-
Notifications
You must be signed in to change notification settings - Fork 253
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
There is a flaw in the file deployment process when using a DeploymentItem #490
Comments
@fredbleuzet : We would recommend you not to use deployment item until and unless you absolutely need it. Can you explain your scenario as to why do you need to deploy your files to a separate location and can't run your tests from bin/debug? |
Hi @jayaranigarg , it's a fair question. That is our particular case, I doubt it's an isolated case. |
@fredbleuzet : Thank you for the detailed explanation. We acknowledge this to be an issue and we are planning to fix this in our future releases. |
@jayaranigarg Is there any ETA on when the fix would happen. We have a huge test suite that we are looking to move to MSTest v2 and this is a problematic area for us. |
@hamidshahid : We pushed a fix for this yesterday. You can consume the fix for now from https://dotnet.myget.org/feed/mstestv2/package/nuget/MSTest.TestAdapter/1.4.0-build-20181031-01
We will update the documentation and release these packages on nuget in a while. |
Thanks @jayaranigarg. I will take the new package and test it out. Many thanks |
Fix has been released in latest(1.4.0) version of adapter. Please update your adapter and framework nuget packages to latest. Closing the thread for now. Please feel free to reopen if you hit this again. |
Description
I ran into an issue and it seems the process works the way it is described here https://msdn.microsoft.com/en-us/library/ms182475.aspx
In a way it's working as designed, but the design has a flaw as all the files from a dependency are not copied to the out folder.
Steps to reproduce
I created the project ClassLibrary1, a library with 1 class and 1 method.
To the ClassLibrary1 project I added TextFile1.txt file where the "Copy to Output Directory" is set to "Copy if newer". The 1 method reads the TextFile1.txt file.
Basically when I distribute ClassLibrary1, I need to provide both ClassLibrary1.dll and TextFile1.txt together.
I created a unit test project UnitTestProject1 with 1 test method that calls the 1 method.
3.a. If UnitTestProject1 doesn't have any deployment item, the test runs from the unit test's bin\Debug folder and all is well.
3.b When UnitTestProject1 has a deployment item, vstest copies to the Out folder the deployment item, UnitTestProject1.dll and ClassLibrary1.dll but not TextFile1.txt. In this case vstest copies a non-functional version of ClassLibrary1 because its whole package is not copied.
Expected behavior
If UnitTestProject1 depends on a dependent project, all the files defined as output to this dependent project should be copied to the Out folder, even non-dll files, because the dlls and non-dlls make a whole functional set of files.
This is very much what a compiler does on an application ConsoleApp1 with a dependency on the ClassLibrary1. When ConsoleApp1 compiles, the compiler brings into its bin\Debug both ClassLibrary1.dll and TextFile1.txt, because that makes a whole functional file set.
Actual behavior
Because non dll files are not copied, when I have a dependent project I also need to add as deployment items all the files that are not dlls. This is the flaw.
Compared to the console project, the compiler doesn't need me to add the non-dll files from the ClassLibrary1 project into ConsoleApp1.csproj.
Environment
Any, it works as described, it's easy to reproduce.
The text was updated successfully, but these errors were encountered: