How do I prevent tcm.exe import from overwriting existing test case if associated automation didn't change? RRS feed

  • Question

  • I have been using TCM.EXE Import to import my C# assembly automated tests into TFS Test Cases. This has worked great, except for one problem.  After importing tests, I edit the imported Test Cases and add information such as Summary, Associated Story, etc. However, if I add new tests to my assembly and then run TCM.EXE again, it updates the existing Test Cases even if nothing changed in addition to adding the new Test Cases.  When it does this, my previously entered data on the existing Test Case is destroyed.  It would appear as though TCM.EXE overwrites the existing Test Case even if nothing changed.  Is there a way that I can have TCM.EXE not overwrite a Test Case if the assembly Test Method that is associated with a Test Case didn't change? 
    Thursday, November 30, 2017 9:42 PM

All replies

  • Hi Ken Varn,

    Which version of your TFS and VS?

    How is the command you are use?

    I can't reproduce this issue.

    Here’s the command I used:

    tcm testcase /import /collection:http://{tfsserver}:8080/tfs/defaultcollection /teamproject:{projectname} /storage:"C:\Users\{user}\Documents\Visual Studio 2015\Projects\UnitTestProject1ForTCM\UnitTestProject1ForTCM\bin\Debug\UnitTestProject1ForTCM.dll"

    Looking forward your reply.


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, December 1, 2017 5:10 AM
  • Starian,

    I am currently running with the following:

    • TFS 2015 (Version 14.102.25423.0)
    • Visual Studio 2015 Update 3.

    I am using the command as follows:

    tcm testcase /import /collection:https://myTfSUrl/tfs/myCollection /teamproject:myProject "/storage:myAssemblyDll"

    I am calling TCM in a Post Build Step in Visual Studio.  Keep in mind that this seems to occur when I do a project rebuild of the test assembly DLL.  Could that have something to do with it?

    The odd part about this is if I look in the history of a Test Case after I run TCM, it shows that the Summary item was changed to blank.  The history also shows a Rev increment.

    • Edited by Ken Varn Friday, December 1, 2017 2:31 PM
    Friday, December 1, 2017 2:24 PM
  • Update:  I think I have figured out what is going on.  It would appear as though TCM is updating Summary data from [Description] attribute, regardless of whether it is placed on a TestMethod or not.  I found out that if I explicitly place the [Description] attribute on my TestMethod, it will put that description into the Summary field on the Test Case.  It would be desirable if TCM only did this if the [Description] attribute was actually placed on the TestMethod, but that doesn't seem to be the case.  Any ideas on a workaround?
    • Edited by Ken Varn Friday, December 1, 2017 2:53 PM
    Friday, December 1, 2017 2:53 PM