January 3, 2010

Using TestTrack TCM in an Automated Build Environment

Helix ALM
Test Management
I got a call from a TestTrack TCM user who asked if you could schedule scripts to run on a continuous scheduled basis, rather than just once. I responded that you couldn't, mainly because each test run represents a single execution of a test, not a continuous one. I asked the user for more details in order to better understand the need. He revealed that his group does automated builds and wanted to launch tests after each build and log those results in TestTrack TCM. He wanted to incorporate TestTrack TCM with the automated build process and did not know how to.  So how do you do it? Well the answer will vary depending on your process. Since test runs represent an individual execution of a test, a separate test run is needed for each automated build and test. While the user could create these test runs manually, it might be better if they are generated automatically, ideally only if the build is successful. I have placed two sample apps on the Seapine Labs that can help in this effort.  One is written in C# and will require the .NET framework and the second one is written in Java and will need a Java Run Time Engine. Both applications work exactly the same way.  They take three parameters: Project Name Filter Test Run Set This app only generates the test runs, however.  It does not address the initial question on how to schedule scripts for each build. The answer is that you cannot do this programmatically. What you could do is analyze how the script agent works and incorporate that into your build/test process. Your automated testing scripts can be launched by your build/test process and then update the results to the status files (.trjob) that TestTrack TCM uses to know the status of locally run scripts. Another way is to just bypass updating script status in the test run and instead update the workflow state and attach the script result.