Document toolboxDocument toolbox

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

  1. Navigate to the Tasks configuration tab for the job (this will be the default job if creating a new plan).
  2. 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.
  3. Complete the following settings:

    Task DescriptionA description of the task, which is displayed in Bamboo.
    Disable this taskCheck, or clear, to selectively run this task.
    ExecutableFrom the pulldown list, choose a 'Datastage Capability'
    DomainEnter the Domain of the Datastage instance (Host Name of the Services Tier)
    ServerEnter the Server of the Datastage instance (Host Name of the Engine Tier)
    UsernameEnter the Datastage Username
    PasswordEnter the Datastage Password
    Project nameDataStage 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 JobsSpecify the maximum number of concurrent jobs executed during Unit Testing.



  4. 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

  1. 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.
  2. SFTP Upload recursively transfers the content of the unittest directory to the remote /opt/dm/mci/specs/<project name> directory on the DataStage Engine.
  3. Run DataStage Unit Tests with the Specifications directory option referring to the unittest directory created by step 1 and the Reports directory set to test-reports.  The Fail build when a Unit Test fails? option but be unchecked.
  4. SFTP Download recursively transfers the content of the remote /opt/dm/mci/reports/<project name> directory on the DataStage engine to the local test-reports directory.
  5. 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.