Skip to content

Test Adapter: parametrized tests are discovered/logged to data collector as 1 test (no information about specific parameters) #340

Description

@pkrukp

Description

Hi,

MsTest tests may be parametrizable, for example a method with DataTestMethod and DataRow attributes. For example:

        [DataTestMethod]
        [DataRow("baz", false)]
        [DataRow("foo", true)]
        public void TestMethod(string name, bool expectedResult)

Current behavior

For such test, MsTest Test Adapter:

  1. during test discovery, only 1 VSTest TestCase is discovered (which represents whole TestMethod)
  2. during test execution, the method is executed for data row, but VSTest's DataCollectors (both In-Proc and out of process) receive only 1 TestCaseStart/TestCaseStop event (for TestMethod)

Desired behavior

Would it be possible to have per data row discovery/logging resolution? That is, ideally:

  1. discovery would discover 2 test cases: TestMethod("baz", false) and TestMethod("foo", true)
  2. DataCollector would receive TestCaseStart/TestCaseStop for both above test cases

In fact, the 2nd point is more important for me - I would like to change environment and monitor each execution of TestMethod (for each data row separately).

If it is not possible, could you please share the reason?

Thanks

Environment

mstest.testadapter.1.2.0
microsoft.testplatform.15.6.0-preview-20171211-02

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions