testfx icon indicating copy to clipboard operation
testfx copied to clipboard

Debug test with specific DataRow

Open JVimes opened this issue 9 years ago • 10 comments

I think there's no way to debug a parameterized test with a user-selected set of data. I have to let it loop through all the DataRows, hitting my breakpoint repeatedly, until I get to the parameter values that I want.

Suggest adding a right-click menu to the bottom pane of Test Explorer with a "Debug this test case" entry. It debugs the test with just that case's DataRow: image

JVimes avatar Apr 28 '17 18:04 JVimes

That's true, the workflow of debugging a data driven test needs improvement. We could either go via the approach you suggested above or start showing each row in a data driven test as a separate Test in the test list itself. So the test explorer would start to read: Failed Tests (2)

OutputFile_DefaultValue("FailingVal1")

OutputFile_DefaultValue("FailingVal2")

Passed Tests (2)

OutputFile_DefaultValue("PassingVal1")

OutputFile_DefaultValue("PassingVal2")

Skipped Tests (1)

OutputFile_DefaultValue("SkippedVal1")

Since these are distinct test cases of their own one can run/debug a subset instead of all of them. This does not however provide an overview for the base test method but I'm not really sure how important that is, given that each of the data rows are running separate test cases anyway. /cc: @pvlakshm

AbhitejJohn avatar Apr 28 '17 20:04 AbhitejJohn

Please don't do that 😨 NUnit takes that approach, and it makes the list painful to browse because there are way too many entries. MSTest's current approach makes the list much more browsable. That extra level of hierarchy is so nice.

JVimes avatar Apr 28 '17 21:04 JVimes

Got it. I cannot seem to figure out an existing paradigm where we can fit this in though. The test details pane where the tests show up is more of a non-actionable container with metadata. I'm wondering if we can leverage the drop-down where test status shows in your diagram(Passed/Failed/Skipped) to get it showing for data driven tests as well.

Tagging @sbaid @pvlakshm @codito @navin22 @rahulpaw.

AbhitejJohn avatar May 02 '17 19:05 AbhitejJohn

That would solve the root problem (need for a level of hierarchy for multiple results). I feel like MSTest is changing to support Test Explorer, though. It should probably be the other way around. Who owns the Test Explorer code?

JVimes avatar May 02 '17 20:05 JVimes

I've tagged everyone on this thread. We need to figure out an experience for this. Here are the suggestions we have at present:

  1. Running it from the Test details pane(which was what @JVimes initially suggested above)
  2. Running it from the Test Explorer item list window itself under a drop down that holds the summary result and each individual item shows up under that drop down when expanded. This just pulls the data from the test details pane to the currently actionable pane where Run/Debug works.

AbhitejJohn avatar May 03 '17 12:05 AbhitejJohn

Added this issue in Visual studio developer community. Hence closing this issue. https://developercommunity.visualstudio.com/content/problem/158617/debug-test-with-specific-datarow.html

snkota avatar Dec 01 '17 04:12 snkota

We are separating out IDE related issues from the core test framework related issues. We a tracking core test framework related issues in this repo, and are requesting that issues related to Test Explorer, sln/proj file support, and other IDE related issues be filed via VSFeedback (as mentioned in the issue template). Accordingly, closing the issue here.

pvlakshm avatar Dec 01 '17 04:12 pvlakshm

i got around this by just commenting out the DataRow attributes that i wasn't debugging @ the moment

mariotee avatar Apr 25 '19 14:04 mariotee

I don't like changing the order of DataRow or commenting out others because it requires compilation of the DLL. When the test library is large, compilation takes time.

gqqnbig avatar Sep 10 '19 18:09 gqqnbig

maybe its better to make some functionality to VS that will allow to right mouse button on specific data row and select "debug with data row" and it will debug with that data row you clicked?

3263927 avatar Oct 09 '24 21:10 3263927