-
Notifications
You must be signed in to change notification settings - Fork 323
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
How to use Microsoft.TestPlatform.Portable in dotnet global tool #1948
Comments
Can you please elaborate your setup? where do you include this:
From what i was able to understand: Ideally if your mutation testing framework requires vstest.console as a dependency then it is better to add a nuget reference to https://www.nuget.org/packages/Microsoft.TestPlatform in your framework and ensure it is bundled along with your tool. |
@ShreyasRmsft We only need vstest.console so we do not need the full set of binaries and we reference https://www.nuget.org/packages/Microsoft.TestPlatform.Portable I don't seem to get the content of the package bundled with my tool, nor does nuget seem to restore the package on the target system when installing the dotnet core global tool even though it is listed as a dependency. I would appreciate some advice on how to best bundle vstest with our framework. |
@Mobrockers you will have to author a post build .targets file that copies the package from the packagecache folder to the bin folder. |
Thanks, we have implemented a similar solution. |
Are there any updates on this issue? I'm having the same problem, is Post Build Event the official solution, I think it's ugly. If so, can you give an example? The version of the package that references microsoft.testplatform.portable is dynamic and I don't know how to confirm the version number in Post Build Event |
I solved it like this: I created a 'fake' ptoject file which contains the portable package as a dependency: In the pipeline I have a restore step to restore this package to a specific folder: https://github.com/stryker-mutator/stryker-net/blob/v1.0/azure-pipelines.yml#L261-L267 In our actual project csproj I added a wildcard embedded resources import for any .nupkg file that looks like it's microsoft testplatform portable: Then I made a helper class to deploy vstest portable from embedded resources to the temp folder on the target machine: |
@rouke-broersma Thank you for sharing, after reading I think I will finish this workround soon. |
Description
For our mutation testing framework we integrate with vstest using the translationlayer package. Since we cannot be sure vstest.console is available on the target system, we include Microsoft.TestPlatform.Portable to ensure the vstest binaries exist on the system. This used to work fine for dotnet cli extensibility tool but we are migrating to dotnet global tool (for dotnet full framework support) and the portable package seems to not be installed with the dotnet global tool on the target system. Can anyone provide some guidance as to how we can use the portable package to make vstest available to our dotnet global tool package?
The text was updated successfully, but these errors were encountered: