From f5497d4d8d51e7c9d35ed0ccbc3c91e02dd2cac0 Mon Sep 17 00:00:00 2001 From: OAharoni-RedHat Date: Mon, 5 Oct 2026 15:27:35 -0400 Subject: [PATCH 1/2] update to single argocd and variant --- .gitignore | 3 +++ overrides/values-aap-config-aeg.yaml | 1 + values-global.yaml | 4 +++- values-hub.yaml => variants/hub/values-hub.yaml | 0 4 files changed, 7 insertions(+), 1 deletion(-) rename values-hub.yaml => variants/hub/values-hub.yaml (100%) diff --git a/.gitignore b/.gitignore index eda24a5d..148f6126 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,6 @@ vault.init pattern-vault.init.bak super-linter.log .vscode +__pycache__/ +tests/ci/.results/ +tests/ci/.pytest_cache/ diff --git a/overrides/values-aap-config-aeg.yaml b/overrides/values-aap-config-aeg.yaml index b4b38745..c8d9ecfb 100644 --- a/overrides/values-aap-config-aeg.yaml +++ b/overrides/values-aap-config-aeg.yaml @@ -2,3 +2,4 @@ agof: cac_repo: https://github.com/validatedpatterns-demos/ansible-edge-gitops-hmi-config-as-code.git cac_revision: v2 + \ No newline at end of file diff --git a/values-global.yaml b/values-global.yaml index 87cfc477..29e7eb2d 100644 --- a/values-global.yaml +++ b/values-global.yaml @@ -8,8 +8,10 @@ global: installPlanApproval: Automatic syncPolicy: Automatic useCSV: false + singleArgoCD: true + main: - clusterGroupName: hub + variant: hub multiSourceConfig: enabled: true clusterGroupChartVersion: 0.9.* diff --git a/values-hub.yaml b/variants/hub/values-hub.yaml similarity index 100% rename from values-hub.yaml rename to variants/hub/values-hub.yaml From e0b79aeb1f713300db4fd55c0b60c257070bc072 Mon Sep 17 00:00:00 2001 From: OAharoni-RedHat Date: Mon, 5 Oct 2026 15:27:59 -0400 Subject: [PATCH 2/2] delete interop tests folder --- tests/interop/README.md | 23 ----- tests/interop/__init__.py | 2 - tests/interop/conftest.py | 2 - tests/interop/create_ci_badge.py | 84 ------------------- tests/interop/requirements.txt | 6 -- tests/interop/run_tests.sh | 27 ------ tests/interop/test_check_vm_status.py | 46 ---------- tests/interop/test_subscription_status_hub.py | 29 ------- .../test_validate_hub_site_components.py | 82 ------------------ 9 files changed, 301 deletions(-) delete mode 100644 tests/interop/README.md delete mode 100644 tests/interop/__init__.py delete mode 100644 tests/interop/conftest.py delete mode 100644 tests/interop/create_ci_badge.py delete mode 100644 tests/interop/requirements.txt delete mode 100755 tests/interop/run_tests.sh delete mode 100644 tests/interop/test_check_vm_status.py delete mode 100644 tests/interop/test_subscription_status_hub.py delete mode 100644 tests/interop/test_validate_hub_site_components.py diff --git a/tests/interop/README.md b/tests/interop/README.md deleted file mode 100644 index 83f864db..00000000 --- a/tests/interop/README.md +++ /dev/null @@ -1,23 +0,0 @@ -# Running tests - -## Prerequisites - -* Openshift cluster with ansible-edge-gitops pattern installed -* kubeconfig file for Openshift cluster -* oc client installed at ~/oc_client/oc - -## Steps - -* create python3 venv, clone ansible-edge-gitops repository -* export KUBECONFIG=\ -* export INFRA_PROVIDER=\ -* (optional) export WORKSPACE=\ (defaults to /tmp) -* cd ansible-edge-gitops/tests/interop -* pip install -r requirements.txt -* ./run_tests.sh - -## Results - -* results .xml files will be placed at $WORKSPACE -* test logs will be placed at $WORKSPACE/.results/test_execution_logs/ -* CI badge file will be placed at $WORKSPACE diff --git a/tests/interop/__init__.py b/tests/interop/__init__.py deleted file mode 100644 index 890362ce..00000000 --- a/tests/interop/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -__version__ = "0.1.0" -__loggername__ = "css_logger" diff --git a/tests/interop/conftest.py b/tests/interop/conftest.py deleted file mode 100644 index fb301d57..00000000 --- a/tests/interop/conftest.py +++ /dev/null @@ -1,2 +0,0 @@ -from validatedpatterns_tests.interop.conftest_logger import * # noqa: F401, F403 -from validatedpatterns_tests.interop.conftest_openshift import * # noqa: F401, F403 diff --git a/tests/interop/create_ci_badge.py b/tests/interop/create_ci_badge.py deleted file mode 100644 index 8ed179a4..00000000 --- a/tests/interop/create_ci_badge.py +++ /dev/null @@ -1,84 +0,0 @@ -import json -import os -import subprocess -from datetime import datetime - -from junitparser import JUnitXml - -oc = os.environ["HOME"] + "/oc_client/oc" - -ci_badge = { - "schemaVersion": 1, - "label": "Community test", - "message": "", - "color": "red", - "openshiftVersion": "", - "infraProvider": os.environ.get("INFRA_PROVIDER"), - "patternName": os.environ.get("PATTERN_NAME"), - "patternRepo": "", - "patternBranch": "", - "date": datetime.today().strftime("%Y-%m-%d"), - "testSource": "Community", - "debugInfo": None, -} - - -def get_openshift_version(): - try: - version_ret = subprocess.run([oc, "version", "-o", "json"], capture_output=True) - version_out = version_ret.stdout.decode("utf-8") - openshift_version = json.loads(version_out)["openshiftVersion"] - major_minor = ".".join(openshift_version.split(".")[:-1]) - return openshift_version, major_minor - except KeyError as e: - print("KeyError:" + str(e)) - return None - - -if __name__ == "__main__": - versions = get_openshift_version() - ci_badge["openshiftVersion"] = versions[0] - - pattern_repo = subprocess.run( - ["git", "config", "--get", "remote.origin.url"], capture_output=True, text=True - ) - pattern_branch = subprocess.run( - ["git", "branch", "--show-current"], capture_output=True, text=True - ) - - ci_badge["patternRepo"] = pattern_repo.stdout.strip() - ci_badge["patternBranch"] = pattern_branch.stdout.strip() - - # Check each xml file for failures - results_dir = os.environ.get("WORKSPACE") - failures = 0 - - for file in os.listdir(results_dir): - if file.startswith("test_") and file.endswith(".xml"): - with open(os.path.join(results_dir, file), "r") as result_file: # type: ignore - xml = JUnitXml.fromfile(result_file) # type: ignore - for suite in xml: - for case in suite: - if case.result: - failures += 1 - - # Determine badge color from results - if failures == 0: - ci_badge["color"] = "green" - - # For now we assume `message` is the same as patternBranch - ci_badge["message"] = ci_badge["patternBranch"] - - ci_badge_json_basename = ( - os.environ.get("PATTERN_SHORTNAME") # type: ignore - + "-" - + os.environ.get("INFRA_PROVIDER") - + "-" - + versions[1] - + "-stable-badge.json" - ) - ci_badge_json_filename = os.path.join(results_dir, ci_badge_json_basename) # type: ignore - print(f"Creating CI badge file at: {ci_badge_json_filename}") - - with open(ci_badge_json_filename, "w") as ci_badge_file: - json.dump(ci_badge, ci_badge_file) diff --git a/tests/interop/requirements.txt b/tests/interop/requirements.txt deleted file mode 100644 index 3b20852f..00000000 --- a/tests/interop/requirements.txt +++ /dev/null @@ -1,6 +0,0 @@ -pytest -kubernetes -openshift -openshift-python-wrapper -junitparser -git+https://github.com/validatedpatterns/vp-qe-test-common.git@development#egg=vp-qe-test-common \ No newline at end of file diff --git a/tests/interop/run_tests.sh b/tests/interop/run_tests.sh deleted file mode 100755 index b94a31c9..00000000 --- a/tests/interop/run_tests.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/bash - -export EXTERNAL_TEST="true" -export PATTERN_NAME="AnsibleEdgeGitops" -export PATTERN_SHORTNAME="aegitops" - -if [ -z "${KUBECONFIG}" ]; then - echo "No kubeconfig file set for hub cluster" - exit 1 -fi - -if [ -z "${INFRA_PROVIDER}" ]; then - echo "INFRA_PROVIDER is not defined" - exit 1 -fi - -if [ -z "${WORKSPACE}" ]; then - export WORKSPACE=/tmp -fi - -pytest -lv --disable-warnings test_subscription_status_hub.py --kubeconfig $KUBECONFIG --junit-xml $WORKSPACE/test_subscription_status_hub.xml - -pytest -lv --disable-warnings test_check_vm_status.py --kubeconfig $KUBECONFIG --junit-xml $WORKSPACE/test_check_vm_status.xml - -pytest -lv --disable-warnings test_validate_hub_site_components.py --kubeconfig $KUBECONFIG --junit-xml $WORKSPACE/test_validate_hub_site_components.xml - -python3 create_ci_badge.py diff --git a/tests/interop/test_check_vm_status.py b/tests/interop/test_check_vm_status.py deleted file mode 100644 index 6c09afa3..00000000 --- a/tests/interop/test_check_vm_status.py +++ /dev/null @@ -1,46 +0,0 @@ -import logging -import os -import time - -import pytest -from validatedpatterns_tests.interop.crd import ArgoCD - -from . import __loggername__ - -logger = logging.getLogger(__loggername__) - -oc = os.environ["HOME"] + "/oc_client/oc" - - -@pytest.mark.check_vm_status -def test_check_vm_status(openshift_dyn_client): - logger.info("Get status for 'edge-gitops-vms' application") - timeout = time.time() + 60 * 30 - while time.time() < timeout: - app = ArgoCD.get( - dyn_client=openshift_dyn_client, - namespace="ansible-edge-gitops-hub", - name="edge-gitops-vms", - ) - app = next(app) - app_name = app.instance.metadata.name - app_health = app.instance.status.health.status - app_sync = app.instance.status.sync.status - - logger.info(f"Status for {app_name} : {app_health} : {app_sync}") - - if app_health == "Healthy" and app_sync == "Synced": - failed = False - break - else: - logger.info(f"Waiting for {app_name} app to sync") - time.sleep(30) - failed = True - - if failed: - logger.info(app) - err_msg = "Some or all applications deployed on hub site are unhealthy" - logger.error(f"FAIL: {err_msg}: {app_name}") - assert False, err_msg - else: - logger.info("PASS: All applications deployed on hub site are healthy.") diff --git a/tests/interop/test_subscription_status_hub.py b/tests/interop/test_subscription_status_hub.py deleted file mode 100644 index 3318b3ed..00000000 --- a/tests/interop/test_subscription_status_hub.py +++ /dev/null @@ -1,29 +0,0 @@ -import logging - -import pytest -from validatedpatterns_tests.interop import subscription - -from . import __loggername__ - -logger = logging.getLogger(__loggername__) - - -@pytest.mark.subscription_status_hub -def test_subscription_status_hub(openshift_dyn_client): - # These are the operator subscriptions and their associated namespaces - expected_subs = { - "openshift-gitops-operator": ["openshift-operators"], - "patterns-operator": ["openshift-operators"], - "odf-operator": ["openshift-storage"], - "kubevirt-hyperconverged": ["openshift-cnv"], - "ansible-automation-platform-operator": ["ansible-automation-platform"], - } - - err_msg = subscription.subscription_status( - openshift_dyn_client, expected_subs, diff=True - ) - if err_msg: - logger.error(f"FAIL: {err_msg}") - assert False, err_msg - else: - logger.info("PASS: Subscription status check passed") diff --git a/tests/interop/test_validate_hub_site_components.py b/tests/interop/test_validate_hub_site_components.py deleted file mode 100644 index b12164ed..00000000 --- a/tests/interop/test_validate_hub_site_components.py +++ /dev/null @@ -1,82 +0,0 @@ -import logging -import os - -import pytest -from ocp_resources.storage_class import StorageClass -from validatedpatterns_tests.interop import application, components - -from . import __loggername__ - -logger = logging.getLogger(__loggername__) - -oc = os.environ["HOME"] + "/oc_client/oc" - - -@pytest.mark.test_validate_hub_site_components -def test_validate_hub_site_components(openshift_dyn_client): - logger.info("Checking Openshift version on hub site") - version_out = components.dump_openshift_version() - logger.info(f"Openshift version:\n{version_out}") - - logger.info("Dump PVC and storageclass info") - pvcs_out = components.dump_pvc() - logger.info(f"PVCs:\n{pvcs_out}") - - for sc in StorageClass.get(dyn_client=openshift_dyn_client): - logger.info(sc.instance) - - -@pytest.mark.validate_hub_site_reachable -def test_validate_hub_site_reachable(kube_config, openshift_dyn_client): - logger.info("Check if hub site API end point is reachable") - err_msg = components.validate_site_reachable(kube_config, openshift_dyn_client) - if err_msg: - logger.error(f"FAIL: {err_msg}") - assert False, err_msg - else: - logger.info("PASS: Hub site is reachable") - - -@pytest.mark.check_pod_status_hub -def test_check_pod_status(openshift_dyn_client): - logger.info("Checking pod status") - projects = [ - "openshift-operators", - "ansible-automation-platform", - "ansible-edge-gitops-hub", - "openshift-gitops", - "edge-gitops-vms", - "vault", - ] - err_msg = components.check_pod_status(openshift_dyn_client, projects) - if err_msg: - logger.error(f"FAIL: {err_msg}") - assert False, err_msg - else: - logger.info("PASS: Pod status check succeeded.") - - -@pytest.mark.validate_argocd_reachable_hub_site -def test_validate_argocd_reachable_hub_site(openshift_dyn_client): - logger.info("Check if argocd route/url on hub site is reachable") - err_msg = components.validate_argocd_reachable(openshift_dyn_client) - if err_msg: - logger.error(f"FAIL: {err_msg}") - assert False, err_msg - else: - logger.info("PASS: Argocd is reachable") - - -@pytest.mark.validate_argocd_applications_health_hub_site -def test_validate_argocd_applications_health_hub_site(openshift_dyn_client): - logger.info("Get all applications deployed by argocd on hub site") - projects = ["openshift-gitops", "ansible-edge-gitops-hub"] - unhealthy_apps = application.get_argocd_application_status( - openshift_dyn_client, projects - ) - if unhealthy_apps: - err_msg = "Some or all applications deployed on hub site are unhealthy" - logger.error(f"FAIL: {err_msg}:\n{unhealthy_apps}") - assert False, err_msg - else: - logger.info("PASS: All applications deployed on hub site are healthy.")