summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYongqin Liu <yongqin.liu@linaro.org>2018-03-14 16:03:44 +0800
committerYongqin Liu <yongqin.liu@linaro.org>2018-03-14 16:03:44 +0800
commit81e775c859cc557a777b295ba13eed21980a6469 (patch)
tree9de692a2578d04fc9613866c83c3a0101e2c59df
parent7da7fc07f200ecfb8964a1d816cfaa688b9059d2 (diff)
fix bugs and comments display logic
Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
-rw-r--r--report/templates/test_report.html85
-rw-r--r--report/views.py2
2 files changed, 62 insertions, 25 deletions
diff --git a/report/templates/test_report.html b/report/templates/test_report.html
index 28f3e06..e3f16cd 100644
--- a/report/templates/test_report.html
+++ b/report/templates/test_report.html
@@ -188,13 +188,21 @@
<td align='left'>
{% with test_info.bugs as bugs %}
{% for bug in bugs %}
- {% if not bug.build_no %}
- <a target='_blank' href="{{ bug.link }}">{{ bug.bug_id }} </a><br/>
- {% elif build_info.build_no > bug.build_no %}
- {% if not bug.build_no_fixed or build_info.build_no < bug.build_no_fixed %}
+ {% if bug.build_no_fixed and bug.build_no %}
+ {% if build_info.build_no >= bug.build_no and build_info.build_no < bug.build_no_fixed %}
<a target='_blank' href="{{ bug.link }}">{{ bug.bug_id }} </a><br/>
{% endif %}
- {% endif %}
+ {% elif bug.build_no_fixed and not bug.build_no %}
+ {% if build_info.build_no < bug.build_no_fixed %}
+ <a target='_blank' href="{{ bug.link }}">{{ bug.bug_id }} </a><br/>
+ {% endif %}
+ {% elif not bug.build_no_fixed and not bug.build_no %}
+ <a target='_blank' href="{{ bug.link }}">{{ bug.bug_id }} </a><br/>
+ {% elif not bug.build_no_fixed and bug.build_no %}
+ {% if build_info.build_no >= bug.build_no %}
+ <a target='_blank' href="{{ bug.link }}">{{ bug.bug_id }} </a><br/>
+ {% endif %}
+ {% endif %}
{% endfor%}
{% endwith%}
</td>
@@ -260,10 +268,18 @@ No result for basic test, or optee test, or weekly test jobs
<td align='left'>
{% with test_info.bugs as bugs %}
{% for bug in bugs %}
- {% if not bug.build_no %}
- <a target='_blank' href="{{ bug.link }}">{{ bug.bug_id }} </a><br/>
- {% elif build_info.build_no > bug.build_no %}
- {% if not bug.build_no_fixed or build_info.build_no < bug.build_no_fixed %}
+ {% if bug.build_no_fixed and bug.build_no %}
+ {% if build_info.build_no >= bug.build_no and build_info.build_no < bug.build_no_fixed %}
+ <a target='_blank' href="{{ bug.link }}">{{ bug.bug_id }} </a><br/>
+ {% endif %}
+ {% elif bug.build_no_fixed and not bug.build_no %}
+ {% if build_info.build_no < bug.build_no_fixed %}
+ <a target='_blank' href="{{ bug.link }}">{{ bug.bug_id }} </a><br/>
+ {% endif %}
+ {% elif not bug.build_no_fixed and not bug.build_no %}
+ <a target='_blank' href="{{ bug.link }}">{{ bug.bug_id }} </a><br/>
+ {% elif not bug.build_no_fixed and bug.build_no %}
+ {% if build_info.build_no >= bug.build_no %}
<a target='_blank' href="{{ bug.link }}">{{ bug.bug_id }} </a><br/>
{% endif %}
{% endif %}
@@ -368,12 +384,19 @@ Only failures in the focused1 and focused2 test plans, and zero pass rate module
<td align='left'>
{% with test_info.bugs as bugs %}
{% for bug in bugs %}
- {% if not bug.build_no or bug.build_no == build_info.build_no %}
- <!-- for backword compability -->
- <a target='_blank' href="{{ bug.link }}">{{ bug.bug_id }} </a><br/>
- {% elif build_info.build_no > bug.build_no %}
- {% if not bug.build_no_fixed or build_info.build_no < bug.build_no_fixed %}
- <a target='_blank' href="{{ bug.link }}">{{ bug.bug_id }} </a><br/>
+ {% if bug.build_no_fixed and bug.build_no %}
+ {% if build_info.build_no >= bug.build_no and build_info.build_no < bug.build_no_fixed %}
+ <a target='_blank' href="{{ bug.link }}">{{ bug.bug_id }}</a><br/>
+ {% endif %}
+ {% elif bug.build_no_fixed and not bug.build_no %}
+ {% if build_info.build_no < bug.build_no_fixed %}
+ <a target='_blank' href="{{ bug.link }}">{{ bug.bug_id }}</a><br/>
+ {% endif %}
+ {% elif not bug.build_no_fixed and not bug.build_no %}
+ <a target='_blank' href="{{ bug.link }}">{{ bug.bug_id }}</a><br/>
+ {% elif not bug.build_no_fixed and bug.build_no %}
+ {% if build_info.build_no >= bug.build_no %}
+ <a target='_blank' href="{{ bug.link }}">{{ bug.bug_id }}</a><br/>
{% endif %}
{% endif %}
{% endfor%}
@@ -383,11 +406,18 @@ Only failures in the focused1 and focused2 test plans, and zero pass rate module
<ul>
{% with test_info.comments as comments %}
{% for comment in comments %}
- {% if not comment.build_no %}
- <!-- for backword compability -->
- <li>{{ comment.comment }}</li>
- {% elif comment.build_no <= build_info.build_no %}
- {% if not comment.build_no_fixed or comment.build_no_fixed > build_info.build_no %}
+ {% if comment.build_no_fixed and comment.build_no %}
+ {% if build_info.build_no >= comment.build_no and build_info.build_no < comment.build_no_fixed %}
+ <li>{{ comment.comment }}</li>
+ {% endif %}
+ {% elif comment.build_no_fixed and not comment.build_no %}
+ {% if build_info.build_no < comment.build_no_fixed %}
+ <li>{{ comment.comment }}</li>
+ {% endif %}
+ {% elif not comment.build_no_fixed and not comment.build_no %}
+ <li>{{ comment.comment }}</li>
+ {% elif not comment.build_no_fixed and comment.build_no %}
+ {% if build_info.build_no >= comment.build_no %}
<li>{{ comment.comment }}</li>
{% endif %}
{% endif %}
@@ -485,11 +515,18 @@ No result for cts test jobs.
<td align='left'>
{% with test_info.bugs as bugs %}
{% for bug in bugs %}
- {% if not bug.build_no %}
+ {% if bug.build_no_fixed and bug.build_no %}
+ {% if build_info.build_no >= bug.build_no and build_info.build_no < bug.build_no_fixed %}
+ <a target='_blank' href="{{ bug.link }}">{{ bug.bug_id }} </a><br/>
+ {% endif %}
+ {% elif bug.build_no_fixed and not bug.build_no %}
+ {% if build_info.build_no < bug.build_no_fixed %}
+ <a target='_blank' href="{{ bug.link }}">{{ bug.bug_id }} </a><br/>
+ {% endif %}
+ {% elif not bug.build_no_fixed and not bug.build_no %}
<a target='_blank' href="{{ bug.link }}">{{ bug.bug_id }} </a><br/>
- {% elif build_info.build_no > bug.build_no %}
- {% if not bug.build_no_fixed or build_info.build_no < bug.build_no_fixed %}
- <!-- bug not fixed or this build is before the fixed build no -->
+ {% elif not bug.build_no_fixed and bug.build_no %}
+ {% if build_info.build_no >= bug.build_no %}
<a target='_blank' href="{{ bug.link }}">{{ bug.bug_id }} </a><br/>
{% endif %}
{% endif %}
diff --git a/report/views.py b/report/views.py
index c78d4e5..2e1aae1 100644
--- a/report/views.py
+++ b/report/views.py
@@ -264,8 +264,8 @@ def get_jobs(build_name, build_no, lava, job_name_list=[]):
jobs = { }
for job in jobs_raw:
- logger.debug("%s %s", job.get("id"), job.get("description"))
if not cached_in_base:
+ logger.debug("%s %s", job.get("id"), job.get("description"))
job_id = job.get("id")
job_status = job.get("status")
if job_status is None: