简体   繁体   English

如何将MTM测试用例从TFS 2013迁移到VSTS?

[英]How to migrate MTM Test Cases from TFS 2013 to VSTS?

We have a legacy of thousands of manual Test Cases created in Microsoft Test Manager in our on premises TFS 2013. 我们在本地TFS 2013中的Microsoft Test Manager中创建了数千个手动测试用例

We are trying to move them to VSTS and it proved to be difficult. 我们正试图将它们转移到VSTS ,事实证明这很困难。


I. 一世。

As far as I can see at the moment there is no official migration tool from Microsoft, although they are working on one for full data migration 据我所知,目前还没有来自微软的官方迁移工具,尽管他们正在开发一个完整的数据迁移工具


II. II。

We've tried a few third party tools: 我们尝试了一些第三方工具:

  • OpsHub - free version has a 2500 limit which we exceed, and we can't justify $5,000 cost of commercial version OpsHub - 免费版本有超过2500限制,我们无法证明商业版本的5,000美元成本
  • TFS Integration Tools - doesn't seem to migrate Test Cases at all (documentation by the link confirms this) TFS集成工具 - 似乎根本没有迁移测试用例(链接的文档证实了这一点)
  • MTMCopyTool - doesn't seem to migrated Steps of Test Cases, leaves them empty MTMCopyTool - 似乎没有迁移测试用例的步骤,将它们留空

III. III。

We've also tried exporting-importing TFS\\VSTS Query in Excel. 我们还尝试在Excel中导出导入TFS \\ VSTS查询。 Which seems to export Steps too but all of them concatenated in one field, no even new line character between them, which makes it quite messy. 这似乎也导出了步骤,但所有这些都在一个字段中连接,它们之间甚至没有新的行字符,这使得它非常混乱。


IV. IV。

We've also tried using third part tool to export-import via Excel: 我们还尝试使用第三方工具通过Excel导出导入:

For a one-shot migration I can suggest a couple of options: 对于一次性迁移,我可以建议几个选项:

  1. From the test hub in your on-premises web access, create a test plan including all the test cases and then switch to the grid view in the main pane. 从本地Web访问中的测试中心创建包含所有测试用例的测试计划,然后切换到主窗格中的网格视图。 There you can select and copy all test cases (including steps, expected results and other test case fields) and paste them into the equivalent view in the VSTS project. 在那里,您可以选择并复制所有测试用例(包括步骤,预期结果和其他测试用例字段),并将它们粘贴到VSTS项目中的等效视图中。

  2. Create a powershell script that gets all the test cases from your on-premises TFS and copies them into VSTS. 创建一个powershell脚本,从内部部署TFS获取所有测试用例并将其复制到VSTS中。 Below you can find a snippet. 您可以在下面找到一个片段。 Caveat: I have not tested it extensively, so usual disclaimers apply. 警告:我没有对它进行过广泛的测试,因此通常的免责声明适用。 Please add additional fields you may want to copy. 请添加您可能要复制的其他字段。

     $VerbosePreference = "Continue" $tfsSource="the collection url that you want to copy form (eg. http://yourserver/tfs/yourcollection)"; $tpSource="the team project containing the test cases you want to copy form"; $tfsDest="the collection url that you want to copy to (eg. https://youraccount.visualstudio.com/DefaultCollection"); $tpDest="the team project containing the test cases you want to copy to"; [Reflection.Assembly]::LoadWithPartialName('Microsoft.TeamFoundation.Client') [Reflection.Assembly]::LoadWithPartialName('Microsoft.TeamFoundation.TestManagement.Client') [Reflection.Assembly]::LoadFile("C:\\Program Files (x86)\\Microsoft Visual Studio 12.0\\Common7\\IDE\\PrivateAssemblies\\Newtonsoft.Json.dll") $sourceTpc = [Microsoft.TeamFoundation.Client.TfsTeamProjectCollectionFactory]::GetTeamProjectCollection($tfsSource) $sourceTcm = $sourceTpc.GetService([Microsoft.TeamFoundation.TestManagement.Client.ITestManagementService]) $sourceProject = $sourceTcm.GetTeamProject($tpSource); $sourceTestCases = $sourceProject.TestCases.Query(“SELECT * FROM WorkItem”); $destTpc= [Microsoft.TeamFoundation.Client.TfsTeamProjectCollectionFactory]::GetTeamProjectCollection($tfsDest) $destTcm = $destTpc.GetService([Microsoft.TeamFoundation.TestManagement.Client.ITestManagementService]) $destProject = $destTcm.GetTeamProject($tpDest); foreach ($tc in $sourceTestCases) { Write-Verbose ("Copying Test Case {0} - {1}" -f $tc.Id, $tc.Title) $destTestCase= $destProject.TestCases.Create(); $destTestCase.Title = $tc.Title; $destTestCase.Priority = $tc.Priority; foreach ($step in $tc.Actions) { $destStep= $destTestCase.CreateTestStep(); $destStep.Title= $step.Title $destStep.TestStepType= $step.TestStepType $destStep.Description= $step.Description $destStep.ExpectedResult= $step.ExpectedResult; $destTestCase.Actions.Add($destStep); } $destTestCase.Save(); } 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM