@@ -135,17 +135,15 @@ def generate_source_code_links(test_name: str, commit_hash: Optional[str] = None
135
135
136
136
return links
137
137
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 :
139
139
"""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
+
146
141
147
142
# 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"
149
147
150
148
base_url = f"{ GCS_URL } /{ job_name } /{ build_id } "
151
149
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:
165
163
Build ID: { build_id }
166
164
167
165
🔍 DEBUGGING INFO:
168
- - Job short name extracted : { job_short_name }
166
+ - test_name : { test_name }
169
167
- Base URL: { base_url }
170
168
- Tried path: { e2e_test_path }
171
169
@@ -244,7 +242,7 @@ async def get_e2e_test_logs_async(job_name: str, build_id: str) -> str:
244
242
Build ID: { build_id }
245
243
246
244
🔍 DEBUGGING INFO:
247
- - Job short name extracted : { job_short_name }
245
+ - test_name : { test_name }
248
246
- Base URL: { base_url }
249
247
- Tried path: { e2e_test_path }
250
248
- HTTP Error: { str (e )}
@@ -265,27 +263,26 @@ async def get_e2e_test_logs_async(job_name: str, build_id: str) -> str:
265
263
except Exception as e :
266
264
return f"❌ E2E TEST ANALYSIS ERROR: { str (e )} "
267
265
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 :
269
267
"""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"
274
271
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
+
279
274
280
275
base_url = f"{ GCS_URL } /{ job_name } /{ build_id } "
281
276
282
277
async with httpx .AsyncClient () as client :
283
278
try :
284
279
# Try common JUnit file patterns
285
280
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"
289
286
]
290
287
291
288
for pattern in junit_patterns :
@@ -321,13 +318,13 @@ def get_job_metadata_tool(job_name: str, build_id: str):
321
318
"""Get metadata and status for a specific Prow job name and build ID."""
322
319
return run_async_in_thread (get_job_metadata_async (job_name , build_id ))
323
320
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 ):
325
322
"""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 ))
327
324
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 ):
329
326
"""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 ))
331
328
332
329
e2e_test_analyst_agent = Agent (
333
330
model = MODEL ,
0 commit comments