Wednesday, July 29, 2009

Version Control Rational Test Assets in ClearCase

 

Jirong Hu

June 28, 2006

This document describes proper procedures to integrate Rational Functional Tester (RFT), Test Manager (TM) and ClearCase (CC) to version control various test assets.

1 Integrating RFT and ClearCase

The following steps need to be done to integrate RFT and CC:

  1. Install ClearCase Server Extension
  2. Activate RFT SCM adapter

1.1 Installing ClearCase Server Extension

ClearCase Server Extension has to be installed in the machine where the view server is running. In our environment, it’s the developer’s workstation with ClearCase Windows client installed.

If ClearCase Server Extension is not installed, “Add the Datastore to Source Control” option will not be available as shown below:

clip_image002

And various errors will be displayed if you try to “Share Project …” or add RFT projects into ClearCase:

clip_image004

clip_image005

To install ClearCase Server Extension and update the ClearCase type managers to recognize Functional Test object map files on Windows, complete the following steps:

  1. Log on using an account with administrator privileges.
  2. Copy the file <RFT Install dir> \FunctionalTester\eclipse\plugins\com.rational.test.ft.wswplugin_6.1.0\rtccserverextension.exe to a temporary directory.
  3. Run rtccserverextension.exe.
  4. Using regedit, verify that the registry keys _rftdef, _rftmap, and _rftvp are created under HKEY_LOCAL_MACHINE\Software\Atria\ClearCase\2.0\CurrentVersion\TypeManagers to ensure the update has completed successfully.

clip_image006

clip_image007

1.2 Activating the ClearCase SCM Adapter

To activate the ClearCase SCM Adapter in RFT:

Select the Window > Preferences > Workbench > Capabilities > Team > ClearCase SCM Adapter option in RFT. After activating the ClearCase SCM Adapter, the ClearCase menu options and icons appear in RFT.

Note: If you have activated the ClearCase SCM Adapter but the ClearCase menus and icons do not appear in your perspective, you can use the following method to manually add the ClearCase SCM Adapter to the perspective:

  1. Click the Window > Customize Perspective option.
  2. Click the Commands tab in the Customize Perspective window.
  3. Select the ClearCase SCM Adapter option in the Available command groups list box.

clip_image009

clip_image011

2 Setting up ClearCase

2.1 Using Separate VOBs and UCM projects

Note that at the time this document was written, there was no support for multi-stream UCM for RFT projects, so we can only use single single-stream UCM projects when integrating RFT and CC.

Since all our current UCM projects for J2EE development are multi-stream, the RFT projects have to be separated from the current UCM project used to store J2EE source.

Same for RAD6, snapshot views are recommended for RFT. If there is only one test, just use an integration view without development stream.

And also as recommended in RFT’s User’s Guide, a completely separated PVOB/VOB will be created to store all test assets.

"To simplify your ClearCase administration, you can put Functional Tester test assets in a separate VOB. By putting Functional Tester test assets in a separate VOB, only those users who need to access Functional Tester test assets need to install the Functional Test type managers on their system."

"To the user of XDE Tester, the ClearCase operations look very straightforward. But there is a lot going on behind the scenes. In most version control situations, you version individual files. You check out a file, edit a file, check in a file and thus create a new version. An XDE Tester script, however, is not just a file. It is a collection of files. The complexity of treating several files as a single entity is hidden from the XDE Tester user because all actions in the XDE Tester user interface are performed on the script. You won?t see any of the related files listed anywhere in the user interface. In addition, some version control operations like merging are very complex. There is built-in logic to determine the order in which files are merged, and then different utilities are employed as needed to complete the merge."

3 Adding RFT projects to ClearCase

Remember to connect to ClearCase before you start.

clip_image013

There are two ways to add a RFT project into ClearCase. If you start a completely new RFT project, you can just create the new RFT project directly in a ClearCase view and add it to version control later. If a RFT project already exists, it can be added to ClearCase by the “Share Project …” function provided in RFT.

3.1 Creating a new RFT project in ClearCase

To create a new RFT project in ClearCase, the datastore has to be created in a ClearCase view:

clip_image015

clip_image017

clip_image019

Now you can start creating RFT scripts, remember to check “Add the Script to Source Control” as shown below:
clip_image021

When the script is created, it’s already inside ClearCase as shown below:

clip_image023

3.2 Adding an existing RFT project to ClearCase

An existing RFT project can be added into ClearCase by the “Share Project …” function in RFT, which will move the existing datastore into a ClearCase view and check it in from there.

clip_image024

Right click the existing RFT project, select Team à Add to Source Control

clip_image026

clip_image028

Click “Add all files and scripts in the project to ClearCase” to add all files and scripts in the project to ClearCase. It may take several minutes.

Click Finish to add only the project to source control.

clip_image030

4 Integrating RFT and TM

This section describes the procedures to integrate RFT and TM.

Functional Test is integrated with Rational TestManager version 2003.06.13. If you have the 2003.06.13 version of TestManager, you will be able to use the integrated features of Functional Test and TestManager.

You can associate a RFT project to a TM project upon creation, or do the association later.

4.1 Creating a new RFT project associated with TM

clip_image032

Choose the TM project you want to associate to:

clip_image034

4.2 Associate an existing RFT project to TM

You can associate an existing RFT project to any existing TM project. (You choose TM project when you start RFT if you have enabled the integration.)

clip_image036

To associate an existing Functional Test project with a Rational project:

  1. Start Functional Test and log in to a Rational project.
  1. From the Functional Test Projects view, right-click a Functional Test project, and click Associate with current Rational Project.
  1. Functional Test adds the name of the Rational project that you associate with a Functional Test project to the name of the Functional Test project in the Functional Test Projects view. For example, if you associate MyFTProject with the MyRationalProject Rational project, it appears in the Functional Test Functional Test Projects view as: MyFTProject - MyRationalProject
  1. If Associate with current Rational Project is unavailable, create a Rational project and log in to the Rational project before you associate a Functional Test project with the current Rational project.
  1. Associate with current Rational Project is available only if you have administrative privileges with the project.
  1. You can only associate a Functional Test project with a Rational project if it is currently not associated with any other project. To associate a project with a different project, first you must disassociate the project from the project to which it is currently associated.
  1. Information about a Functional Test project that you associate with a Rational project appears on the TestManager Properties page for the Functional Test project.

5 Integrating TM and ClearCase

Although I am still not convinced about TM and ClearCase integration, this section gives a rough procedure to version control TM projects in ClearCase in case someone is interested. Please refer to article “Test asset management with IBM Rational ClearCase” for more detailed information.

5.1 Creating a new TM project in CC

5.1.1 Use a network shared place

The UCM integration of TM and CC will only move TestDatastore directory into CC. The rest two folders will remain outside of CC. So a TM project still has to be created in a network shared folder, no mater integrating with CC or not.

clip_image038

5.1.2 Create a new project in CC

If you are creating a new TM project, point the TestDatastore directory to a view.

clip_image040

clip_image042

clip_image044

clip_image046

clip_image048

clip_image050

clip_image052

clip_image054

clip_image056

clip_image058

clip_image060

clip_image062

clip_image064

clip_image066

clip_image068

clip_image070

Takes 30 minutes to add-in an empty datastore to ClearCase.

Notice only TestDatastore is under version control.

clip_image072

clip_image074

clip_image076

clip_image078

clip_image080

clip_image082

5.2 No actual parallel development is supported

Since no parallel development is supported, some can argue why would we like to put the test asset under source control. The following text is extracted from “Test asset management with IBM Rational ClearCase”.

Managing test assets in a CM environment

At a high level, testing assets in the Rational Software Quality solution do not currently support parallel development using UCM. What this means to the end user (i.e., the tester using the Rational solution) is that there is no difference between using a project under configuration management control and one outside of configuration management control. The tool will not behave differently, and there will be no additional workflows for testers. This will come as surprise to you if you expected that your testers would have to perform check-ins and check-outs, just as their development counterparts do. Because there are no UCM-enabled parallel development capabilities, all test assets in the project are always checked out. This means that the only time you have to do a check-in, is to make a baseline.

When would I want to make a baseline? Either at the end of a stable iteration, or before a major new development effort gets underway within the test datastore. The next series of steps show how to check in all of the test assets, create a new baseline, and then check out all of the assets again. Your project's Rational Administrator or technical lead should perform this activity.

6 Reference

· Versioning Rational Functional Tester test assets with Rational ClearCase

· Version control of IBM Rational Functional Tester 6.1 assets using IBM Rational ClearCase

· Rational Functional Tester User’s Guide

· Rational Test Manager User’s Guide

· Test asset management with IBM Rational ClearCase

· How to use IBM Rational ClearCase UCM to baseline Test Assets

No comments:

Post a Comment