lib/atp/processors/relationship.rb in atp-1.0.0 vs lib/atp/processors/relationship.rb in atp-1.1.0
- old
+ new
@@ -64,11 +64,16 @@
node = node.ensure_node_present(:on_fail)
node.updated(nil, node.children.map do |n|
if n.type == :on_pass
n = n.add node.updated(:set_flag, ["#{id}_PASSED", :auto_generated])
elsif n.type == :on_fail
- n.ensure_node_present(:continue)
+ delayed = n.find(:delayed)
+ if delayed && delayed.to_a[0]
+ n
+ else
+ n.ensure_node_present(:continue)
+ end
else
n
end
end)
end
@@ -76,11 +81,16 @@
def add_fail_flag(id, node)
node = node.ensure_node_present(:on_fail)
node.updated(nil, node.children.map do |n|
if n.type == :on_fail
n = n.add node.updated(:set_flag, ["#{id}_FAILED", :auto_generated])
- n.ensure_node_present(:continue)
+ delayed = n.find(:delayed)
+ if delayed && delayed.to_a[0]
+ n
+ else
+ n.ensure_node_present(:continue)
+ end
else
n
end
end)
end
@@ -109,21 +119,18 @@
end
# Set flags depending on the result on tests which have dependents later
# in the flow
def on_test(node)
+ node = node.updated(nil, process_all(node.children))
nid = id(node)
# If this test has a dependent
if test_results[nid]
node = add_pass_flag(nid, node) if test_results[nid][:passed]
node = add_fail_flag(nid, node) if test_results[nid][:failed]
node = add_ran_flags(nid, node) if test_results[nid][:ran]
end
- if node.type == :group
- node.updated(nil, process_all(node))
- else
- node
- end
+ node
end
alias_method :on_group, :on_test
def on_if_failed(node)
id, *children = *node