Installing or Upgrading the Server Job Unit Test Harness
Unlike MettleCI’s Parallel Unit Test Harness, which is installed once for an entire DataStage Engine tier, the MettleCI Server Unit Test Harness must be installed individually for each Project in which you want to test Server jobs To do this, follow the instructions below.
Prerequisites
You have performed the Unit Test Harness installation steps for Parallel Jobs and that you have tested that this MettleCI feature is operating correctly.
You have a working installation of the MettleCI CLI, either on your DataStage Engine or DataStage Client host.
In your CLI
plugins
directory, you have thedm-dstest-plugin-x.x-xxx.jar
plugin, wherex.x-xxx
is greater than, or equal to1.0-512
.Ensure a default credential mapping has been set for your DataStage Engine. Please see this FAQ page for completing this step when your DataStage engine is configured to use shared user credentials.
This is not the same as setting the current user’s credential mapping.
Enable Unit Testing of Server Jobs
Only perform these steps if your DataStage solution uses Server Jobs. They must be repeated for each DataStage project where Server job unit testing is required.
To install the MettleCI Server unit testing components, run the following MettleCI CLI command:
mettleci unittest install-server-test-harness -server [ENGINE_URL] -project [DS_PROJECT] -username [ENGN_OS_USER] -password [PASSWORD]
See this page for more information on the command: https://datamigrators.atlassian.net/wiki/x/IoBmnQ
Example command with arguments:
mettleci unittest install-server-test-harness -server my-engn.datamigrators.io -project dstage1 -username dsadm -password mypassword
Use the linked IBM instructions to apply the following two environment variables at the DataStage instance or Project level, replacing values between
< >
with values specific to your installation. If you need to perform Server Job unit testing across multiple Projects, we recommend setting these variables at the instance level to avoid the risk of accidental configuration gaps.
DM_UNIT_TESTING_JAR=<datastage install directory>/Server/DSComponents/bin/dm-unittest-harness-<x.x-xxx>.jar
DM_METTLE_HOME=<MettleCI home location>
Post-installation
To enable MettleCI Unit Testing for an existing DataStage project:
Log into your development DataStage Engine(s) and navigate to your DataStage project folder. This would typically be:
Add the following Environment variable definition to the
DSParams
file under the[EnvVarDefns]
section:
This will make the following Environment Variable available to add to the DataStage jobs for which you wished to enable unit testing:
To enable MettleCI Unit Testing for all newly-created DataStage projects:
Add the same entry described above to the DSParams for your ‘Template’ project, located in directory:
These steps can also be applied to the template project in $DSHOME/../Template
to ensure DataStage Server Unit Testing is enabled whenever a new Project is created.
Troubleshooting
If your Server Job execution hangs
After deploying Server Job Unit Testing you might experience a situation in which a Server job hangs in a ‘running’ state when executing a Unit Test. To address this you will need to run the following command on your a DataStage Client host to update DataStage’s understanding of available Stage types.
Changing the level of Unit Test log messages
Enabling Unit Testing will set the log type to “Warning” for Job log entries generated by this MettleCI feature. This is to help remind developers to switch the Unit Testing mode off before deploying Jobs to Production. If you want to apply a different setting for Unit Testing log entries, you can override the default by adding a new environment variable DM_LOG_UNITTEST_LEVEL
with value of INFO
to the dsenv
file. For example:
Disable Server Job Unit Test Harness
To uninstall the MettleCI Server unit testing components, run the following CLI command:
See this page for more information on the command: https://datamigrators.atlassian.net/wiki/x/J4BfnQ
Example command with arguments:
© 2015-2024 Data Migrators Pty Ltd.