From a5e30b6acf132471c6351bdb2f2691cdce42feed Mon Sep 17 00:00:00 2001 From: "anthony.wen" Date: Tue, 14 Apr 2026 19:05:37 -0400 Subject: [PATCH] Use actual ATVM runtime flow steps in watcher output --- atvm/docs/automation/guide.md | 2 +- atvm/docs/automation/run-learnings.md | 9 +++++++++ atvm/watcher-service/atvm_run_watcher.py | 11 +++++++---- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/atvm/docs/automation/guide.md b/atvm/docs/automation/guide.md index bccbd26..781f9f8 100644 --- a/atvm/docs/automation/guide.md +++ b/atvm/docs/automation/guide.md @@ -295,7 +295,7 @@ Status-report expectations: - In `TEST FLOW:`, show the template-specific numbered run flow once for the whole test, not per host. - For `TEST FLOW:`, treat the generated host spec from the actual run as the source of truth whenever it exists. - Extract the numbered flow steps from the generated `.ts` spec referenced by that run's `specPattern`. -- When the generated spec contains runtime-gated plugin branches such as `if(useFCPlugin)` and `if(useIscsiPlugin)`, only include the steps for the plugin path actually selected for that run. +- When the generated spec contains runtime-gated plugin branches such as `if(useFCPlugin)`, `if(useIscsiPlugin)`, `if(usePureFCPlugin)`, or `if(usePureIscsiPlugin)`, only include the steps for the plugin path actually selected for that run. - Do not prefer a static template flow list over a generated spec from the actual run. - Use template-level or static fallback flow only when the generated spec cannot be found or parsed. - If fallback is required, resolve it from the run template name before using any generic default flow. diff --git a/atvm/docs/automation/run-learnings.md b/atvm/docs/automation/run-learnings.md index 2f62527..055be47 100644 --- a/atvm/docs/automation/run-learnings.md +++ b/atvm/docs/automation/run-learnings.md @@ -535,3 +535,12 @@ This file stores run-specific examples only when a run produced a new learning r - Plan `cmc-systemOS` template commands without plugin-selection or integration-type arguments. - When watcher-backed execution is used for `cmc-systemOS`, omit watcher integration/plugin metadata too. - Keep plugin defaults scoped to templates that actually use plugin selection. + +## Run Learning: 2026-04-14 (Plugin-gated `TEST FLOW` filtering must match reboot and other template gate names too) +- Observed failure mode: + - A Pure FC `cmc-reboot` run still posted the combined FC+iSCSI step count even after the earlier `cmc-e2e` fix. + - The watcher only recognized `if(useFCPlugin)` / `if(useIscsiPlugin)` gates, while the reboot templates use names such as `if(usePureFCPlugin)` / `if(usePureIscsiPlugin)`. +- Action for future runs: + - Match plugin-gated generated-spec branches generically by plugin-bearing gate variable name instead of hardcoding only one template's variable names. + - Apply the same plugin-branch filtering logic across ATVM templates so new templates do not need one-off watcher fixes. + - Validate generated-spec `TEST FLOW` against the selected runtime plugin path for reboot and other templates before assuming the generic fix is complete. diff --git a/atvm/watcher-service/atvm_run_watcher.py b/atvm/watcher-service/atvm_run_watcher.py index 23ef06e..687d641 100644 --- a/atvm/watcher-service/atvm_run_watcher.py +++ b/atvm/watcher-service/atvm_run_watcher.py @@ -1282,10 +1282,13 @@ def extract_test_flow_from_generated_spec( def evaluate_gate_line(line: str, allowed_plugins: Optional[set[str]]) -> Tuple[bool, Optional[bool]]: normalized = re.sub(r"\s+", "", line) - if normalized.startswith("if(useFCPlugin)"): - return True, allowed_plugins is None or "fc" in allowed_plugins - if normalized.startswith("if(useIscsiPlugin)"): - return True, allowed_plugins is None or "iscsi" in allowed_plugins + plugin_gate_match = re.match(r"if\((use[A-Za-z]+Plugin)\)", normalized) + if plugin_gate_match: + variable_name = plugin_gate_match.group(1).lower() + if "iscsi" in variable_name: + return True, allowed_plugins is None or "iscsi" in allowed_plugins + if "fc" in variable_name: + return True, allowed_plugins is None or "fc" in allowed_plugins if normalized.startswith('if(Cypress.env("test-unaligned-fio")==true)'): value = runtime_settings.get("test-unaligned-fio") return True, value if isinstance(value, bool) else None