diff --git a/image/cli/masfvt/fvt-monitor.yml b/image/cli/masfvt/fvt-monitor.yml index 6708713d10e..92d99663cf6 100644 --- a/image/cli/masfvt/fvt-monitor.yml +++ b/image/cli/masfvt/fvt-monitor.yml @@ -24,7 +24,7 @@ {%- if '9.1' in mas_app_channel_monitor -%} fvt_91x {%- elif '9.2' in mas_app_channel_monitor -%} - fvt_91x + fvt_9x {%- elif mas_app_channel_manage == '' -%} monitor_fvt {%- else -%} diff --git a/tekton/src/pipelines/mas-fvt-launcher.yml.j2 b/tekton/src/pipelines/mas-fvt-launcher.yml.j2 index 3414cb6e51e..42a85a1e6bf 100644 --- a/tekton/src/pipelines/mas-fvt-launcher.yml.j2 +++ b/tekton/src/pipelines/mas-fvt-launcher.yml.j2 @@ -834,8 +834,9 @@ spec: runAfter: - approval-manage - # Launch Monitor FVT (Monitor < 9.2.0 - after IoT) - - name: launchfvt-monitor + # Launch Monitor FVT (Monitor >= 9.2.0 - before IoT) + # Waits for both Monitor and IoT installations to complete before launching + - name: launchfvt-monitor-before-iot timeout: "0" params: - name: image_pull_policy @@ -851,13 +852,12 @@ spec: values: ["true", "True"] - input: $(params.mas_monitor_install_order) operator: in - values: ["after-iot"] + values: ["before-iot"] runAfter: - - waitfor-monitor + - waitfor-monitor-before-iot - # Launch Monitor FVT (Monitor >= 9.2.0 - before IoT) - # Waits for both Monitor and IoT installations to complete before launching - - name: launchfvt-monitor-before-iot + # Launch Monitor FVT (Monitor < 9.2.0 - after IoT) - LEGACY + - name: launchfvt-monitor timeout: "0" params: - name: image_pull_policy @@ -873,10 +873,9 @@ spec: values: ["true", "True"] - input: $(params.mas_monitor_install_order) operator: in - values: ["before-iot"] + values: ["after-iot"] runAfter: - - waitfor-monitor-before-iot - - waitfor-iot-after-monitor + - waitfor-monitor # Approve Monitor for Monitor < 9.2.0 (after-iot scenario) - name: approval-monitor diff --git a/tekton/src/pipelines/mas-fvt-monitor.yml.j2 b/tekton/src/pipelines/mas-fvt-monitor.yml.j2 index 42362853c6c..c843ff8fcea 100644 --- a/tekton/src/pipelines/mas-fvt-monitor.yml.j2 +++ b/tekton/src/pipelines/mas-fvt-monitor.yml.j2 @@ -59,7 +59,7 @@ spec: - name: fvt_test_suite type: string - description: Which Monitor FVT suite to run [monitor_fvt, monitor_fvt_with_manage, fvt_91x] + description: Which Monitor FVT suite to run [fvt_91x (9.1 only), fvt_9x (9.2+), fvt_monitor_only, fvt_mref, fvt_iot, fvt_scada, fvt_mist, monitor_fvt_with_manage (8.x/9.0 only)] default: "" tasks: @@ -122,30 +122,66 @@ spec: operator: notin values: [""] - # 2. Monitor FVT (with or without Manage Integration) + # 2. Monitor FVT Phase 1 - Pre-IoT (File Ingest) # ----------------------------------------------------------------------------- - # When Manage is installed in the cluster, many Monitor APIs are disabled, this - # prevents the standard Monitor FVT suite from running so this IVT suite must run instead - # - # fvt_test_suite should be set to one of the following: - # - monitor_fvt - # - monitor_fvt_with_manage - # - # These testsuites are mutually exclusive - - name: fvt-monitor + # Phase 1 runs immediately after Monitor installation completes + {{ lookup('template', 'taskdefs/fvt-monitor/pipeline-phase1.yml.j2') | indent(4) }} + + # 3. Wait for IoT Installation + # ----------------------------------------------------------------------------- + - name: waitfor-iot + timeout: "0" + taskRef: + kind: Task + name: mas-devops-wait-for-configmap + params: + - name: image_pull_policy + value: $(params.image_pull_policy) + - name: namespace + value: $(context.taskRun.namespace) + - name: configmap_name + value: sync-install + - name: configmap_key + value: IOT_INSTALL_STATUS + - name: configmap_target_value + value: Completed + - name: delay + value: "60" + - name: max_retries + value: "60" + - name: ignore_failure + value: "False" + when: + - input: "$(params.fvt_digest_monitor)" + operator: notin + values: [""] + - input: "$(params.fvt_test_suite)" + operator: notin + values: ["monitor_fvt_with_manage"] + runAfter: + - fvt-monitor-only + + # 4. Monitor FVT Phase 2 - Post-IoT (Parallel Execution) + # ----------------------------------------------------------------------------- + # Phase 2 runs in parallel after IoT installation completes + {{ lookup('template', 'taskdefs/fvt-monitor/pipeline-phase2.yml.j2') | indent(4) }} + + # 5. Monitor FVT with Manage Integration (Version 8.x/9.0 only - LEGACY) + # ----------------------------------------------------------------------------- + # This is a separate suite for older Monitor versions (8.10, 8.11, 9.0) when Manage is installed + # It is NOT part of the phased execution model above + - name: fvt-monitor-with-manage params: - name: mas_instance_id value: $(params.mas_instance_id) - name: mas_workspace_id value: $(params.mas_workspace_id) - - name: fvt_image_registry value: $(params.fvt_image_registry) - name: fvt_image_digest value: $(params.fvt_digest_monitor) - - name: fvt_test_suite - value: $(params.fvt_test_suite) # pytest_marker in Monitor Test Framework + value: $(params.fvt_test_suite) - name: product_channel value: $(params.mas_app_channel_monitor) timeout: "0" @@ -158,7 +194,7 @@ spec: values: [""] - input: "$(params.fvt_test_suite)" operator: in - values: ["monitor_fvt", "monitor_fvt_with_manage", "fvt_91x"] + values: ["monitor_fvt_with_manage"] runAfter: - ivtcore-monitor workspaces: @@ -169,7 +205,7 @@ spec: # ------------------------------------------------------------------------- {{ lookup('template', 'taskdefs/fvt-data-dictionary/data-dictionary.yml.j2') | indent(4) }} runAfter: - - fvt-monitor + - fvt-monitor-with-manage finally: # 1. Run CV diff --git a/tekton/src/pipelines/taskdefs/fvt-monitor/params.yml.j2 b/tekton/src/pipelines/taskdefs/fvt-monitor/params.yml.j2 new file mode 100644 index 00000000000..7d322dd5cc1 --- /dev/null +++ b/tekton/src/pipelines/taskdefs/fvt-monitor/params.yml.j2 @@ -0,0 +1,10 @@ +- name: mas_instance_id + value: $(params.mas_instance_id) +- name: mas_workspace_id + value: $(params.mas_workspace_id) +- name: fvt_image_registry + value: $(params.fvt_image_registry) +- name: fvt_image_digest + value: $(params.fvt_digest_monitor) +- name: product_channel + value: $(params.mas_app_channel_monitor) \ No newline at end of file diff --git a/tekton/src/pipelines/taskdefs/fvt-monitor/phase1.yml.j2 b/tekton/src/pipelines/taskdefs/fvt-monitor/phase1.yml.j2 new file mode 100644 index 00000000000..3b4afa5d37d --- /dev/null +++ b/tekton/src/pipelines/taskdefs/fvt-monitor/phase1.yml.j2 @@ -0,0 +1,27 @@ +# ------------------------------------------------------------- +# PHASE 1 - Pre-IoT Installation +# - fvt-monitor-only (File Ingest - NO IoT required) +# ------------------------------------------------------------- + +# Monitor FVT - File Ingest (runs BEFORE IoT installation) +- name: fvt-monitor-only + {{ lookup('template', pipeline_src_dir ~ '/taskdefs/fvt-monitor/taskref.yml.j2') | indent(2) }} + params: + {{ lookup('template', pipeline_src_dir ~ '/taskdefs/fvt-monitor/params.yml.j2') | indent(4) }} + - name: fvt_test_suite + value: fvt_monitor_only + when: + - input: "$(params.launchfvt_monitor)" + operator: in + values: ["true", "True"] + - input: "$(params.mas_monitor_install_order)" + operator: in + values: ["before-iot"] + - input: "$(params.fvt_digest_monitor)" + operator: notin + values: [""] + - input: "$(params.mas_app_channel_monitor)" + operator: notin + values: [""] + runAfter: + - waitfor-monitor-before-iot \ No newline at end of file diff --git a/tekton/src/pipelines/taskdefs/fvt-monitor/phase2.yml.j2 b/tekton/src/pipelines/taskdefs/fvt-monitor/phase2.yml.j2 new file mode 100644 index 00000000000..67feda88770 --- /dev/null +++ b/tekton/src/pipelines/taskdefs/fvt-monitor/phase2.yml.j2 @@ -0,0 +1,144 @@ +# ------------------------------------------------------------- +# PHASE 2 - Post-IoT Installation (Parallel Execution) +# All suites for version > 9.2 run in PARALLEL after IoT installation: +# - fvt-9x (Core Monitor tests) +# - fvt-mref (Bootstrap & integration setup) +# - fvt-iot (IoT integration tests) +# - fvt-scada (SCADA connector tests) +# - fvt-mist (MIST integration tests) +# ------------------------------------------------------------- + +# Monitor FVT - Core Monitor Tests (runs in PARALLEL after IoT installation) +- name: fvt-9x + {{ lookup('template', pipeline_src_dir ~ '/taskdefs/fvt-monitor/taskref.yml.j2') | indent(2) }} + params: + {{ lookup('template', pipeline_src_dir ~ '/taskdefs/fvt-monitor/params.yml.j2') | indent(4) }} + - name: fvt_test_suite + value: fvt_9x + when: + - input: "$(params.launchfvt_monitor)" + operator: in + values: ["true", "True"] + - input: "$(params.fvt_test_suite)" + operator: in + values: ["fvt_9x", "fvt_91x"] + - input: "$(params.mas_monitor_install_order)" + operator: in + values: ["before-iot"] + - input: "$(params.fvt_digest_monitor)" + operator: notin + values: [""] + - input: "$(params.mas_app_channel_monitor)" + operator: notin + values: [""] + runAfter: + - fvt-monitor-only + - waitfor-iot-after-monitor + +# Monitor FVT - Bootstrap & Integration Setup (runs in PARALLEL after IoT installation) +- name: fvt-mref + {{ lookup('template', pipeline_src_dir ~ '/taskdefs/fvt-monitor/taskref.yml.j2') | indent(2) }} + params: + {{ lookup('template', pipeline_src_dir ~ '/taskdefs/fvt-monitor/params.yml.j2') | indent(4) }} + - name: fvt_test_suite + value: fvt_mref + when: + - input: "$(params.launchfvt_monitor)" + operator: in + values: ["true", "True"] + - input: "$(params.fvt_test_suite)" + operator: in + values: ["fvt_mref", "fvt_9x", "fvt_91x"] + - input: "$(params.mas_monitor_install_order)" + operator: in + values: ["before-iot"] + - input: "$(params.fvt_digest_monitor)" + operator: notin + values: [""] + - input: "$(params.mas_app_channel_monitor)" + operator: notin + values: [""] + runAfter: + - fvt-monitor-only + - waitfor-iot-after-monitor + +# Monitor FVT - IoT Integration Tests (runs in PARALLEL after IoT installation) +- name: fvt-iot + {{ lookup('template', pipeline_src_dir ~ '/taskdefs/fvt-monitor/taskref.yml.j2') | indent(2) }} + params: + {{ lookup('template', pipeline_src_dir ~ '/taskdefs/fvt-monitor/params.yml.j2') | indent(4) }} + - name: fvt_test_suite + value: fvt_iot + when: + - input: "$(params.launchfvt_monitor)" + operator: in + values: ["true", "True"] + - input: "$(params.fvt_test_suite)" + operator: in + values: ["fvt_iot", "fvt_9x"] + - input: "$(params.mas_monitor_install_order)" + operator: in + values: ["before-iot"] + - input: "$(params.fvt_digest_monitor)" + operator: notin + values: [""] + - input: "$(params.mas_app_channel_monitor)" + operator: notin + values: [""] + runAfter: + - fvt-monitor-only + - waitfor-iot-after-monitor + +# Monitor FVT - SCADA Connector Tests (runs in PARALLEL after IoT installation) +- name: fvt-scada + {{ lookup('template', pipeline_src_dir ~ '/taskdefs/fvt-monitor/taskref.yml.j2') | indent(2) }} + params: + {{ lookup('template', pipeline_src_dir ~ '/taskdefs/fvt-monitor/params.yml.j2') | indent(4) }} + - name: fvt_test_suite + value: fvt_scada + when: + - input: "$(params.launchfvt_monitor)" + operator: in + values: ["true", "True"] + - input: "$(params.fvt_test_suite)" + operator: in + values: ["fvt_scada", "fvt_9x", "fvt_91x"] + - input: "$(params.mas_monitor_install_order)" + operator: in + values: ["before-iot"] + - input: "$(params.fvt_digest_monitor)" + operator: notin + values: [""] + - input: "$(params.mas_app_channel_monitor)" + operator: notin + values: [""] + runAfter: + - fvt-monitor-only + - waitfor-iot-after-monitor + +# Monitor FVT - MIST Integration Tests (runs in PARALLEL after IoT installation) +- name: fvt-mist + {{ lookup('template', pipeline_src_dir ~ '/taskdefs/fvt-monitor/taskref.yml.j2') | indent(2) }} + params: + {{ lookup('template', pipeline_src_dir ~ '/taskdefs/fvt-monitor/params.yml.j2') | indent(4) }} + - name: fvt_test_suite + value: fvt_mist + when: + - input: "$(params.launchfvt_monitor)" + operator: in + values: ["true", "True"] + - input: "$(params.fvt_test_suite)" + operator: in + values: ["fvt_mist", "fvt_9x"] + - input: "$(params.mas_monitor_install_order)" + operator: in + values: ["before-iot"] + - input: "$(params.fvt_digest_monitor)" + operator: notin + values: [""] + - input: "$(params.mas_app_channel_monitor)" + operator: notin + values: [""] + runAfter: + - fvt-monitor-only + - waitfor-iot-after-monitor diff --git a/tekton/src/pipelines/taskdefs/fvt-monitor/pipeline-phase1.yml.j2 b/tekton/src/pipelines/taskdefs/fvt-monitor/pipeline-phase1.yml.j2 new file mode 100644 index 00000000000..39c8499e5bc --- /dev/null +++ b/tekton/src/pipelines/taskdefs/fvt-monitor/pipeline-phase1.yml.j2 @@ -0,0 +1,21 @@ +# ------------------------------------------------------------- +# PHASE 1 - Pre-IoT Installation +# - fvt-monitor-only (File Ingest - NO IoT required) +# ------------------------------------------------------------- + +# Monitor FVT - File Ingest (runs BEFORE IoT installation) +- name: fvt-monitor-only + {{ lookup('template', pipeline_src_dir ~ '/taskdefs/fvt-monitor/taskref.yml.j2') | indent(2) }} + params: + {{ lookup('template', pipeline_src_dir ~ '/taskdefs/fvt-monitor/params.yml.j2') | indent(4) }} + - name: fvt_test_suite + value: fvt_monitor_only + when: + - input: "$(params.fvt_digest_monitor)" + operator: notin + values: [""] + - input: "$(params.fvt_test_suite)" + operator: notin + values: ["monitor_fvt_with_manage"] + runAfter: + - ivtcore-monitor \ No newline at end of file diff --git a/tekton/src/pipelines/taskdefs/fvt-monitor/pipeline-phase2.yml.j2 b/tekton/src/pipelines/taskdefs/fvt-monitor/pipeline-phase2.yml.j2 new file mode 100644 index 00000000000..46a80d6cc1f --- /dev/null +++ b/tekton/src/pipelines/taskdefs/fvt-monitor/pipeline-phase2.yml.j2 @@ -0,0 +1,99 @@ +# ------------------------------------------------------------- +# PHASE 2 - Post-IoT Installation (Parallel Execution) +# All suites run in PARALLEL after IoT installation: +# - fvt-9x (Core Monitor tests) +# - fvt-mref (Bootstrap & integration setup) +# - fvt-iot (IoT integration tests) +# - fvt-scada (SCADA connector tests) +# - fvt-mist (MIST integration tests) +# ------------------------------------------------------------- + +# Monitor FVT - Core Monitor Tests (runs in PARALLEL after IoT installation) +- name: fvt-9x + {{ lookup('template', pipeline_src_dir ~ '/taskdefs/fvt-monitor/taskref.yml.j2') | indent(2) }} + params: + {{ lookup('template', pipeline_src_dir ~ '/taskdefs/fvt-monitor/params.yml.j2') | indent(4) }} + - name: fvt_test_suite + value: fvt_9x + when: + - input: "$(params.fvt_digest_monitor)" + operator: notin + values: [""] + - input: "$(params.fvt_test_suite)" + operator: in + values: ["fvt_9x", "fvt_91x"] + runAfter: + - fvt-monitor-only + - waitfor-iot + +# Monitor FVT - Bootstrap & Integration Setup (runs in PARALLEL after IoT installation) +- name: fvt-mref + {{ lookup('template', pipeline_src_dir ~ '/taskdefs/fvt-monitor/taskref.yml.j2') | indent(2) }} + params: + {{ lookup('template', pipeline_src_dir ~ '/taskdefs/fvt-monitor/params.yml.j2') | indent(4) }} + - name: fvt_test_suite + value: fvt_mref + when: + - input: "$(params.fvt_digest_monitor)" + operator: notin + values: [""] + - input: "$(params.fvt_test_suite)" + operator: in + values: ["fvt_mref", "fvt_9x", "fvt_91x"] + runAfter: + - fvt-monitor-only + - waitfor-iot + +# Monitor FVT - IoT Integration Tests (runs in PARALLEL after IoT installation) +- name: fvt-iot + {{ lookup('template', pipeline_src_dir ~ '/taskdefs/fvt-monitor/taskref.yml.j2') | indent(2) }} + params: + {{ lookup('template', pipeline_src_dir ~ '/taskdefs/fvt-monitor/params.yml.j2') | indent(4) }} + - name: fvt_test_suite + value: fvt_iot + when: + - input: "$(params.fvt_digest_monitor)" + operator: notin + values: [""] + - input: "$(params.fvt_test_suite)" + operator: in + values: ["fvt_iot", "fvt_9x"] + runAfter: + - fvt-monitor-only + - waitfor-iot + +# Monitor FVT - SCADA Connector Tests (runs in PARALLEL after IoT installation) +- name: fvt-scada + {{ lookup('template', pipeline_src_dir ~ '/taskdefs/fvt-monitor/taskref.yml.j2') | indent(2) }} + params: + {{ lookup('template', pipeline_src_dir ~ '/taskdefs/fvt-monitor/params.yml.j2') | indent(4) }} + - name: fvt_test_suite + value: fvt_scada + when: + - input: "$(params.fvt_digest_monitor)" + operator: notin + values: [""] + - input: "$(params.fvt_test_suite)" + operator: in + values: ["fvt_scada", "fvt_9x", "fvt_91x"] + runAfter: + - fvt-monitor-only + - waitfor-iot + +# Monitor FVT - MIST Integration Tests (runs in PARALLEL after IoT installation) +- name: fvt-mist + {{ lookup('template', pipeline_src_dir ~ '/taskdefs/fvt-monitor/taskref.yml.j2') | indent(2) }} + params: + {{ lookup('template', pipeline_src_dir ~ '/taskdefs/fvt-monitor/params.yml.j2') | indent(4) }} + - name: fvt_test_suite + value: fvt_mist + when: + - input: "$(params.fvt_digest_monitor)" + operator: notin + values: [""] + - input: "$(params.fvt_test_suite)" + operator: in + values: ["fvt_mist", "fvt_9x"] + runAfter: + - fvt-monitor-only + - waitfor-iot \ No newline at end of file diff --git a/tekton/src/pipelines/taskdefs/fvt-monitor/taskref.yml.j2 b/tekton/src/pipelines/taskdefs/fvt-monitor/taskref.yml.j2 new file mode 100644 index 00000000000..0fba5df9c1d --- /dev/null +++ b/tekton/src/pipelines/taskdefs/fvt-monitor/taskref.yml.j2 @@ -0,0 +1,7 @@ +timeout: "0" +taskRef: + kind: Task + name: mas-fvt-monitor +workspaces: + - name: configs + workspace: shared-configs \ No newline at end of file diff --git a/tekton/src/tasks/fvt/mas-fvt-monitor.yml.j2 b/tekton/src/tasks/fvt/mas-fvt-monitor.yml.j2 index 37c561d02f8..fafd34313cd 100644 --- a/tekton/src/tasks/fvt/mas-fvt-monitor.yml.j2 +++ b/tekton/src/tasks/fvt/mas-fvt-monitor.yml.j2 @@ -40,7 +40,11 @@ spec: default: "true" - name: fvt_test_suite type: string - description: Which Monitor FVT suite to run ('monitor_fvt' or 'monitor_fvt_with_manage') + description: Which Monitor FVT suite to run ('fvt_91x', 'fvt_monitor_only', or 'monitor_fvt_with_manage') + - name: test_marker + type: string + description: Pytest marker to filter tests (e.g., 'monitor_only', 'requires_iot', 'integration') + default: "" - name: ctf_is_local type: string description: Boolean value to check if tests are runninng locally or on fvt @@ -84,6 +88,8 @@ spec: # Test Data - name: FVT_TEST_SUITE value: $(params.fvt_test_suite) + - name: TEST_MARKER + value: $(params.test_marker) - name: FVT_ENABLE_DEBUG value: "$(params.fvt_enable_debug)" - name: CTF_IS_LOCAL