fix loading issue
This commit is contained in:
@@ -517,12 +517,13 @@ def update_job_status_internal(job):
|
|||||||
r_data = r_resp.json()
|
r_data = r_resp.json()
|
||||||
for key, val in r_data.items():
|
for key, val in r_data.items():
|
||||||
if key.upper() == scenario.upper():
|
if key.upper() == scenario.upper():
|
||||||
# Transform file:/// link to web link
|
# Construct standardized execution report link
|
||||||
if isinstance(val, list) and len(val) > 1 and val[1].startswith('file:///'):
|
report_link = f"http://asf-server.duckdns.org:8080/results/{job.remote_queue_id}/{task_id}/execution_report.html"
|
||||||
val[1] = val[1].replace('file:///home/asf/testarena/', 'http://asf-server.duckdns.org:8080/results/')
|
|
||||||
|
|
||||||
results[scenario] = val
|
# val[0] is status (PASS/FAIL/ERROR), val[1] was the old link
|
||||||
if val[0] == 'FAIL':
|
results[scenario] = [val[0], report_link]
|
||||||
|
|
||||||
|
if val[0] in ['FAIL', 'ERROR']:
|
||||||
any_failed = True
|
any_failed = True
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
@@ -543,13 +544,8 @@ def update_job_status_internal(job):
|
|||||||
any_failed = True
|
any_failed = True
|
||||||
|
|
||||||
if all_finished and task_ids:
|
if all_finished and task_ids:
|
||||||
# If any task has ERROR, the job status could be 'error' or 'failed'
|
# If any task has FAIL or ERROR, the job status is 'failed'
|
||||||
# User said "mark it in the dash board as error"
|
job.status = 'failed' if any_failed else 'passed'
|
||||||
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
|
from app import db
|
||||||
job.completed_at = db.session.query(db.func.now()).scalar()
|
job.completed_at = db.session.query(db.func.now()).scalar()
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,14 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>{% block title %}ASF TestArena{% endblock %}</title>
|
<title>{% block title %}ASF TestArena{% endblock %}</title>
|
||||||
|
<link rel="icon" type="image/png" href="{{ url_for('static', filename='uploads/icon.png') }}">
|
||||||
<link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
|
<link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
{% if current_user.is_authenticated %}
|
{% if current_user.is_authenticated %}
|
||||||
<nav class="navbar">
|
<nav class="navbar">
|
||||||
@@ -27,11 +30,11 @@
|
|||||||
|
|
||||||
<div class="container">
|
<div class="container">
|
||||||
{% with messages = get_flashed_messages(with_categories=true) %}
|
{% with messages = get_flashed_messages(with_categories=true) %}
|
||||||
{% if messages %}
|
{% if messages %}
|
||||||
{% for category, message in messages %}
|
{% for category, message in messages %}
|
||||||
<div class="alert alert-{{ category }}">{{ message }}</div>
|
<div class="alert alert-{{ category }}">{{ message }}</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
|
|
||||||
{% block content %}{% endblock %}
|
{% block content %}{% endblock %}
|
||||||
@@ -39,4 +42,5 @@
|
|||||||
|
|
||||||
{% block scripts %}{% endblock %}
|
{% block scripts %}{% endblock %}
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
Reference in New Issue
Block a user