Advantest SmartTest中如何设置Group节点的Group Bypass属性?
Hey there, let's figure out how to get that Group Bypass property working for your Advantest SmartTest Group node in v7.1.3+. First, let's restate your existing test flow code for clarity:
{ run_and_branch(TestA) then { } else { if @Alarm then { binout; } else { } } run_and_branch(TestB) then { } else { if @Alarm then { binout; } else { } } }, groupbypass, open,"DataCollectionTests", ""
Since you tried if_flag:, continue:, and if_enable without luck from the docs, here are three practical approaches tailored to SmartTest's flow API:
1. Dynamic Bypass with Flag-Driven Group Execution
You already have the groupbypass parameter in your code—let's tie it to a flag to control when it activates. Wrap your Group in an if_flag block that skips the entire Group when the flag is set:
if_flag(:skip_data_collection) do { run_and_branch(TestA) then { } else { if @Alarm then { binout; } else { } } run_and_branch(TestB) then { } else { if @Alarm then { binout; } else { } } }, groupbypass, open,"DataCollectionTests", "" end
When :skip_data_collection is set to true, the Group will be bypassed entirely. This mimics the "Group Bypass" property behavior by conditionally excluding the Group from execution.
2. Use if_enable to Bind Bypass to a Configurable Property
SmartTest allows attaching an if_enable attribute directly to Group nodes to control their activation. Bind it to a flag that you can toggle at runtime:
{ run_and_branch(TestA) then { } else { if @Alarm then { binout; } else { } } run_and_branch(TestB) then { } else { if @Alarm then { binout; } else { } } }, groupbypass, open,"DataCollectionTests", "", if_enable: :data_collection_enabled
Then, in your test setup or parameter configuration, set set_flag(:data_collection_enabled, false) to trigger the bypass. This keeps the Group in the test flow structure but marks it as skipped, aligning with the intended "Group Bypass" property behavior.
3. Custom Flow Helper for Reusable Bypass Logic
If you need to apply this bypass logic across multiple Groups, create a custom helper method to encapsulate the logic:
def group_with_bypass(group_name, bypass_flag, &block) # Use the negation of the flag to run the Group only when bypass is off if_flag("!#{bypass_flag}") do instance_eval(&block) end, groupbypass, open, group_name, "" end
Then call it cleanly in your flow:
group_with_bypass("DataCollectionTests", :skip_data_collection) do run_and_branch(TestA) then { } else { if @Alarm then { binout; } else { } } run_and_branch(TestB) then { } else { if @Alarm then { binout; } else { } } end
This makes your code more maintainable if you have multiple Groups needing bypass functionality.
A quick note: Make sure your flags are scoped correctly (global vs. test-specific) depending on whether you need the bypass to apply across the entire test program or just a specific section. Also, double-check that your SmartTest version supports these flag-driven attributes—since you're on v7.1.3+, they should be fully compatible.
内容的提问来源于stack exchange,提问作者vicdelacruz

