Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 8 Current »

The parameter which sets a job's Unit Test 'mode' (to either 'Interception' or 'Testing') is an environment variable which can be added to individual jobs, or job sequences.  When applied to a job sequence (and propagated to the jobs within that sequence) this approach enables you to run an entire batch in Interception mode (capturing all jobs' inputs and outputs as an integrated set of MettleCI Unit Tests) or in Testing mode, where you replay that set of Unit Tests for each job in turn.

MettleCI’s Unit Test capability doesn't support the treatment of Sequences as units (e.g. stubbing the inputs to the first Job in a Sequence, testing the outputs of the last Job and ignoring any intermediate Jobs as a “black box”). While it has been common practice for some DataStage developers to “unit” test multiple Jobs via one or more Sequences, prior to handing them over for some form of batch-level testing, this is, in effect a form of integration test. By strictly defining the scope of a unit test as a single Job, MettleCI reduces the risk and additional root-cause analysis effort in addressing test failures that arise during the execution of multiple Jobs.

Given a simple sequence of three DataStage Jobs…

You can create a

Parallel Job 1

Parallel Job 2

Parallel Job 3

given:
  - stage: Sequential_File_0
    link: Link_1
    path: Sequential_File_0.csv
when:
...
then:
  - stage: SparseLookup
    link: Input
    path: SparseLookup-Input.csv

No MettleCI Test Specification is required for this Job as it runs normally during a unit test, with no runtime intervention from MettleCI.

given:
when:
...
then:
  - stage: ODBC_1
    link: Link_2
    path: ODBC_1.csv

  • No labels