Run DataStage Unit Tests Task
You can use the Run DataStage Unit Tests task to execute Unit Test specification created by the MettleCI Workbench.
Task Availability
This task is available after installing the MettleCI - DataStage Unit Test Plugin (dm-dstest-plugin.jar)
To configure an Run DataStage Unit Tests Task
Steps
- Navigate to the Tasks configuration tab for the job (this will be the default job if creating a new plan).
- Click the name of an existing Execute Datastage Job task, or click Add Task and then search 'Datastage' to easily locate the Run Datastage Unit Tests task type, in order to create a new task.
Complete the following settings:
Task Description A description of the task, which is displayed in Bamboo. Disable this task Check, or clear, to selectively run this task. Executable From the pulldown list, choose a 'Datastage Capability' Domain Enter the Domain of the Datastage instance (Host Name of the Services Tier) Server Enter the Server of the Datastage instance (Host Name of the Engine Tier) Username Enter the Datastage Username Password Enter the Datastage Password Project name DataStage Project containing assets to be executed Specification Directory Enter the location of Unit Test spec directory used by the Unit Tests harness, typically
/opt/dm/mci/specs/<Project Name>
.See notes below when the Bamboo agent does not have direct access to directories on the DataStage engine.
Reports Directory Enter the location of Unit Test reports directory which the Unit Tests harness writes to, typically
/opt/dm/mci/reports/<Project Name>
.See notes below when the Bamboo agent does not have direct access to directories on the DataStage engine.
Only test changed jobs? Skip all tests related to jobs which have not changed since the last execution of this task. Fail build when a Unit Test fails? Fail the build if any Unit Tests fail. Maximum Concurrent Jobs Specify the maximum number of concurrent jobs executed during Unit Testing. - Click Save
Running Unit Testing without direct access to DataStage engine storage
When the Run DataStage Unit Tests task does not have direct access to the test specifications and reports directories on the DataStage engine, the tasks provided by the MettleCI - SFTP Plugin can be used to work around this limitation. Below is a high level overview of running Unit Test Specifications from a Git repository without direct access to the Specifications and Reports directories on the DataStage Engine:
Task Execution Description
- Source Code Checkout is used to checkout the Unit Test specifications that have been created by Workbench and checked into Git. These typically reside in the
unittest
directory in the root of your Git repository. - SFTP Upload recursively transfers the content of the
unittest
directory to the remote/opt/dm/mci/specs/<project name>
directory on the DataStage Engine. - Run DataStage Unit Tests with the Specifications directory option referring to the
unittest
directory created by step 1 and the Reports directory set totest-reports
. The Fail build when a Unit Test fails? option but be unchecked. - SFTP Download recursively transfers the content of the remote
/opt/dm/mci/reports/<project name>
directory on the DataStage engine to the localtest-reports
directory. - JUnit Parser is configured to recursively parse all test results produced by Steps 3 and 4 using the pattern
test-reports/**/*.xml
© 2015-2024 Data Migrators Pty Ltd.