Skip to content

Commit a04ee62

Browse files
committed
CherryPicked: [cnv-4.20] Remove duplicate HPP observability tests already covered in T1
original PR: RedHatQE#3853
1 parent 53c9344 commit a04ee62

File tree

8 files changed

+0
-241
lines changed

8 files changed

+0
-241
lines changed

tests/conftest.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,6 @@
202202
VirtualMachineForTests,
203203
create_vm_cloning_job,
204204
fedora_vm_body,
205-
get_all_virt_pods_with_running_status,
206205
get_base_templates_list,
207206
get_hyperconverged_kubevirt,
208207
get_hyperconverged_ovs_annotations,
@@ -1998,11 +1997,6 @@ def compact_cluster(nodes, workers, control_plane_nodes):
19981997
return len(nodes) == len(workers) == len(control_plane_nodes) == 3
19991998

20001999

2001-
@pytest.fixture()
2002-
def virt_pods_with_running_status(admin_client, hco_namespace):
2003-
return get_all_virt_pods_with_running_status(dyn_client=admin_client, hco_namespace=hco_namespace)
2004-
2005-
20062000
@pytest.fixture(scope="session")
20072001
def bin_directory(tmpdir_factory):
20082002
return tmpdir_factory.mktemp("bin")

tests/observability/conftest.py

Lines changed: 0 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,8 @@
22

33
import pytest
44
from ocp_resources.ssp import SSP
5-
from timeout_sampler import TimeoutExpiredError, TimeoutSampler
65

7-
from tests.observability.utils import (
8-
get_olm_namespace,
9-
)
10-
from utilities.constants import (
11-
TIMEOUT_5MIN,
12-
TIMEOUT_5SEC,
13-
VIRT_OPERATOR,
14-
)
156
from utilities.hco import ResourceEditorValidateHCOReconcile
16-
from utilities.infra import scale_deployment_replicas
17-
from utilities.virt import get_all_virt_pods_with_running_status
187

198
LOGGER = logging.getLogger(__name__)
209
ANNOTATIONS_FOR_VIRT_OPERATOR_ENDPOINT = {
@@ -36,52 +25,3 @@ def paused_ssp_operator(admin_client, hco_namespace, ssp_resource_scope_class):
3625
list_resource_reconcile=[SSP],
3726
):
3827
yield
39-
40-
41-
@pytest.fixture(scope="session")
42-
def olm_namespace():
43-
return get_olm_namespace()
44-
45-
46-
@pytest.fixture(scope="class")
47-
def disabled_olm_operator(olm_namespace):
48-
with scale_deployment_replicas(
49-
deployment_name="olm-operator",
50-
namespace=olm_namespace.name,
51-
replica_count=0,
52-
):
53-
yield
54-
55-
56-
@pytest.fixture(scope="class")
57-
def disabled_virt_operator(admin_client, hco_namespace, disabled_olm_operator):
58-
virt_pods_with_running_status = get_all_virt_pods_with_running_status(
59-
dyn_client=admin_client, hco_namespace=hco_namespace
60-
)
61-
virt_pods_count_before_disabling_virt_operator = len(virt_pods_with_running_status.keys())
62-
with scale_deployment_replicas(
63-
deployment_name=VIRT_OPERATOR,
64-
namespace=hco_namespace.name,
65-
replica_count=0,
66-
):
67-
yield
68-
69-
samples = TimeoutSampler(
70-
wait_timeout=TIMEOUT_5MIN,
71-
sleep=TIMEOUT_5SEC,
72-
func=get_all_virt_pods_with_running_status,
73-
dyn_client=admin_client,
74-
hco_namespace=hco_namespace,
75-
)
76-
sample = None
77-
try:
78-
for sample in samples:
79-
if len(sample.keys()) == virt_pods_count_before_disabling_virt_operator:
80-
return True
81-
except TimeoutExpiredError:
82-
LOGGER.error(
83-
f"After restoring replicas for {VIRT_OPERATOR},"
84-
f"{virt_pods_with_running_status} virt pods were expected to be in running state."
85-
f"Here are available virt pods: {sample}"
86-
)
87-
raise

tests/observability/storage/__init__.py

Whitespace-only changes.

tests/observability/storage/conftest.py

Lines changed: 0 additions & 96 deletions
This file was deleted.

tests/observability/storage/constants.py

Lines changed: 0 additions & 1 deletion
This file was deleted.

tests/observability/storage/test_hpp_observability.py

Lines changed: 0 additions & 54 deletions
This file was deleted.

tests/observability/utils.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import datetime
22
import logging
33

4-
from kubernetes.dynamic.exceptions import ResourceNotFoundError
5-
from ocp_resources.namespace import Namespace
64
from ocp_utilities.monitoring import Prometheus
75
from timeout_sampler import TimeoutExpiredError, TimeoutSampler
86

@@ -55,10 +53,3 @@ def verify_no_listed_alerts_on_cluster(prometheus: Prometheus, alerts_list: list
5553
continue
5654
fired_alerts[alert] = alerts_by_name
5755
assert not fired_alerts, f"Alerts should not be fired on healthy cluster.\n {fired_alerts}"
58-
59-
60-
def get_olm_namespace() -> Namespace:
61-
olm_ns = Namespace(name="openshift-operator-lifecycle-manager")
62-
if olm_ns.exists:
63-
return olm_ns
64-
raise ResourceNotFoundError(f"Namespace: {olm_ns.name} not found.")

utilities/virt.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2280,21 +2280,6 @@ def wait_for_kubevirt_conditions(
22802280
)
22812281

22822282

2283-
def get_all_virt_pods_with_running_status(dyn_client, hco_namespace):
2284-
virt_pods_with_status = {
2285-
pod.name: pod.status
2286-
for pod in Pod.get(
2287-
dyn_client=dyn_client,
2288-
namespace=hco_namespace.name,
2289-
)
2290-
if pod.name.startswith("virt")
2291-
}
2292-
assert all(pod_status == Pod.Status.RUNNING for pod_status in virt_pods_with_status.values()), (
2293-
f"All virt pods were expected to be in running state.Here are all virt pods:{virt_pods_with_status}"
2294-
)
2295-
return virt_pods_with_status
2296-
2297-
22982283
def wait_for_kv_stabilize(admin_client, hco_namespace):
22992284
wait_for_kubevirt_conditions(admin_client=admin_client, hco_namespace=hco_namespace)
23002285
wait_for_hco_conditions(admin_client=admin_client, hco_namespace=hco_namespace)

0 commit comments

Comments
 (0)