diff --git a/app/routes/jobs.py b/app/routes/jobs.py index e1c6237..921ec6a 100644 --- a/app/routes/jobs.py +++ b/app/routes/jobs.py @@ -517,12 +517,13 @@ 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/') + # Construct standardized execution report link + report_link = f"http://asf-server.duckdns.org:8080/results/{job.remote_queue_id}/{task_id}/execution_report.html" - results[scenario] = val - if val[0] == 'FAIL': + # val[0] is status (PASS/FAIL/ERROR), val[1] was the old link + results[scenario] = [val[0], report_link] + + if val[0] in ['FAIL', 'ERROR']: any_failed = True break else: @@ -543,13 +544,8 @@ def update_job_status_internal(job): any_failed = True if all_finished and task_ids: - # 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' + # If any task has FAIL or ERROR, the job status is 'failed' + job.status = 'failed' if any_failed else 'passed' from app import db job.completed_at = db.session.query(db.func.now()).scalar() diff --git a/app/templates/base.html b/app/templates/base.html index 5aab40e..1ea0606 100644 --- a/app/templates/base.html +++ b/app/templates/base.html @@ -1,11 +1,14 @@ + {% block title %}ASF TestArena{% endblock %} + + {% if current_user.is_authenticated %} {% endif %} - +
{% with messages = get_flashed_messages(with_categories=true) %} - {% if messages %} - {% for category, message in messages %} -
{{ message }}
- {% endfor %} - {% endif %} + {% if messages %} + {% for category, message in messages %} +
{{ message }}
+ {% endfor %} + {% endif %} {% endwith %} - + {% block content %}{% endblock %}
- + {% block scripts %}{% endblock %} - + + \ No newline at end of file