DCSIMG
April 2007 - Posts - SRL Group

SRL Group

This blog is about Team System, QA and Development methodologies and more...

VSTS Resources

Team System Bloggers

April 2007 - Posts

Rollback in Team System Source Control

In the current version of Team System source control there is no support for "Rollback" functionality. Users that had previous experience with other source control systems (VSS for example) often looking for this feature.

The way to perform operation similar to VSS rollback in TS is: Get specific version from changeset previous to change you would like to rollback, check it out and then check it. It is not a very convenient way, but it is keeping history of the changes after doing rollback (which is usually good thing).

The other way to do it is using Power Toy (tfpt) utility.
One of the commands supported by tfpt is Rollback. You can use it from command line or GUI. Here some point you should have in mind when using it:

  • First thing you should know when using tftp rollback is the difference in its behavior from similarly called option in VSTS. Tftp rollback actually trying to remove only changes in specified changeset, keeping all the changes made afterwards.
  • You can not have any pending changes when doing rollback. Trying to do it will result in following error message: "Cannot proceed because you have pending changes in your workspace. You must move to a shelveset, undo, or check in all pending changes before reverting a changeset.".
  • To perform GUI driven rollback, execute
    "%ProgramFiles%\Microsoft Team Foundation Server Power Tools\tftp.exe" rollback
    from directory mapped in workspace. If you will try to run it from unmapped folder, you will receive pretty annoying message "Unable to determine the workspace". I would prefer to have ability to specify workspace in command line, but unfortunately this is not the case.
  • The workspace used to perform rollback has to be up to date. If not, tftp will ask you if you like to get latest version. Answering no to this question will stop the process. Be advised, even if you intend to do rollback on single file, utility will perform get latest on the whole workspace. If you have a large amount of unsynchronized files in workspace, creation of separate small workspace for rollback may save some time.
  • Rollback operation can result in conflicts if later changesets exists. In this case 3 directional merge should be performed.

To summarize: performing rollback in TS is not a great fun. I hope Attrice guys will add nice rallback support to their History Sidekick utility :-).

What's new for testers in Orcas?

Yesterday, I talked to Ed Glas from Microsoft. For those of you who don’t know, Ed is the group manager for VSTS load testing at Microsoft.

One of my first questions was about  the new features that we will see in the next Orcas release?

Here is a link to his blog that summaries those issues. I think that the list of features is very exciting and I'm looking forward to using them.

Team System SDR

Sarit and I just landed in Redmond to participate in Team System Software Design Review. Tomorrow morning we start a 3 days of intensive sessions with members of VSTS development teams. During these sessions we will give feedback from the field, discuss and prioritize new features. We will talk mostly about features of post-Orcas version (temporary code name Rosario). I hope results of following days work will influence the shape of the new version. It is an extremely interesting experience for us.
We will do our best to pass forward requests, suggestions and complains we’ve collect from the many VSTS implementation projects, done by our team. If you have any last time thoughts or suggestions, please comment and we’ll try to let MS guys know that it is important to you.

Wrap your NUnit unit test with VS Generic test

This is an issue I discussed in the last ALM user group. For those of you who did not attend it, here is a summery.

Not all companies started their unit testing using the visual studio test capabilities. There are several reasons for it; for starters, NUnit has been there for several years, at least five years earlier then Visual Studio unit tests. Even more, NUnit is a more complete unit testing environment because it is a mature product. However, if choosing to continue working with it, you end up losing a lot of the TFS capabilities, for example the integration between tests and build.

So, there is a compromise... :)

You can still write your unit testing using NUnit framework and integrate it into Visual Studio tests framework.

Follow these steps:

  1. If you do not have NUnit framework, download it here: NUnit download and install it.
  2. Download the attached project.
  3. Change the location of the CovertTest.dll in the program file that is located under the ConvertTestWrapper.
  4. In the Generic test change the location of the ConvertTestWrapper.exe
  5. Build.

That is it...enjoy!

Creating a custom validation rule

There are cases where the default validation rules supplied by the tester framework are not sufficient. The good news is that you can customize a lot of areas in the framework, and one of them is the rule engine.

Last week I had to record a web site. The site was far from simple one. It was AJAX based and over SSL. I had to use fiddler for the recordings and then to customize the recording results. After doing so, I had to verify that the requests being made correspond to my expectations. To do so, I had to use validation rules. However, Microsoft supplies only several validation rules out of the box. I had to create my custom validation rule.

Here is what you must complete in order to generate your own custom validation rule:

  • In the test project add a new class and name it properly or create a new class library project and reference to the Microsoft.VisualStudio.QualityTools.WebTestFramework DLL (if you created a new project add it as a reference from the test project)
  • Set this class to inherit from ValidationRule which is located under the Microsoft.VisualStudio.TestTools.WebTesting namespace
  • There is a method and a property you need to implement:
    • RuleName - the name of the rule that will appear in the context menu when you will want to add this rule to the web method
    • Validate - where you can validate the rule. A few words about this method: by using the ValidationEventArgs you can gain access to all the data that is relevent to the test and that includes the WebTest, Request, Response and ect. Finally you must set the IsValid to true if the rule passes of false if it fails.

Here is a code snippet that demonstrates it:

public class MyCustomValidationRule : ValidationRule
{
   public override string RuleName
   {
      get 
      { 
         return "MyCustomValidationRule"
      }
   }

   public override void Validate(object sender, ValidationEventArgs e)
   {
      e.IsValid
= true;
   }
}

Now, if you will try adding a new validation rule, you will see the new custom validation rule you just created.