@@ -135,17 +135,15 @@ def generate_source_code_links(test_name: str, commit_hash: Optional[str] = None
135135
136136 return links
137137
138- async def get_e2e_test_logs_async (job_name : str , build_id : str ) -> str :
138+ async def get_e2e_test_logs_async (job_name : str , build_id : str , test_name : str ) -> str :
139139 """Get e2e test logs from Prow."""
140- # Extract job short name from full job name
141- job_parts = job_name .split ('-' )
142- if len (job_parts ) >= 8 :
143- job_short_name = '-' .join (job_parts [7 :]) # Everything after the 7th part
144- else :
145- job_short_name = job_name .split ('-' )[- 1 ] # Fallback to last part
140+
146141
147142 # E2E test logs are typically in openshift-e2e-test directory
148- e2e_test_path = f"artifacts/{ job_short_name } /openshift-e2e-test/build-log.txt"
143+ if "sno" in test_name :
144+ e2e_test_path = f"artifacts/{ test_name } /single-node-e2e-test/build-log.txt"
145+ else :
146+ e2e_test_path = f"artifacts/{ test_name } /openshift-e2e-test/build-log.txt"
149147
150148 base_url = f"{ GCS_URL } /{ job_name } /{ build_id } "
151149 e2e_test_url = f"{ base_url } /{ e2e_test_path } "
@@ -165,7 +163,7 @@ async def get_e2e_test_logs_async(job_name: str, build_id: str) -> str:
165163Build ID: { build_id }
166164
167165🔍 DEBUGGING INFO:
168- - Job short name extracted : { job_short_name }
166+ - test_name : { test_name }
169167- Base URL: { base_url }
170168- Tried path: { e2e_test_path }
171169
@@ -244,7 +242,7 @@ async def get_e2e_test_logs_async(job_name: str, build_id: str) -> str:
244242Build ID: { build_id }
245243
246244🔍 DEBUGGING INFO:
247- - Job short name extracted : { job_short_name }
245+ - test_name : { test_name }
248246- Base URL: { base_url }
249247- Tried path: { e2e_test_path }
250248- HTTP Error: { str (e )}
@@ -265,27 +263,26 @@ async def get_e2e_test_logs_async(job_name: str, build_id: str) -> str:
265263 except Exception as e :
266264 return f"❌ E2E TEST ANALYSIS ERROR: { str (e )} "
267265
268- async def get_junit_results_async (job_name : str , build_id : str ) -> str :
266+ async def get_junit_results_async (job_name : str , build_id : str , test_name : str ) -> str :
269267 """Get JUnit test results from Prow."""
270- # Extract job short name from full job name
271- job_parts = job_name .split ('-' )
272- if len (job_parts ) >= 8 :
273- job_short_name = '-' .join (job_parts [7 :]) # Everything after the 7th part
268+ # E2E test logs are typically in openshift-e2e-test directory
269+ if "sno" in test_name :
270+ e2e_test_path = f"artifacts/{ test_name } /single-node-e2e-test"
274271 else :
275- job_short_name = job_name .split ('-' )[- 1 ] # Fallback to last part
276-
277- # JUnit results are typically in junit directory
278- junit_path = f"artifacts/{ job_short_name } /openshift-e2e-test/junit_e2e_*.xml"
272+ e2e_test_path = f"artifacts/{ test_name } /openshift-e2e-test"
273+
279274
280275 base_url = f"{ GCS_URL } /{ job_name } /{ build_id } "
281276
282277 async with httpx .AsyncClient () as client :
283278 try :
284279 # Try common JUnit file patterns
285280 junit_patterns = [
286- f"artifacts/{ job_short_name } /openshift-e2e-test/junit_e2e.xml" ,
287- f"artifacts/{ job_short_name } /openshift-e2e-test/junit_e2e_20*.xml" ,
288- f"artifacts/{ job_short_name } /openshift-e2e-test/artifacts/junit_e2e.xml"
281+ f"{ e2e_test_path } /junit_e2e.xml" ,
282+ f"{ e2e_test_path } /junit_e2e_20*.xml" ,
283+ f"{ e2e_test_path } /artifacts/junit_e2e.xml" ,
284+ f"{ e2e_test_path } /artifacts/junit/junit_e2e.xml" ,
285+ f"{ e2e_test_path } /artifacts/junit/junit_e2e_20*.xml"
289286 ]
290287
291288 for pattern in junit_patterns :
@@ -321,13 +318,13 @@ def get_job_metadata_tool(job_name: str, build_id: str):
321318 """Get metadata and status for a specific Prow job name and build ID."""
322319 return run_async_in_thread (get_job_metadata_async (job_name , build_id ))
323320
324- def get_e2e_test_logs_tool (job_name : str , build_id : str ):
321+ def get_e2e_test_logs_tool (job_name : str , build_id : str , test_name : str ):
325322 """Get e2e test logs from the openshift-e2e-test directory with commit info and source code links."""
326- return run_async_in_thread (get_e2e_test_logs_async (job_name , build_id ))
323+ return run_async_in_thread (get_e2e_test_logs_async (job_name , build_id , test_name ))
327324
328- def get_junit_results_tool (job_name : str , build_id : str ):
325+ def get_junit_results_tool (job_name : str , build_id : str , test_name : str ):
329326 """Get JUnit test results from the e2e test artifacts."""
330- return run_async_in_thread (get_junit_results_async (job_name , build_id ))
327+ return run_async_in_thread (get_junit_results_async (job_name , build_id , test_name ))
331328
332329e2e_test_analyst_agent = Agent (
333330 model = MODEL ,
0 commit comments