我可以对 Informatica Powercenter 工作流程进行单元测试吗?

发布于 2024-09-16 04:31:44 字数 165 浏览 3 评论 0原文

我可以对 Informatica Powercenter 工作流程进行单元测试吗?

编辑: 更具体地说,我可以模拟源和目标并测试其间的步骤吗?例如。如果我有一个包含 Oracle 源和文本文件目标的工作流程,我可以在没有 Oracle 和文本文件的情况下测试它吗?

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

无声静候 2024-09-23 04:31:44

不,你不能。

创建并保存映射时,Informatica 会验证映射在语法上是否有效。如果不是,它会给你一条错误消息。在底部面板中查找错误。您可以通过转至“映射菜单”>“验证映射”来验证映射。证实。

您可以类似地验证工作流程:工作流程菜单 >证实。

要运行工作流程,源和目标必须可用且已连接。如果您不想写入目标或不想进行全量测试,您可以在会话级别使用“启用测试加载”(编辑 > 属性 > 启用测试加载)并将“行数设置为测试”。

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

や莫失莫忘 2024-09-23 04:31:44

是的,您可以运行工作流程并测试输出目标表。
(在工作流程管理器中,右键单击工作流程,然后单击“从头开始运行工作流程”。

工作流程成功后,查看目标中的数据以查看映射和转换是否正常工作。

就像对于任何其他单元测试,您需要在运行工作流程之前识别源(和目标)中的记录以及目标中的预期结果,

例如,如果我想测试具有 SCD type2 逻辑的映射,您需要这样做。可以运行工作流程两次并根据需要更新源列,运行工作流程后,检查当前记录是否已正确更新以及记录的历史版本的新行是否已正确更新。

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.

梦归所梦 2024-09-23 04:31:44

我们在 Informatica 中尝试做的是构建源文件,构建预期的输出文件,然后运行工作流程以生成实际的输出文件。然后,我们对预期输出文件与实际输出文件进行字节码比较。我们在这里实际测试的是我们的映射逻辑是否按照我们认为应该实现的方式实现。

以下 python 脚本将进行测试:

import filecmp
import csv
import sys

testRepository = open('testRepository.txt','rb')

testReader = csv.reader(testRepository)

print 'Test Number\tResult'

for test in testReader:
    print test[0]  + '\t\t' + str(filecmp.cmp(test[1], test[2]))

不完全是模拟,但本质上是正确测试映射是否正确所必需的。映射的有效性由 Informatica 本身进行检查。

What we're trying to do in Informatica is build a source file, build an expected output file and then run a workflow to produce an actual output file. We then do a bytecode comparison of our expected output file versus our actual output file. What we're actually testing for here is whether or not our mapping logic is implemented as we believe it should be implemented.

The following python script will do the testing:

import filecmp
import csv
import sys

testRepository = open('testRepository.txt','rb')

testReader = csv.reader(testRepository)

print 'Test Number\tResult'

for test in testReader:
    print test[0]  + '\t\t' + str(filecmp.cmp(test[1], test[2]))

Not exactly mocking, but essentially will be what's necessary to correctly test that your mapping is correct. Validity of the mapping is checked my Informatica itself.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文