Remove unnecessary observer fixture from k8s events tests
@@ -20,7 +20,7 @@ def has_event(fake_services, event_dict):
@pytest.mark.k8s
@pytest.mark.kubernetes
-def test_k8s_events_with_whitelist(agent_image, minikube, k8s_observer, k8s_test_timeout, k8s_namespace):
+def test_k8s_events_with_whitelist(agent_image, minikube, k8s_test_timeout, k8s_namespace):
expected_events = [
{"reason": "Pulled", "involvedObjectKind": "Pod"},
{"reason": "Created", "involvedObjectKind": "Pod"},
@@ -33,10 +33,7 @@ def test_k8s_events_with_whitelist(agent_image, minikube, k8s_observer, k8s_test
"whitelistedEvents": expected_events,
}
]
- with minikube.run_agent(agent_image, monitors=monitors, observer=k8s_observer, namespace=k8s_namespace) as [
- _,
- backend,
- ]:
+ with minikube.run_agent(agent_image, monitors=monitors, namespace=k8s_namespace) as [_, backend]:
for expected_event in expected_events:
assert wait_for(p(has_event, backend, expected_event), k8s_test_timeout), (
"timed out waiting for event '%s'!" % expected_event
@@ -45,10 +42,7 @@ def test_k8s_events_with_whitelist(agent_image, minikube, k8s_observer, k8s_test
@pytest.mark.k8s
@pytest.mark.kubernetes
-def test_k8s_events_without_whitelist(agent_image, minikube, k8s_observer, k8s_namespace):
+def test_k8s_events_without_whitelist(agent_image, minikube, k8s_namespace):
monitors = [{"type": "kubernetes-events", "kubernetesAPI": {"authType": "serviceAccount"}}]
- with minikube.run_agent(agent_image, monitors=monitors, observer=k8s_observer, namespace=k8s_namespace) as [
- _,
- backend,
- ]:
+ with minikube.run_agent(agent_image, monitors=monitors, namespace=k8s_namespace) as [_, backend]:
assert ensure_always(lambda: not backend.events, 30), "event received!"
