diff options
author | Yongqin Liu <yongqin.liu@linaro.org> | 2018-01-08 16:41:25 +0800 |
---|---|---|
committer | Yongqin Liu <yongqin.liu@linaro.org> | 2018-01-08 16:41:25 +0800 |
commit | 61415012416f1dd5dfafbff62f96dd81f5145988 (patch) | |
tree | 032887a79ca1c3559fec6dcf3744a8990b8945ed | |
parent | 2ba1a303f682cd176d4ba2b3c0873f1603b28074 (diff) |
changes to display successfully with new cts test result
Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
-rw-r--r-- | report/migrations/0015_bug_build_no_fixed.py | 20 | ||||
-rw-r--r-- | report/models.py | 6 | ||||
-rw-r--r-- | report/templates/test_report.html | 4 | ||||
-rw-r--r-- | report/views.py | 30 |
4 files changed, 48 insertions, 12 deletions
diff --git a/report/migrations/0015_bug_build_no_fixed.py b/report/migrations/0015_bug_build_no_fixed.py new file mode 100644 index 0000000..dc4f445 --- /dev/null +++ b/report/migrations/0015_bug_build_no_fixed.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.5 on 2018-01-07 13:57 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('report', '0014_auto_20171130_1628'), + ] + + operations = [ + migrations.AddField( + model_name='bug', + name='build_no_fixed', + field=models.CharField(blank=True, default='', max_length=8), + ), + ] diff --git a/report/models.py b/report/models.py index 87491ce..e1164bc 100644 --- a/report/models.py +++ b/report/models.py @@ -44,6 +44,9 @@ class JobCache(models.Model): class Comment(models.Model): build_name = models.CharField(max_length=64) + # The build that this comment is started + build_no = models.CharField(max_length=8, default='', blank=True) + # The build that this comment is not work any more build_no = models.CharField(max_length=8, default='', blank=True) # for cts, test plan # for vts, test plan, job_name @@ -70,7 +73,10 @@ BUG_STATUS_CHOICES = ( class Bug(models.Model): build_name = models.CharField(max_length=64) + # the build no that this bug is report build_no = models.CharField(max_length=8, default='', blank=True) + # the build no that this bug is fixed + build_no_fixed = models.CharField(max_length=8, default='', blank=True) bug_id = models.CharField(max_length=16) link = models.CharField(max_length=128) subject = models.CharField(max_length=256) diff --git a/report/templates/test_report.html b/report/templates/test_report.html index 212614e..6e3eee3 100644 --- a/report/templates/test_report.html +++ b/report/templates/test_report.html @@ -288,7 +288,7 @@ Only failures in the focused1 and focused2 test plans, and zero pass rate module <th rowspan=2>Plan</th> <th rowspan=2>Module</th> <th colspan=4>Base({{ build_info.base_build_no }})</th> - <th colspan=4>Current</th> + <th colspan=5>Current</th> <th rowspan=2>Bugs</th> <th rowspan=2>Comments</th> <th rowspan=2>Operations</th> @@ -302,6 +302,7 @@ Only failures in the focused1 and focused2 test plans, and zero pass rate module <th>Pass</th> <th>Fail</th> <th>Total</th> + <th>Done</th> <th>Pass Rate</th> </tr> {% for test_info in cts_res %} @@ -341,6 +342,7 @@ Only failures in the focused1 and focused2 test plans, and zero pass rate module {% endwith %} <td align='right'> {{ test_info.number_fail }}</td> <td align='right'> {{ test_info.number_total }}</td> + <td align='right'> {{ test_info.module_done }}</td> {% if test_info.number_passrate == 0 %} <td align='right' style="background-color:red" > {{ test_info.number_passrate|floatformat:2 }}</td> {% elif test_info.number_passrate == 100 %} diff --git a/report/views.py b/report/views.py index cb14a0e..3262c3e 100644 --- a/report/views.py +++ b/report/views.py @@ -1098,19 +1098,25 @@ def test_report(request): cts_one_job_hash = {} for module in modules_res: temp_hash = {} - number = int(module.measurement) module_name = None - if module.name.endswith('_executed'): - module_name = module.name.replace('_executed', '') - temp_hash['total'] = number - elif module.name.endswith('_passed'): - module_name = module.name.replace('_passed', '') - temp_hash['pass'] = number - elif module.name.endswith('_failed'): - module_name = module.name.replace('_failed', '') - temp_hash['fail'] = number + if not module.name.endswith('_done'): + number = int(module.measurement) + if module.name.endswith('_executed'): + module_name = module.name.replace('_executed', '') + temp_hash['total'] = number + elif module.name.endswith('_passed'): + module_name = module.name.replace('_passed', '') + temp_hash['pass'] = number + elif module.name.endswith('_failed'): + module_name = module.name.replace('_failed', '') + temp_hash['fail'] = number + else: + # there should be no such case + pass else: - # there should be no such case + # No need to deal with _done result here + module_name = module.name.replace('_done', '') + temp_hash['done'] = module.result pass # modules should not be None here @@ -1124,6 +1130,7 @@ def test_report(request): number_pass = module_res.get('pass') number_fail = module_res.get('fail') number_total = module_res.get('total') + module_done = module_res.get('done', 'pass') if number_total == 0: number_passrate = 0 else: @@ -1143,6 +1150,7 @@ def test_report(request): 'number_fail': number_fail, 'number_total': number_total, 'number_passrate': number_passrate, + 'module_done': module_done, 'base': base, 'bugs': bugs, 'comments': comments, |