|
4 | 4 | import os |
5 | 5 |
|
6 | 6 | 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 |
8 | 8 | from integration.utils import ( |
9 | 9 | MakeTargetError, |
10 | 10 | RouteNotFoundError, |
@@ -68,24 +68,23 @@ def deployed_agent(cluster_auth, agent_dir, agent_name): |
68 | 68 |
|
69 | 69 | deployed = False |
70 | 70 | 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) |
73 | 74 |
|
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 |
77 | 78 |
|
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}") |
80 | 85 |
|
81 | 86 | yield route_url |
82 | 87 |
|
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 | | - |
89 | 88 | finally: |
90 | 89 | if deployed: |
91 | 90 | logger.info("Tearing down deployment...") |
|
0 commit comments