如何让RFT实时报告测试结果?

发布于 2024-09-17 19:25:48 字数 374 浏览 8 评论 0原文

在我们的开发环境中,我们运行持续集成服务 (TeamCity),该服务通过运行构建/测试作业并报告结果来响应代码签入。当工作正在进行时,我们可以很容易地看到到目前为止已经执行了多少个单元测试、有多少个单元测试失败了等等。

我的自动化测试团队正在交付在 Rational Function Tester 中开发的 UI 测试。从源代码控制系统中提取这些测试、编译它们并从命令行执行它们似乎都是非常简单的练习。

我无法找到一种自动报告测试结果的方法 - 例如,似乎没有任何监听器的钩子,或者任何自定义发出的消息的方法。

根据迄今为止的研究,我得出的结论是,我唯一的选择是 (a) 等待测试完成,然后 (b) 解析 RFT 生成的 HTML 报告。

还有人有比这更好的答案吗?

In our development environment, we run a Continuous Integration service (TeamCity) which responds to code checkins by running build/test jobs and reporting the results. While the job is in progress, we can easily see how many unit tests have executed so far, how many have failed, etc.

My automated testing team is delivering UI tests developed in Rational Functional Tester. Extracting those tests from the source control system, compiling them, and executing them from the command line all seem to be pretty straight forward exercises.

What I haven't been able to find is a way to report the test results automatically - there don't appear to be any hooks for listeners, for example, or any way to customize the messages that are emitted.

From my research thus far, I've come to the conclusion that my only option is to (a) wait until the tests finish, then (b) parse the HTML report that RFT generates.

Does anybody have a better answer than that?

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

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

发布评论

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

评论(2

極樂鬼 2024-09-24 19:25:48

以下是我用于类似目的的解决方法:

  1. 编写一个帮助器超类来覆盖 onTerminate 回调方法,在那里实现日志解析逻辑。
  2. 将测试脚本的帮助器超类更改为在步骤 1 中创建的帮助器超类。
  3. 使用 RFT CLI 在持续集成代码中调用脚本。

Here is the workaround I've used for the similar purpose:

  1. Write a helper super class that overwrite the onTerminate callback method, implement your log parsing logics there.
  2. Change the helper super class of your test scripts to the helper super class create in step1.
  3. Use RFT CLI invoke your scripts in your Continous Integration code.
热风软妹 2024-09-24 19:25:48

扩展 @eric2323223,在 onTerminate 重写中,您可以使用 TeamCity 的 构建脚本交互功能可将 RFT 通过/失败状态汇总到 TeamCity。您只需将这些 TeamCity 特定消息发送到命令行,以便 TeamCity 接收它们。

##teamcity[testStarted name='test1']
##teamcity[testFailed name='test1' message='failure message' details='message and stack trace']
##teamcity[testFinished name='test1']

##teamcity[testStarted name='test2']
##teamcity[testFailed type='comparisonFailure' name='test2' message='failure message' details='message and stack trace' expected='expected value' actual='actual value']
##teamcity[testFinished name='test2']

Expanding on @eric2323223, in your onTerminate override, you can use TeamCity's build script interaction functionality to have your RFT pass/fail status rolled up to TeamCity. You just need these TeamCity specific messages emitted to the command line, so that TeamCity picks them up.

##teamcity[testStarted name='test1']
##teamcity[testFailed name='test1' message='failure message' details='message and stack trace']
##teamcity[testFinished name='test1']

##teamcity[testStarted name='test2']
##teamcity[testFailed type='comparisonFailure' name='test2' message='failure message' details='message and stack trace' expected='expected value' actual='actual value']
##teamcity[testFinished name='test2']
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文