TFS API: Cannot add testpoint after testrun is saved

半城伤御伤魂 提交于 2019-12-13 14:04:26

问题


(Environment: VSTS2010 using IronPython and the TFS SDK)

Workflow #1 The following workflow behaves as I expect:

  1. Create a new testrun
  2. Add testpoint(s)
  3. Save testrun

My expected behavior: The testrun is saved with the testpoints.

Observed behavior: Matches my expected behavior - verified with a testrun.QueryTestResults() call.

Workflow #2 The following workflow does not behave as I expect:

  1. Create a new testrun
  2. Add testpoint
  3. Save testrun
  4. Add another testpoint
  5. Save testrun

My expected behavior: The testrun should be saved with the test points.

Observed behavior: The first testpoint is saved. All other testpoints after the initial save do not get saved. There are no errors thrown or any feedback from the SDK indicating failures.

Workflow #3 Similarly, the following workflow does not behave as I expect:

  1. Get an existing testrun by id testManagementService.QueryTestRuns("SELECT * FROM TestRun WHERE TestRunId=%s" % testrunId)
  2. Add testpoint
  3. Save testrun

My expected behavior: The testrun should be saved with the test points.
Observed behavior: The added testpoint is not added. There are no errors thrown or any feedback from the SDK indicating failures.

Can anyone explain why the observed behavior differs from my expected behavior on workflows #2 and #3?

UPDATE (2012-11-16 12:00 CST)

Answering (editing) my own question since digging for this was not straight forward.

I found the following paragraph at http://blogs.msdn.com/b/nidhithakur/archive/2011/04/08/importing-testcase-results-to-mtm.aspx after doing a msdn.microsoft.com serach (search terms: itestrun add testpoint failure).

To be able to add results to this test plan, create a new test run in the test plan. map the test points which are present in the dictionary and add to this test run. Ideally, you should be able to add the results while adding the test point to the run but the run.Save() API is only working for single Save right now. So, you will need to add all the testpoints, save the test run and then iterate over the run collection to add results individually. For better performance, save the result collection once after all the results have been added/updated.

So this appears to be a limitation with VSTS2010. You cannot add test points after the first testrun save.

来源:https://stackoverflow.com/questions/13421927/tfs-api-cannot-add-testpoint-after-testrun-is-saved

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!