Skip to content
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

Debug test with specific DataRow #171

Closed
JVimes opened this issue Apr 28, 2017 · 10 comments
Closed

Debug test with specific DataRow #171

JVimes opened this issue Apr 28, 2017 · 10 comments

Comments

@JVimes
Copy link

JVimes commented Apr 28, 2017

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

@AbhitejJohn
Copy link
Contributor

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

@JVimes
Copy link
Author

JVimes commented Apr 28, 2017

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.

@AbhitejJohn
Copy link
Contributor

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.

@JVimes
Copy link
Author

JVimes commented May 2, 2017

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?

@AbhitejJohn
Copy link
Contributor

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.

@snkota
Copy link

snkota commented Dec 1, 2017

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

@pvlakshm
Copy link
Contributor

pvlakshm commented Dec 1, 2017

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 pvlakshm closed this as completed Dec 1, 2017
singhsarab pushed a commit to singhsarab/testfx that referenced this issue Apr 8, 2019
* Fix sign issue with unix build. Workaround for dotnet-cli microsoft#2862.
* Use case insensitive search in file helper enumerate.
Fix an issue where adapters path is not provided to test host because there
were no matching adapters due to a case sensitive search on unix.
* Move test plugin cache to case insensitive file search.
* Fix unit tests. Add modified string resources.
@mariotee
Copy link

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

@gqqnbig
Copy link

gqqnbig commented Sep 10, 2019

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.

@3263927
Copy link

3263927 commented Oct 9, 2024

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants