LabDefaultTemplate-> ExecuteRemoteTestRun2 doesn&#

2019-07-18 09:39发布

问题:

The Scenario:

  1. Create 2 codedui tests. First Test will be Test1 and the second Test2.

  2. Create 2 test cases in the mtm.

  3. Create 2 suites in the MTM. Suite1 and Suite2.

  4. Add to Suite1 the tests in the following order, Test1 then Test2.

  5. Add to Suite2 the tests in the following order, Test2 then Test1.

Now create a build with the template "LabDefaultTemplate" In the Tests add Suite1 and Suite2

Now Use the MTM and change the order of the tests in the suites and run the build again.

The Test Agent run the tests in the Suites in the order they where inserted and will not use the order field.

We user Test controller 2013, Test Agent 2013 , TFS 2013.

Now for the Details.

The WorkFlow LabDefaultTemplate runs the following activity "ExecuteRemoteTestRun2"

In the method TestRunCreation.CreateTestRun the test point is requested according to the suite and configuration

We can see that the Select has no "Order by" and this is the reason we got the test no in the order of the Test in the Suite.

  private ITestRun CreateTestRun(CodeActivityContext context, ITestManagementService testManager, ITestManagementTeamProject project)
      {
....

foreach (ITestPoint point in (IEnumerable<ITestPoint>) this.plan.QueryTestPoints(string.Format((IFormatProvider) CultureInfo.InvariantCulture, "SELECT * FROM TestPoint WHERE SuiteId={0} AND ConfigurationId={1}", new object[2]
              {
                (object) testSuiteId,
                (object) this.TestParameters.Get((ActivityContext) context).TestConfigurationId
              })))
              {
                flag = true;
                testRun.AddTestPoint(point, (TeamFoundationIdentity) null);
              }

I think it is a bug, Can someone approve it?

What is the workaround for execution of suite in the order of the MTM.

Barak