MettleCI's powerful Unit Test capability allows developer to conduct unit testing using authored, intercepted, or fabricated data without having to alter your DataStage job design. Unit Tests are created, maintained, and monitored using the MettleCI Workbench. Unit Tests are executed using the Windows-based DataStage Designer or browser-based DataStage Flow Designer.
Info |
---|
In order to use the Unit Test Feature, you'll need to
|
Table of Contents | ||
---|---|---|
|
Table of Contents | ||
---|---|---|
|
Introduction
MettleCI Unit Tests are execute by running your DataStage job as you normally would but with the addition of a parameter value which invokes the MettleCI Unit Test Harness. When you do this, the following process occurs:
Multimedia | ||||||
---|---|---|---|---|---|---|
|
The data comparison capabilities of MettleCI Unit testing provide the ability to validate your job’s outputs against expected results regardless of the order in which those actual output rows are produced.
...
Step-by-step Guide
1. Run DataStage Job in Unit Testing Mode
Run your DataStage Job in Unit Testing Mode by
...
You'll be able to see dataStage job will now use the 2 fabricated rows for unit testing
...
selecting 'Test' as the input value to the "Unit Testing Configuration" parameter.
...
Once your job is running you'll see the input link counts on the DataStage job canvas represent the number of rows in each of your Unit Testing input data sets.
...
You'll also see a warning in the DataStage job log telling you that unit testing is enabled.
2. Check Unit Tests List
Navigate back to Unit Tests List from the sidebar. You can now see Unit Test for ER_EMPLOYEE created.
...
The result is coloured RED because we didn't specify an output for comparison.
...
...
9. Output mismatch report
By clicking on the RED view result button above, it will bring you a summary report of the Unit Test
10. Baseline Output Data
If we go back to Unit Test Setting for TR_EMPLOYEE, we can now see the output of the first run is now set at the baseline of the output
11. Rerun Unit Test
If we rerun the Unit Test again, the test summary report will produce a report of perfect matched output.
...
3. Unit Test results report
You can view your Unit Test results by clicking the red View button alongside your test name. A failed Unit Test will report differences for each output link:
...
A Unit Test will only report success when all output links have zero differences from their expected results:
...