Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Steve Dower
@zooba
Normally we put them in a .testsettings file
Otherwise the logic for possibly restarting VS between each test would get complicated
Sam Harwell
@sharwell
Any difference between that and .testrunconfig?
Sam Harwell
@sharwell
Yes
Steve Dower
@zooba
Guess it should be okay then
You'll need to explicitly load it through the Test, Test Settings menu
Sam Harwell
@sharwell
Alright I loaded it
Do I need any attributes on the test method(s)?
Steve Dower
@zooba
Just the HostType
Sam Harwell
@sharwell
So just [TestMethod, HostType("VSTestHost")]
Steve Dower
@zooba
Yep
Sam Harwell
@sharwell
omg it worked... ish
What do I use instead of UIThreadInvoker.Invoke?
Steve Dower
@zooba
Microsoft.VisualStudio.Shell.ThreadHelper.Generic.InvokeAsync() or BeginInvoke() if you need to cover 2012 too
There are also task factories on the ThreadHelper class that are good options too
The synchronous Invokes may have race conditions, so be careful.
Sam Harwell
@sharwell
ThreadHelper.Generic.Invoke resulted in a NullReferenceException. I'm referencing Microsoft.VisualStudio.Shell.10.0
Steve Dower
@zooba
Yeah, it doesn't go back that far. Shell.11.0 at least for it to be reliable
Sam Harwell
@sharwell
Application.Current.Dispatcher.Invoke
omg make it stop
blob
Steve Dower
@zooba
Just making sure all the TFS-expats learn how to use git :)
Sam Harwell
@sharwell
it appears on every single test
and the test run stops until you click it
Let me clarify
I would like that message to not appear, but not if it means we go back to not being able to attach a debugger.
Steve Dower
@zooba
Oh really? That's odd
Have you actually got a project outside the sln dir?
Sam Harwell
@sharwell
Good point, this could be local to just this test
since it does create a project
Let me just go ATTACH A DEBUGGER :clap:
Steve Dower
@zooba
You can also disable the source control provider in the experimental hive
Sam Harwell
@sharwell
Is there a way to associate a testsettings file with a project, so we don't have to select it manually and also so we can just click Run All in test explorer?
omg it's late. out for now :D
Sam Harwell
@sharwell
Question: Does it work with NUnit or just MSTest?
Bonus points if it works in MSTest+xunit ;)
Steve Dower
@zooba
No idea, but I'd guess not. It's a wrapper around some of the MSTest interfaces to support execution in a remote process, so any other framework will probably require its own wrappers.
Nunky Lado
@Nopski
Hello! I'm new here
Omer Raviv
@OmerRaviv
Welcome @Nopski !
Nunky Lado
@Nopski
Thanks
Ahmet Mersin
@synonymys
hi
Omer Raviv
@OmerRaviv
Hi
Jamie Cansdale
@jcansdale
Some familiar faces in here! :wave:

I was pulling my hair out trying to get this to work until I read @zooba 's comment.

The assembly should be in GAC

I'd never have thought about looking in there.

Omer Raviv
@OmerRaviv
@jcansdale Hah. Yes. Tricky stuff
Paulo Morgado
@paulomorgado
not really the place, but here goes: does any one know if it's possible to run vstest.console.exe in a way that doesn't end with exit code 1 if there are tests in error?
mmaayann
@mmaayann
Hi, how can I install TestHost for Visual Studio 2019?
Sam Harwell
@sharwell
@mmaayann Are you trying to write new tests, or trying to run tests for a project that already used TestHost?
If you are trying to write new tests, I am not aware of a better approach currently available than josetr/VsixTesting. This is what I used for the integration tests in dotnet/roslyn-sdk#532.