fix loading issue

This commit is contained in:
2026-01-04 18:01:23 +01:00
parent e33ce220e9
commit f254e04fc5
3 changed files with 23 additions and 8 deletions

View File

@@ -517,6 +517,10 @@ def update_job_status_internal(job):
r_data = r_resp.json()
for key, val in r_data.items():
if key.upper() == scenario.upper():
# Transform file:/// link to web link
if isinstance(val, list) and len(val) > 1 and val[1].startswith('file:///'):
val[1] = val[1].replace('file:///home/asf/testarena/', 'http://asf-server.duckdns.org:8080/results/')
results[scenario] = val
if val[0] == 'FAIL':
any_failed = True
@@ -525,17 +529,27 @@ def update_job_status_internal(job):
all_finished = False
elif t_data.get('status') == 'Aborted':
results[scenario] = ['ABORTED', '#']
all_finished = True # Or handle as aborted
all_finished = True
elif t_data.get('status') == 'Error':
results[scenario] = ['ERROR', '#']
any_failed = True
all_finished = True
else:
all_finished = False
else:
all_finished = False
else:
if results[scenario][0] == 'FAIL':
if results[scenario][0] in ['FAIL', 'ERROR']:
any_failed = True
if all_finished and task_ids:
job.status = 'failed' if any_failed else 'passed'
# If any task has ERROR, the job status could be 'error' or 'failed'
# User said "mark it in the dash board as error"
has_error = any(r[0] == 'ERROR' for r in results.values())
if has_error:
job.status = 'error'
else:
job.status = 'failed' if any_failed else 'passed'
from app import db
job.completed_at = db.session.query(db.func.now()).scalar()