Skip to content

Commit 332a400

Browse files
mpk-droidclaude
andcommitted
fix: address CodeRabbit review feedback
- Use module import for shared fixtures to avoid F811 lint collision with fixture argument names - Move yield outside exception handlers so test assertion failures aren't masked as "deployment errors" Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent b485260 commit 332a400

1 file changed

Lines changed: 13 additions & 14 deletions

File tree

  • agents/langgraph/agentic_rag/tests/integration

agents/langgraph/agentic_rag/tests/integration/conftest.py

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import os
55

66
import pytest
7-
from integration.conftest import cluster_auth, repo_root # noqa: F401
7+
import integration.conftest # noqa: F401 — re-exports cluster_auth, repo_root
88
from integration.utils import (
99
MakeTargetError,
1010
RouteNotFoundError,
@@ -68,24 +68,23 @@ def deployed_agent(cluster_auth, agent_dir, agent_name):
6868

6969
deployed = False
7070
try:
71-
logger.info("Building image on cluster via build-openshift...")
72-
run_make("build-openshift", cwd=agent_dir, timeout=600)
71+
try:
72+
logger.info("Building image on cluster via build-openshift...")
73+
run_make("build-openshift", cwd=agent_dir, timeout=600)
7374

74-
logger.info("Deploying to cluster...")
75-
run_make("deploy", cwd=agent_dir, timeout=300)
76-
deployed = True
75+
logger.info("Deploying to cluster...")
76+
run_make("deploy", cwd=agent_dir, timeout=300)
77+
deployed = True
7778

78-
route_url = get_route(agent_name, namespace=namespace)
79-
logger.info("Agent deployed at %s", route_url)
79+
route_url = get_route(agent_name, namespace=namespace)
80+
logger.info("Agent deployed at %s", route_url)
81+
except (MakeTargetError, RouteNotFoundError) as exc:
82+
pytest.fail(f"Deployment failed: {exc}")
83+
except Exception as exc:
84+
pytest.fail(f"Unexpected error during deployment setup: {exc}")
8085

8186
yield route_url
8287

83-
except (MakeTargetError, RouteNotFoundError) as exc:
84-
pytest.fail(f"Deployment failed: {exc}")
85-
86-
except Exception as exc:
87-
pytest.fail(f"Unexpected error during deployment: {exc}")
88-
8988
finally:
9089
if deployed:
9190
logger.info("Tearing down deployment...")

0 commit comments

Comments
 (0)