Wednesday, November 7, 2012

TFS Aministration - How To Modify a WorkItem Type In Project A Based on Project B


I recently made a purchasing decision for our company to invest in Microsoft Test Manager. This is a shop that uses TFS for source control, work item tracking, and continuous integration. It made sense to leverage the mighty TFSWarehouse for my quality metrics as well. The down side of the decision in general is cost and complexity of administration. I am ok with the administration tasks personally, so for my team I can mitigate that concern. The value of the quality reporting solution mitigates the cost, at least at this company. I would sya that if we were using a setup like Team City (or Cruise Control), a Kanban board, and Mercurial I would be far less likely to make this same decision. The value would not be there as it would require a bunch integration patches just to execute test cases associated with automation.

A recent issue I had is the reason for this post. One team was unable to leverage the UI controls to create test steps and shared steps. I originally thought this was an issue with us working in a mixed MTM 2012 / TFS 2010 environment. It turns out the test case and shared step templates were out of date in one project. The links at the bottom of the page have all the details, but the basic work plan was:

LIST WORKITEM TYPES
PS C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE> .\witadmin listwitd /collection:http://sql1:8080/tfs/CollectionA  /p:Broken
PS C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE> .\witadmin listwitd /collection:http://sql1:8080/tfs/CollectionA  /p:Working

EXPORT WORKITEM TYPES FROM Working
PS C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE> .\witadmin exportwitd /collection:http://sql1:8080/tfs/CollectionA  /p:Working /f:c:\WorkingTestCaseSettings.xml /n:’Test Case’
PS C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE> .\witadmin exportwitd /collection:http://sql1:8080/tfs/CollectionA  /p:Working /f:c:\WorkingSharedStepsSettings.xml /n:’Shared Steps’

EXPORT WORKITEM TYPES FROM Broken
PS C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE> .\witadmin exportwitd /collection:http://sql1:8080/tfs/CollectionA  /p:Broken /f:c:\BrokenTestCaseSettings.xml /n:’Test Case’
PS C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE> .\witadmin exportwitd /collection:http://sql1:8080/tfs/CollectionA  /p:Broken /f:c:\BrokenSharedStepsSettings.xml /n:’Shared Steps’



Make a copy of the Working export files.
Change the  <GLOBALLIST name="Builds - Working" /> value to  <GLOBALLIST name="Builds - Broken" /> in the Working shared steps export file.
Change the  <GLOBALLIST name="Builds - Working" /> value to  <GLOBALLIST name="Builds - Broken" /> in the Working test case export file.

VALIDATE THE MODIFIED WORKITEM TYPES FILES
PS C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE> .\witadmin importwitd /collection:http://sql1:8080/tfs/CollectionA  /p:Broken /f:c:\BrokenTestCaseSettings.xml /v
PS C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE> .\witadmin importwitd /collection:http://sql1:8080/tfs/CollectionA  /p:Broken /f:c:\BrokenSharedStepsSettings.xml /v

IMPORT WORKITEM TYPES FROM Working TO Broken
PS C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE> .\witadmin importwitd /collection:http://sql1:8080/tfs/CollectionA  /p:Broken /f:c:\BrokenTestCaseSettings.xml
PS C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE> .\witadmin importwitd /collection:http://sql1:8080/tfs/CollectionA  /p:Broken /f:c:\BrokenSharedStepsSettings.xml

REFERENCES
http://social.msdn.microsoft.com/Forums/en-US/vsmantest/thread/6658f6e8-ab07-4579-8db0-441d322ff223
http://msdn.microsoft.com/en-us/library/dd312129%28v=vs.100%29.aspx
http://blogs.msdn.com/b/lakhminder/archive/2010/09/30/tfs-2010-enable-test-case-management-for-upgraded-team-projects.aspx


1 comment: