DTP can display sources directly from your source control management system (SCM) in Explorer Views. This method uses less server space compared to Displaying Source Code from Test and Analysis Tools because copies of the sources are not collected and stored on DTP. 

To enable this functionality, DTP must be configured to read sources from the SCM. In addition, the Parasoft code analysis and test execution tool (C/C++test, dotTEST, Jtest, SOAtest) must be connected to the SCM and configured to publish reports to DTP during analysis.

In this section:

Configuring Source Control Settings

The most common scenario is to configure SCM settings in DTP and enable Parasoft tools to also use the SCM connection settings.

  1. Enable auto-configuration in your Parasoft tool by setting the dtp.autoconfig property to true in the tool's .properties configuration file (also see Auto-configuring Code Analysis and Test Execution Tools). 
  2. Choose Report Center Settings from the settings drop-down menu and click Projects. You can also configure SCM settings globally. See Configuring Parasoft Test for All Projects
  3. Locate and click on your project to access the settings.
  4. Specify SCM settings in the Parasoft Test Field. Specific SCM settings are documented in the Parasoft tools user guides. See your tool's documentation for details. 

DTP supports many SCMs out of the box and can be extended to support systems that are not natively supported (contact your Parasoft representative). Each SCM has a different set of properties that must be configured.   

Customizing Auto-configured SCM Settings for DTP

In some cases, settings reused by Parasoft tools and DTP require additional customization. For instance, DTP may require different SCM credentials than the tools.

Auto-configuration can still be used by adding the server. prefix to identify the setting as a DTP Server-only setting. In the following Parasoft Test Settings, the SVN executable directory is specified for the Parasoft tool with the scontrol.svn.exec setting, but for DTP the directory is set with server.scontrol.svn.exec:

scontrol.svn.exec=C\:\\Program Files\\svn\\bin\\svn.exe
server.scontrol.svn.exec=/usr/bin/svn
scontrol.rep1.type=svn
scontrol.rep1.svn.url=http\://foo.bar.com/svn/repos
scontrol.rep1.svn.login=foo
scontrol.rep1.svn.password=65707c
server.scontrol.rep1.svn.login=bar
server.scontrol.rep1.svn.password=19787a

DTP prioritizes the server. prefix value if the same non-prefixed also appears.

The following precedence of overwriting settings is used in DTP when the same setting appears in Parasoft Test Global Settings and project-specific Parasoft Test settings:

  • Project specific Parasoft Test Settings with server. prefix
  • Project specific Parasoft Test Settings without server. prefix
  • Parasoft Test Global Settings with server. prefix
  • Parasoft Test Global Settings without server. prefix

Displaying Sources from Git Repositories

A local mirror of the remote repository is required to display sources in DTP.

  1. If not already installed, download and install Git on the DTP host.
  2. Choose a location for the mirror and clone the remote repository:

    git clone --mirror <URL_TO_REMOTE_REPO>

  3. Set up a nightly job to update the mirror repository (e.g., git remote update <URL_TO_REMOTE_REPO>). This could be any automated job, such a cron on Linux or a Jenkins job.
  4. Configure the Parasoft Test Settings for your project to show sources from the mirror repository (see Configuring Parasoft Test Settings for Projects):
scontrol.rep1.git.workspace=/home/devtest/git/grs
scontrol.rep1.git.branch=master
scontrol.rep1.type=git
scontrol.rep1.git.url=http://git.acme.com:7990/scm/SDM/grs.git

Displaying Sources from SVN Repositories

The following configuration is an example of an SVN connection.

scontrol.rep.type=svn
scontrol.rep.svn.url=https://svn_server/
scontrol.rep.svn.login=username
scontrol.rep.svn.password=password
scontrol.svn.exec=/usr/bin/svn 

DTP can track canonical files that appear in different SVN branches if the scontrol.rep.svn.url setting is configured properly. This settings specifies the SVN repository URL.

Configure the scontrol.rep.svn.url setting to the node containing the project, but do not include the project name.

For example, if a file in SVN is part of a project named “mina” with the following absolute path: 

https://svn.apache.org/repos/asf/mina/trunk/examples/src/http/BogusSslContextFactory.java

The CLI settings should be set to:

scontrol.rep.svn.url=https\://svn.apache.org/repos/asf

Do not include a trailing slash (/). Make sure to keep this consistent across all projects.

Troubleshooting Issues with Source Control System

When source code cannot be displayed from Source Control System:

  • Ensure that the report.xml file is published to DTP has source control information. Check that <Repositories..> section is present. If this is not the case, then the Parasoft tool configuration is incorrect
  • Check the source code panel in an explorer view for important information.
  • Ensure that all repository settings are present in Parasoft Test setting. Credentials and other repository settings are necessary to display source code
  • Ensure that the source control client is available to DTP and correctly configured. Ensure that the client can access the source code using credentials that are configured for DTP.
  • For some source control systems, such as Git, ensure that the repository is cloned and up-to-date at DTP. An external cron job may be necessary for Git to update the local repository regularly.
  • Verify that your SCM supports modifying, moving, or copying sources during build in order to rule-out disconnecting from the original source control system.
  • No labels