views:

127

answers:

2

Can I unit test Informatica Powercentre workflows?

EDIT: More specifically, can I mock sources and target and test the steps in between? Eg. If I have a workflow with a Oracle source and a text file target can I test it without Oracle and a text file.?

A: 

Yes, you can run the work flow and test the output target table. (From the work flow manager, right click on a work flow, and click "run work flow from start".

Once the work flow is successful, view the data in the target to see of the mappings and transformations are working fine.

Just like any other Unit testing, you'll need to identify the records in your source (and target) and the expected results in the target before you run your work flow.

Eg If I want to test a mapping which has the SCD type2 logic, you can run the work flow twice and update the source columns as needed and after running the work flow, check if the current record has been updated correctly and if the new row for a history version of the record has been updated correctly.

Rajesh
Can I mock the source (and target)?
Peter Goras
You can actually export and import the tables from a higher environment if you want to.. but I dont see the need for it on most occasions. Is this to test large volumes of data..?
Rajesh
A: 

No you can't.

When you create and save a mapping Informatica validates if the mapping is syntactically valid. It will give you an error message if it's not. Look for the errors in the bottom panel. You can validate a mapping by going to Mappings Menu > Validate.

You can validate a workflow similarly : Workflows Menu > Validate.

To run the workflow it is necessary that you have the source and target available and connected. If you don't want to write to target or don't want to do full volume testing you can use "Enable Test Load" at the Session level (Edit > Properties > Enable Test Load) and set "Number of rows to test".

Ruchi