在这个教学视频中,我看到在子流程中定义测试时附加到测试名称的字符串。这是强制性的吗?我的团队了解此功能的原因,但仍然不受欢迎。如果发生冲突,也许可以选择只执行严格的审计而不创建子流?
2 回答
1
这些字符串的目的是保证在将 Origen 生成的流程模块插入到顶级测试程序流程中时,与其他可能或可能不是源自 Origen 的测试一起,不会发生命名冲突。
如果您想关闭该功能,那么您应该能够,并且这个 API 应该可以工作:
Flow.create unique_ids: false do
end
但是,似乎有一个错误,这没有任何作用,我在这里打开了一个问题:https ://github.com/Origen-SDK/origen_testers/issues/49
在修复这个问题的过程中,我认为我们应该在 API 中添加更多的特性,这就是建议的内容:
unique_ids: :signature # Append a calculated signature (default, current behavior)
unique_ids: false # Append no unique ID
unique_ids: nil # Append no unique ID
unique_ids: :flow_name # Append the current top-level flow name
unique_ids: :flowname # Append the current top-level flow name
unique_ids: :blah # Any other string or symbol value will be appended directly
unique_ids: "blah" # Any other string or symbol value will be appended directly
除了提供 per-flow API 控制之外,还可以在接口级别设置它,因此它可以应用于所有流,或者通过逻辑启用,例如:
# lib/my_interface.rb
def startup(options = {})
self.unique_ids = :flowname
end
任何:unique_ids给定的属性都Flow.create将覆盖接口上设置的值。
于 2017-09-07T09:47:00.867 回答
1
我之前在应用程序级别使用方法重新定义进行了黑客攻击:
# Some .rb file in your application
require "#{Origen.app(:origen_testers).root}/lib/origen_testers/flow"
module OrigenTesters
module Flow
def sig
nil
end
alias_method :signature, :sig
end
end
于 2017-09-08T14:36:43.593 回答