Icon

01.Testing Component Calculate Scores - Exercise

<p>This workflow performs a unit test on a shared component, captures some metadata and potential component errors, and then compiles this information so that it can be easily used in an execution report, for example.</p>
Step 1. Check the differences between the actual and expected output of the component

  1. Drag a Table Difference Checker to this part of the workflow. Connect the output of component Calculate Scores to its upper input port, and the output of the Table Reader node that reads the golden table to its lower port.

  2. In the configuration menu for node Table Difference Checker, leave 'Checker' option set as 'Equality' for all columns.

  3. Right-click node Table Difference Checker and select option Show Flow Variable Ports. Connect the output flow variable port of this node (the rightmost one) to the upper input port of the Catch Errors (Var Ports) node.

  4. Reset and execute the whole workflow. The test should pass.

  5. Save this workflow and move it to folder "L3-DA Productionizing Data Apps/Part 4/Unit Tests"



Part 4 - Testing

Exercise 01 Testing Component Calculate Scores

Learning objective: In this exercise you'll practice the creation of unit tests in a structured way for future reports.


Workflow description: This workflow performs a unit test on a shared component, captures some metadata and potential component errors, and then compiles this information so that it can be easily used in an execution report, for example.


You'll find the instructions to the exercises in the yellow annotations.

Capture informationrelated to testexecution
Variable to Table Row
Alternative input in casethe test fails
Variable Creator
Export status and metadata
Catch Errors (Var Ports)
Workflow execution status and metadata
Workflow Service Output
Golden datafor what is expected as the output of the component
Table Reader
Try (Variable Ports)
Workflow Metadata
Sample of processed real-world data
Table Reader
Calculate Scores

Nodes

Extensions

Links