Forum Discussion

bahadirarslan's avatar
bahadirarslan
Occasional Contributor
15 years ago

Adding TestComplete project under TFS 2010

Hi All,



I want to add our testcomplete project to TFS 2010. So i downloaded SCCI provider and added our TFS server as a Source Control server. Then i had selected a server directory for my local project and then i clicked OK button.



But after that 'click' was like a nightmare. Because TC started to show me Check-In Dialog for every TC file, every text based file, every png file...

After more then two or three hundereds of clicks, i terminated TC process to get rid of from dialogs.



So is there any easy way to put all my project and files to TFS without clicking thousands times.



Thank you.

6 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    Sure... just click and drag the folder from Windows Explorer to your TFS window and use the TFS interface.  Checkin/Checkout does multiple files so the problem should just go away, it's just the initial add that's a bit painful.
  • bahadirarslan's avatar
    bahadirarslan
    Occasional Contributor
    Very thanks, you are right :)



    Source Control Explorer saved my life :) 



    But i want to ask another question. I had added my project suite to TFS. Now i want to fetch project and files from new client, but i couldn't. Because All of source control's menu items are disabled. 

    As you know, when you connect a source control system from Visual Studio, you can execute a get latest action to download all of source files from source control. But i couldn't find how can i do with TestComplete.
  • bahadirarslan's avatar
    bahadirarslan
    Occasional Contributor
    Hi,



    I found a workaround to get project from source control for first time. I had downloaded via Visual Studio 2010 Source Control Explorer.

    Than i opened the project with TC and added to source control again.



    After this i can successfully download TC sources from another clients. When i open TC project it automatically detects source control.

    But there some incompatibilities. 



    For example, when i try to Get Latest version from source control for a file, TC wants to check out it. Either i say yes or cancel TC checks out.

    Another issue that i saw, everychanges causes to changes at project file.



    Are there any solutions for these issues?
  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    With TestComplete, the binding between the source control system and the project is stored in the MDS file (for projects) and the PJS file (for project suites).



    So, adding the source code to TFS directly via the Source Control Explorer added your project to TFS, it, however, did not bind your project to your source control system.  What you would need to do then is, after you've added it to TFS, open it in TestComplete and right click on your project or project suite node and select the Source Control option.  In there, there should be an option to "Add Project" or "Add Project Suite".  Selecting that will create the binding and, since TFS already has the project in the source control, it doesn't need to go through and re-add all the components.



    When that is then saved and the MDS is re-checked in, that binding to TFS is now complete.  What this means, though, is that when working with your project on a new workstation, as you noted, you need to first "Get" the latest version on that new workstation before you open it in TC.  There isn't, as far as I can tell, a way within TC to say "Get a particular project from TFS so I can work with it".  Although, interestingly enough, I'm trying it now with my own project and it's not actually checking out one of my units.  I can get the latest version, but it doesn't automatically check it out.  I wonder if it has something to do as to whether TFS recognizes that the unit version on your hard drive is the same version as in TFS.  If the version is unknown on your drive (since you added via explorer, that's likely), it may be that it wants to check it out so that the version on the drive can be updated to match TFS.  



    As for your other questions, as I work with TFS, TC's interface through the SCCI assumes that, if you're getting the latest version of an item, you must be intending on editing it.  I can't find anything within TC that specifies that a "get" doesn't automatically check out the item.  This seems to be a peculiarity with this interface.  



    As for the MDS file getting changed all the time, I think there's another thread up here that addresses some of that.  First of all, there's a "files" section in the MDS file that, for every file associated with the project, there's an XML node in the MDS file.  So, if you add or remove a unit or a Stores object or other similar things, the MDS file will be changed.  For the most part, these changes can be ignored as, each time you open the project, the MDS file gets updated with all associated files.  Secondly, if you add new Project Variables or, in your script code, do dynamic "Add Variable" or "Delete Variable" calls on the project variables, that will alter the MDS file as that file is what stores the variable declarations and the default values (dynamic "local" values of variables are stored in a different file). Finally, and I think SmartBear folks are looking at this, Object Mapping nodes in the MDS file seem to get re-ordered at times depending upon which workstation is editing the MDS.  My assumption for my operations is that, if I'm doing any work with a project, I need to assume that I'm going to be altering the MDS file in some way and need to make sure it gets checked out with all other changes.



    Hopefully I've been able to answer your questions.
  • bahadirarslan's avatar
    bahadirarslan
    Occasional Contributor
    Hi Robert,



    I would like to thank you for your detailed answer. I will try adding our TC Source Codes to TFS and do let you know about the result.



    But i wonder something more. Currently we are using TC with Network share mode; so our source codes are in a shared directory; and all of the workstations connect and use these sources. Also there is a nightly team build that runs our TC tests with Text Execute. I had configured source directory of tests is our shared directory at Test Completes Test in Visual Studio 2010.



    So if i add our tests to TFS and delete shared directory; which directory must i set as source? And will Team Build or Test Complete/Test Execute get latest version from TFS and start tests after this?



    I hope, i could tell my question with my poor English :)
  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    What I would do is treat your nightly runs as another workstation and have it pull down the source from TFS to a local location rather than the network drive.  This is what I've done in the past and it works very well.  With the use of a source control like TFS, VSS, Mercurial, etc, there's no need to "share" your projects.