diff options
author | Yongqin Liu <yongqin.liu@linaro.org> | 2017-12-04 09:01:50 +0800 |
---|---|---|
committer | Yongqin Liu <yongqin.liu@linaro.org> | 2017-12-04 09:01:50 +0800 |
commit | f47d3e0cd2e57abf558a49c3bb4e48b8aba5d21b (patch) | |
tree | 6971d853dfd9c73e2ea22a9325b0111c419c2558 | |
parent | f92edb1ea5e047340007492277fa3cb00b0e7f28 (diff) |
add support for comments
but it's better to move bug and comment as one Table
and set it as one ForeignKey for TestCase record
Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
-rw-r--r-- | db.sqlite3 | bin | 17565696 -> 19703808 bytes | |||
-rwxr-xr-x | deploy.sh | 1 | ||||
-rw-r--r-- | report/accountviews.py | 7 | ||||
-rw-r--r-- | report/admin.py | 10 | ||||
-rw-r--r-- | report/migrations/0014_auto_20171130_1628.py | 31 | ||||
-rw-r--r-- | report/models.py | 20 | ||||
-rw-r--r-- | report/templates/add_comment.html | 25 | ||||
-rw-r--r-- | report/templates/test_report.html | 101 | ||||
-rw-r--r-- | report/urls.py | 1 | ||||
-rw-r--r-- | report/views.py | 259 |
10 files changed, 342 insertions, 113 deletions
Binary files differ @@ -36,6 +36,7 @@ source ${virenv_dir}/bin/activate pip install Django pip install pyaml pip install lava-tool +pip install django-crispy-forms # https://docs.djangoproject.com/en/1.11/intro/tutorial01/ python -m django --version diff --git a/report/accountviews.py b/report/accountviews.py index a99e2bf..c44dddc 100644 --- a/report/accountviews.py +++ b/report/accountviews.py @@ -1,7 +1,14 @@ # -*- coding: utf-8 -*- +# Class Base Views +# https://docs.djangoproject.com/en/1.11/topics/class-based-views/ +# User authentication in Django +# https://docs.djangoproject.com/en/1.11/topics/auth/ +# Logging +# https://docs.djangoproject.com/en/1.11/topics/logging/ # http://gswd-a-crash-course-pycon-2014.readthedocs.io/en/latest/authviews.html # https://simpleisbetterthancomplex.com/tutorial/2017/02/18/how-to-create-user-sign-up-view.html # https://docs.djangoproject.com/en/1.11/topics/auth/default/ +# https://developer.mozilla.org/en-US/docs/Learn/Server-side/Django/Authentication from __future__ import unicode_literals from __future__ import absolute_import diff --git a/report/admin.py b/report/admin.py index 493a1ae..30df88e 100644 --- a/report/admin.py +++ b/report/admin.py @@ -8,7 +8,7 @@ from .models import TestCase from .models import JobCache from .models import BaseResults from .models import Bug -from .models import BuildSummary, LAVAUser, BuildBugzilla, BuildConfig, LAVA +from .models import BuildSummary, LAVAUser, BuildBugzilla, BuildConfig, LAVA, Comment from django.contrib.auth.models import Permission admin.site.register(Permission) @@ -25,10 +25,16 @@ class JobCacheAdmin(admin.ModelAdmin): search_fields = ('job_id', 'job_name', 'build_name', 'build_no') admin.site.register(JobCache, JobCacheAdmin) + +class BugAdmin(admin.ModelAdmin): + search_fields = ('bug_id', 'build_name', 'plan_suite', 'module_testcase') + +admin.site.register(Bug, BugAdmin) + admin.site.register(BaseResults) -admin.site.register(Bug) admin.site.register(BuildSummary) admin.site.register(LAVAUser) admin.site.register(BuildBugzilla) admin.site.register(BuildConfig) admin.site.register(LAVA) +admin.site.register(Comment) diff --git a/report/migrations/0014_auto_20171130_1628.py b/report/migrations/0014_auto_20171130_1628.py new file mode 100644 index 0000000..5190d99 --- /dev/null +++ b/report/migrations/0014_auto_20171130_1628.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.5 on 2017-11-30 16:28 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('report', '0013_auto_20171122_0415'), + ] + + operations = [ + migrations.CreateModel( + name='Comment', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('build_name', models.CharField(max_length=64)), + ('build_no', models.CharField(blank=True, default='', max_length=8)), + ('plan_suite', models.CharField(max_length=64)), + ('module_testcase', models.CharField(max_length=128)), + ('comment', models.TextField()), + ], + ), + migrations.AddField( + model_name='bug', + name='build_no', + field=models.CharField(blank=True, default='', max_length=8), + ), + ] diff --git a/report/models.py b/report/models.py index 1f74bb0..87491ce 100644 --- a/report/models.py +++ b/report/models.py @@ -42,6 +42,25 @@ class JobCache(models.Model): return "%s_%s %s %s#%s %s %.2f" % (self.lava_nick, self.job_id, self.job_name, self.build_name, self.build_no, self.status, self.duration/3600) +class Comment(models.Model): + build_name = models.CharField(max_length=64) + build_no = models.CharField(max_length=8, default='', blank=True) + # for cts, test plan + # for vts, test plan, job_name + # for basic, test suite + # for benchmarks, test suite + plan_suite = models.CharField(max_length=64) + # for cts, test module + # for vts, same as plan + # for basic test, same as test suite + # for benchmarks, test case + module_testcase = models.CharField(max_length=128) + comment = models.TextField() + + def __str__(self): + return "%s %s %s %s %s" % (self.build_name, self.build_no, self.plan_suite, self.module_testcase, self.comment) + + BUG_STATUS_CHOICES = ( ("unconfirmed", "Unconfirmed"), ("confirmed", "Confirmed"), @@ -51,6 +70,7 @@ BUG_STATUS_CHOICES = ( class Bug(models.Model): build_name = models.CharField(max_length=64) + build_no = 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/add_comment.html b/report/templates/add_comment.html new file mode 100644 index 0000000..9375a46 --- /dev/null +++ b/report/templates/add_comment.html @@ -0,0 +1,25 @@ +{% extends '_layouts/base.html' %} + +{% block title %} Add Comment for build {{ build_info.build_name }} {% endblock %} + +{% block headline %}<h1>Add Comment for build {{ build_info.build_name }}</h1>{% endblock %} + +{% block content %} +<div align="center"> +<div>{{ form.errors }}</div> +<div> +{% if build_info.message %} +<font color="green"> +{{ build_info.message }} +</font> +{% endif %} +</div> +<form action="/report/add-comment/" method="post"> + {% csrf_token %} + <table border="2" aligh='left'> + {{ form.as_table }} + </table> + <input type="submit" id="submit_btn" value="submit" /> +</form> +</div> +{% endblock %} diff --git a/report/templates/test_report.html b/report/templates/test_report.html index 0636260..212614e 100644 --- a/report/templates/test_report.html +++ b/report/templates/test_report.html @@ -15,6 +15,7 @@ {% else %} <td><a href="/report/test-report/?build_name={{ build_info.build_name}}&&build_no={{ build_no }}">{{ build_no}} </a></td> {% endifequal %} + {% endfor %} </tr> @@ -78,6 +79,54 @@ <tr/> </table> <hr/> +{% if jobs_failed %} +<form action="/report/resubmit-job/" method="post"> +<table border="2"> +<tr> + <th>Job Name</th> + <th>Job Ids</th> + <th>Resubmit latest</th> + <th>bug link</th> +</tr> +{% for job in jobs_failed %} +<tr> + <td>{{ job.name }}</td> + <td> + {% for id_status in job.id_status_list %} + <a href="{{ lava_server_job_prefix }}/{{ id_status.0 }}"> {{ id_status.0 }}</a>: {{ id_status.1 }} <br> + {% endfor %} + </td> + <td> + {% with job.id_status_list|first as first_id_status %} + {% if first_id_status.1 == 'Submitted' or first_id_status.1 == 'Running' %} + <button name="resubmit_latest" disabled="true" onclick="this.disabled=true; window.location='/report/resubmit-job/?build_name={{ build_info.build_name }}&&job_id={% with job.id_status_list|first as first_id_status %}{{ first_id_status.0 }}{% endwith %}'"> + Resubmit {% with job.id_status_list|first as first_id_status %}{{ first_id_status.0 }}{% endwith %} + </button> + <input type="checkbox" name="job_ids" value="{% with job.id_status_list|first as first_id_status %}{{ first_id_status.0 }}{% endwith %}" selected="false" disabled="false"/> + {% else %} + <button name="resubmit_latest" onclick="this.disabled=true; window.location='/report/resubmit-job/?build_name={{ build_info.build_name }}&&job_id={% with job.id_status_list|first as first_id_status %}{{ first_id_status.0 }}{% endwith %}'"> + Resubmit {% with job.id_status_list|first as first_id_status %}{{ first_id_status.0 }}{% endwith %} + </button> + <input type="checkbox" name="job_ids" value="{% with job.id_status_list|first as first_id_status %}{{ first_id_status.0 }}{% endwith %}" checked="true"/> + + {% endif %} + {% endwith %} + </td> + <td> + <a href="https://bugs.linaro.org/enter_bug.cgi?product=Linaro%20Android">Report Android Bug</a><br/> + <a href="https://bugs.linaro.org/enter_bug.cgi?product=LAVA%20Framework">Report LAVA Bug</a><br/> + </td> +</tr> +{% endfor %} +</table> +{% csrf_token %} +<input type="hidden" name="build_name" value="{{ build_info.build_name }}"/> +<input type="submit" value="Resubmit All Possible Failed Jobs"/> + <a href="/report/submit-jobs/?build_name={{ build_info.build_name }}"> Job Submission </a> +</form> +<hr/> +{% endif %} + <h2>Basic Weekly</h2> {% if basic_optee_weekly_res %} <table border="2"> @@ -138,7 +187,9 @@ <td align='left'> {% with test_info.bugs as bugs %} {% for bug in bugs %} - <a target='_blank' href="{{ bug.link }}">{{ bug.bug_id }} </a><br/> + {% if not bug.build_no or bug.build_no == build_info.build_no %} + <a target='_blank' href="{{ bug.link }}">{{ bug.bug_id }} </a><br/> + {% endif %} {% endfor%} {% endwith%} </td> @@ -204,7 +255,9 @@ 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 %} - <a target='_blank' href="{{ bug.link }}">{{ bug.bug_id }} </a><br/> + {% if not bug.build_no or bug.build_no == build_info.build_no %} + <a target='_blank' href="{{ bug.link }}">{{ bug.bug_id }} </a><br/> + {% endif %} {% endfor%} {% endwith%} </td> @@ -228,6 +281,7 @@ No result for benchmark test jobs. <h2>CTS</h2> {% if cts_res %} +Only failures in the focused1 and focused2 test plans, and zero pass rate modules will be focused. <table border="2"> <tr> <th rowspan=2>Index</th> @@ -236,6 +290,7 @@ No result for benchmark test jobs. <th colspan=4>Base({{ build_info.base_build_no }})</th> <th colspan=4>Current</th> <th rowspan=2>Bugs</th> + <th rowspan=2>Comments</th> <th rowspan=2>Operations</th> </tr> @@ -271,9 +326,15 @@ No result for benchmark test jobs. <td align='right'> -- </td> {% endif %} {% if test_info.number_pass|add:0 > base.number_pass|add:0 %} + <!-- <td align='right' style="background-color:green" > {{ test_info.number_pass }}</td> + --> + <td align='right'> {{ test_info.number_pass }}</td> {% elif test_info.number_pass|add:0 < base.number_pass|add:0 %} + <!-- <td align='right' style="background-color:yellow" > {{ test_info.number_pass }}</td> + --> + <td align='right'> {{ test_info.number_pass }}</td> {% else %} <td align='right'> {{ test_info.number_pass }}</td> {% endif %} @@ -290,24 +351,40 @@ No result for benchmark test jobs. <td align='left'> {% with test_info.bugs as bugs %} {% for bug in bugs %} - <a target='_blank' href="{{ bug.link }}">{{ bug.bug_id }} </a><br/> + {% if not bug.build_no or bug.build_no == build_info.build_no %} + <a target='_blank' href="{{ bug.link }}">{{ bug.bug_id }} </a><br/> + {% endif %} {% endfor%} {% endwith%} </td> + <td> + <ul> + {% with test_info.comments as comments %} + {% for comment in comments %} + {% if not comment.build_no or comment.build_no == build_info.build_no %} + <li>{{ comment.comment }}</li> + {% endif %} + {% endfor %} + {% endwith %} + </ul> + {% ifnotequal test_info.number_passrate 100 %} + <a target='_blank' href="/report/add-comment/?build_name={{ build_info.build_name }}&build_no={{ build_info.build_no }}&plan_suite={{ test_info.job_name }}&&module_testcase={{ test_info.module_name }}">Add Comment</a><br/> + {% endifnotequal %} + </td> <td align='left'> - {% ifequal test_info.number_passrate 0 %} - <a target='_blank' href="/report/add-bug/?build_name={{ build_info.build_name }}&plan_suite={{ test_info.job_name }}&&module_testcase={{ test_info.module_name }}">Add Bug</a><br/> + {% ifnotequal test_info.number_passrate 100 %} + <a target='_blank' href="/report/add-bug/?build_name={{ build_info.build_name }}&build_no={{ build_info.build_no }}&plan_suite={{ test_info.job_name }}&&module_testcase={{ test_info.module_name }}">Add Bug</a><br/> <a target='_blank' href="{{ build_info.new_bug_url_prefix }}{{ test_info.module_name }}">Report Android Bug</a> <!-- <a target='_blank' href="https://bugs.linaro.org/enter_bug.cgi?product=LAVA%20Framework">Report LAVA Bug</a> --> - {% endifequal %} + {% endifnotequal %} </td> </tr> {% endfor %} </table> {% else %} -No result for benchmark test jobs. +No result for cts test jobs. {% endif %} <hr/> <h2>VTS</h2> @@ -378,13 +455,15 @@ No result for benchmark test jobs. <td align='left'> {% with test_info.bugs as bugs %} {% for bug in bugs %} - <a target='_blank' href="{{ bug.link }}">{{ bug.bug_id }} </a><br/> + {% if not bug.build_no or bug.build_no == build_info.build_no %} + <a target='_blank' href="{{ bug.link }}">{{ bug.bug_id }} </a><br/> + {% endif %} {% endfor%} {% endwith%} </td> <td align='left'> - {% ifequal test_info.number_passrate 0 %} <a target='_blank' href="/report/add-bug/?build_name={{ build_info.build_name }}&plan_suite={{ test_info.job_name }}&&module_testcase={{ test_info.job_name }}">Add Bug</a><br/> + {% ifequal test_info.number_passrate 0 %} <a target='_blank' href="{{ build_info.new_bug_url_prefix }}{{ test_info.job_name }}">Report Android Bug</a> <!-- <a target='_blank' href="https://bugs.linaro.org/enter_bug.cgi?product=LAVA%20Framework">Report LAVA Bug</a> @@ -395,7 +474,7 @@ No result for benchmark test jobs. {% endfor %} </table> {% else %} -No result for benchmark test jobs. +No result for vts test jobs. {% endif %} <hr/> @@ -412,6 +491,7 @@ No result for benchmark test jobs. <th>Comments</th> </tr> {% for bug in build_bugs %} +{% if not bug.build_no or bug.build_no == build_info.build_no %} <tr> <td>{{ forloop.counter }}</a></td> <td><a href="{{ bug.link }}">{{ bug.bug_id }}</a></td> @@ -421,6 +501,7 @@ No result for benchmark test jobs. <td>{{ bug.status }}</a></td> <td> -- </a></td> </tr> +{% endif %} {% endfor %} </table> {% else %} diff --git a/report/urls.py b/report/urls.py index 4e290c4..c68bb4d 100644 --- a/report/urls.py +++ b/report/urls.py @@ -12,6 +12,7 @@ urlpatterns = [ url(r'^submit-jobs/.*$', views.submit_lava_jobs, name='submit_jobs'), url(r'^test-report/.*$', views.test_report, name='test_report'), url(r'^add-bug/.*$', views.add_bug, name='add_bug'), + url(r'^add-comment/.*$', views.add_comment, name='add_comment'), url(r'^accounts/register/$', accountviews.SignUpView.as_view(), name='signup'), url(r'^accounts/login/$', accountviews.LoginView.as_view(), name='login'), diff --git a/report/views.py b/report/views.py index 5487c68..83554d4 100644 --- a/report/views.py +++ b/report/views.py @@ -18,7 +18,101 @@ import logging from lava_tool.authtoken import AuthenticatingServerProxy, KeyringAuthBackend # Create your views here. -from models import TestCase, JobCache, BaseResults, Bug, BuildSummary, LAVA, LAVAUser, BuildBugzilla, BuildConfig +from models import TestCase, JobCache, BaseResults, Bug, BuildSummary, LAVA, LAVAUser, BuildBugzilla, BuildConfig, Comment + +basic_weekly = { # job_name: ['test_suite', ], + #"basic": [ "meminfo", 'meminfo-first', 'meminfo-second', "busybox", "ping", "linaro-android-kernel-tests", "tjbench"], + "basic": [ 'meminfo-first', 'meminfo-second', "busybox", "ping", "linaro-android-kernel-tests", "tjbench"], + "weekly": [ 'media-codecs', 'piglit-gles2', 'piglit-gles3', 'piglit-glslparser', 'piglit-shader-runner', 'stringbench', 'libc-bench'], + } + +optee = { # job_name: ['test_suite', ], + "optee": [ "optee-xtest"], + } + +benchmarks_common = { # job_name: {'test_suite':['test_case',]}, + "boottime": { + #'boottime-analyze': ['KERNEL_BOOT_TIME_avg', 'ANDROID_BOOT_TIME_avg', 'TOTAL_BOOT_TIME_avg' ], + 'boottime-first-analyze': ['KERNEL_BOOT_TIME_avg', 'ANDROID_BOOT_TIME_avg', 'TOTAL_BOOT_TIME_avg' ], + 'boottime-second-analyze': ['KERNEL_BOOT_TIME_avg', 'ANDROID_BOOT_TIME_avg', 'TOTAL_BOOT_TIME_avg' ], + }, + "basic": { + "meminfo-first": [ 'MemTotal', 'MemFree', 'MemAvailable'], + #"meminfo": [ 'MemTotal', 'MemFree', 'MemAvailable'], + "meminfo-second": [ 'MemTotal', 'MemFree', 'MemAvailable'], + }, + + #'andebenchpro2015': {'andebenchpro2015':[] }, + 'antutu6': { 'antutu6': ['antutu6-sum-mean'] }, + #'applications': {}, + 'benchmarkpi': {'benchmarkpi': ['benchmarkpi-mean',]}, + 'caffeinemark': {'caffeinemark': ['Caffeinemark-Collect-score-mean', 'Caffeinemark-Float-score-mean', 'Caffeinemark-Loop-score-mean', + 'Caffeinemark-Method-score-mean', 'Caffeinemark-score-mean', 'Caffeinemark-Sieve-score-mean', 'Caffeinemark-String-score-mean']}, + 'cf-bench': {'cf-bench': ['cfbench-Overall-Score-mean', 'cfbench-Java-Score-mean', 'cfbench-Native-Score-mean']}, + 'gearses2eclair': {'gearses2eclair': ['gearses2eclair',]}, + 'geekbench3': {'geekbench3': ['geekbench-multi-core-mean', 'geekbench-single-core-mean']}, + 'javawhetstone': {'javawhetstone': ['javawhetstone-MWIPS-mean', 'javawhetstone-N1-float-mean', 'javawhetstone-N2-float-mean', 'javawhetstone-N3-if-mean', 'javawhetstone-N4-fixpt-mean', + 'javawhetstone-N5-cos-mean', 'javawhetstone-N6-float-mean', 'javawhetstone-N7-equal-mean', 'javawhetstone-N8-exp-mean',]}, + 'jbench': {'jbench': ['jbench-mean',]}, + 'linpack': {'linpack': ['Linpack-MFLOPSSingleScore-mean', 'Linpack-MFLOPSMultiScore-mean', 'Linpack-TimeSingleScore-mean', 'Linpack-TimeMultiScore-mean']}, + 'quadrantpro': {'quadrantpro': ['quadrandpro-benchmark-memory-mean', 'quadrandpro-benchmark-mean', 'quadrandpro-benchmark-g2d-mean', 'quadrandpro-benchmark-io-mean', + 'quadrandpro-benchmark-cpu-mean', 'quadrandpro-benchmark-g3d-mean',]}, + 'rl-sqlite': {'rl-sqlite': ['RL-sqlite-Overall-mean',]}, + 'scimark': {'scimark': ['scimark-FFT-1024-mean', 'scimark-LU-100x100-mean', 'scimark-SOR-100x100-mean', 'scimark-Monte-Carlo-mean', 'scimark-Composite-Score-mean',]}, + 'vellamo3': {'vellamo3': ['vellamo3-Browser-total-mean', 'vellamo3-Metal-total-mean', 'vellamo3-Multi-total-mean', 'vellamo3-total-score-mean',]}, + } +less_is_better_measurement = [ + 'KERNEL_BOOT_TIME_avg', 'ANDROID_BOOT_TIME_avg', 'TOTAL_BOOT_TIME_avg', + 'benchmarkpi-mean', + 'Linpack-TimeSingleScore-mean', 'Linpack-TimeMultiScore-mean', 'RL-sqlite-Overall-mean' + ] + +glbenchmark25 = { + 'glbenchmark25': {'glbenchmark25': ['Fill-rate-C24Z16-mean', 'Fill-rate-C24Z16-Offscreen-mean', + 'GLBenchmark-2.1-Egypt-Classic-C16Z16-mean', 'GLBenchmark-2.1-Egypt-Classic-C16Z16-Offscreen-mean', + 'GLBenchmark-2.5-Egypt-HD-C24Z16-Fixed-timestep-mean', 'GLBenchmark-2.5-Egypt-HD-C24Z16-Fixed-timestep-Offscreen-mean', + 'GLBenchmark-2.5-Egypt-HD-C24Z16-mean', 'GLBenchmark-2.5-Egypt-HD-C24Z16-Offscreen-mean', + 'Triangle-throughput-Textured-C24Z16-Fragment-lit-mean', 'Triangle-throughput-Textured-C24Z16-Offscreen-Fragment-lit-mean', + 'Triangle-throughput-Textured-C24Z16-mean', 'Triangle-throughput-Textured-C24Z16-Offscreen-mean', + 'Triangle-throughput-Textured-C24Z16-Vertex-lit-mean', 'Triangle-throughput-Textured-C24Z16-Offscreen-Vertex-lit-mean', + ],}, + } + +# test_suite is "vts-test" +vts = [ + 'vts-hal', + 'vts-kernel-kselftest', + 'vts-kernel-ltp', + 'vts-kernel-part1', + 'vts-library', + 'vts-performance', + ] + +# test_suite is the same as job name +cts_v7a = [ 'cts-focused1-v7a', + 'cts-focused2-v7a', + 'cts-media-v7a', + 'cts-media2-v7a', + 'cts-opengl-v7a', + 'cts-part1-v7a', + 'cts-part2-v7a', + 'cts-part3-v7a', + 'cts-part4-v7a', + 'cts-part5-v7a', + ] + +# test_suite is the same as job name +cts_v8a = [ 'cts-focused1-v8a', + 'cts-focused2-v8a', + 'cts-media-v8a', + 'cts-media2-v8a', + 'cts-opengl-v8a', + 'cts-part1-v8a', + 'cts-part2-v8a', + 'cts-part3-v8a', + 'cts-part4-v8a', + 'cts-part5-v8a', + ] android_snapshot_url_base = "https://snapshots.linaro.org/android" ci_job_url_base = 'https://ci.linaro.org/job' @@ -377,7 +471,7 @@ def get_commit_from_pinned_manifest(snapshot_url, path): @login_required -@permission_required('report.can_testcase', login_url='/report/accounts/no_permission/') +@permission_required('report.add_testcase', login_url='/report/accounts/no_permission/') def jobs(request): build_name = request.GET.get("build_name", DEFAULT_BUILD_NAME) @@ -514,7 +608,7 @@ def compare_results_func(tests_result_1, tests_result_2): @login_required -@permission_required('report.can_testcase', login_url='/report/accounts/no_permission/') +@permission_required('report.add_testcase', login_url='/report/accounts/no_permission/') def compare(request): compare_results = {} if request.method == 'POST': @@ -581,7 +675,7 @@ def get_test_results_for_job(build_name, lava, jobs=[]): return (all_build_numbers, checklist_results) @login_required -@permission_required('report.can_testcase', login_url='/report/accounts/no_permission/') +@permission_required('report.add_testcase', login_url='/report/accounts/no_permission/') def checklist(request): checklist_results = {} all_build_numbers= [] @@ -751,103 +845,8 @@ def index(request): "builds": builds, }) - -basic_weekly = { # job_name: ['test_suite', ], - #"basic": [ "meminfo", 'meminfo-first', 'meminfo-second', "busybox", "ping", "linaro-android-kernel-tests", "tjbench"], - "basic": [ 'meminfo-first', 'meminfo-second', "busybox", "ping", "linaro-android-kernel-tests", "tjbench"], - "weekly": [ 'media-codecs', 'piglit-gles2', 'piglit-gles3', 'piglit-glslparser', 'piglit-shader-runner', 'stringbench', 'libc-bench'], - } - -optee = { # job_name: ['test_suite', ], - "optee": [ "optee-xtest"], - } - -benchmarks_common = { # job_name: {'test_suite':['test_case',]}, - "boottime": { - #'boottime-analyze': ['KERNEL_BOOT_TIME_avg', 'ANDROID_BOOT_TIME_avg', 'TOTAL_BOOT_TIME_avg' ], - 'boottime-first-analyze': ['KERNEL_BOOT_TIME_avg', 'ANDROID_BOOT_TIME_avg', 'TOTAL_BOOT_TIME_avg' ], - 'boottime-second-analyze': ['KERNEL_BOOT_TIME_avg', 'ANDROID_BOOT_TIME_avg', 'TOTAL_BOOT_TIME_avg' ], - }, - "basic": { - "meminfo-first": [ 'MemTotal', 'MemFree', 'MemAvailable'], - #"meminfo": [ 'MemTotal', 'MemFree', 'MemAvailable'], - "meminfo-second": [ 'MemTotal', 'MemFree', 'MemAvailable'], - }, - - #'andebenchpro2015': {'andebenchpro2015':[] }, - 'antutu6': { 'antutu6': ['antutu6-sum-mean'] }, - #'applications': {}, - 'benchmarkpi': {'benchmarkpi': ['benchmarkpi-mean',]}, - 'caffeinemark': {'caffeinemark': ['Caffeinemark-Collect-score-mean', 'Caffeinemark-Float-score-mean', 'Caffeinemark-Loop-score-mean', - 'Caffeinemark-Method-score-mean', 'Caffeinemark-score-mean', 'Caffeinemark-Sieve-score-mean', 'Caffeinemark-String-score-mean']}, - 'cf-bench': {'cf-bench': ['cfbench-Overall-Score-mean', 'cfbench-Java-Score-mean', 'cfbench-Native-Score-mean']}, - 'gearses2eclair': {'gearses2eclair': ['gearses2eclair',]}, - 'geekbench3': {'geekbench3': ['geekbench-multi-core-mean', 'geekbench-single-core-mean']}, - 'javawhetstone': {'javawhetstone': ['javawhetstone-MWIPS-mean', 'javawhetstone-N1-float-mean', 'javawhetstone-N2-float-mean', 'javawhetstone-N3-if-mean', 'javawhetstone-N4-fixpt-mean', - 'javawhetstone-N5-cos-mean', 'javawhetstone-N6-float-mean', 'javawhetstone-N7-equal-mean', 'javawhetstone-N8-exp-mean',]}, - 'jbench': {'jbench': ['jbench-mean',]}, - 'linpack': {'linpack': ['Linpack-MFLOPSSingleScore-mean', 'Linpack-MFLOPSMultiScore-mean', 'Linpack-TimeSingleScore-mean', 'Linpack-TimeMultiScore-mean']}, - 'quadrantpro': {'quadrantpro': ['quadrandpro-benchmark-memory-mean', 'quadrandpro-benchmark-mean', 'quadrandpro-benchmark-g2d-mean', 'quadrandpro-benchmark-io-mean', - 'quadrandpro-benchmark-cpu-mean', 'quadrandpro-benchmark-g3d-mean',]}, - 'rl-sqlite': {'rl-sqlite': ['RL-sqlite-Overall-mean',]}, - 'scimark': {'scimark': ['scimark-FFT-1024-mean', 'scimark-LU-100x100-mean', 'scimark-SOR-100x100-mean', 'scimark-Monte-Carlo-mean', 'scimark-Composite-Score-mean',]}, - 'vellamo3': {'vellamo3': ['vellamo3-Browser-total-mean', 'vellamo3-Metal-total-mean', 'vellamo3-Multi-total-mean', 'vellamo3-total-score-mean',]}, - } -less_is_better_measurement = [ - 'KERNEL_BOOT_TIME_avg', 'ANDROID_BOOT_TIME_avg', 'TOTAL_BOOT_TIME_avg', - 'benchmarkpi-mean', - 'Linpack-TimeSingleScore-mean', 'Linpack-TimeMultiScore-mean', 'RL-sqlite-Overall-mean' - ] - -glbenchmark25 = { - 'glbenchmark25': {'glbenchmark25': ['Fill-rate-C24Z16-mean', 'Fill-rate-C24Z16-Offscreen-mean', - 'GLBenchmark-2.1-Egypt-Classic-C16Z16-mean', 'GLBenchmark-2.1-Egypt-Classic-C16Z16-Offscreen-mean', - 'GLBenchmark-2.5-Egypt-HD-C24Z16-Fixed-timestep-mean', 'GLBenchmark-2.5-Egypt-HD-C24Z16-Fixed-timestep-Offscreen-mean', - 'GLBenchmark-2.5-Egypt-HD-C24Z16-mean', 'GLBenchmark-2.5-Egypt-HD-C24Z16-Offscreen-mean', - 'Triangle-throughput-Textured-C24Z16-Fragment-lit-mean', 'Triangle-throughput-Textured-C24Z16-Offscreen-Fragment-lit-mean', - 'Triangle-throughput-Textured-C24Z16-mean', 'Triangle-throughput-Textured-C24Z16-Offscreen-mean', - 'Triangle-throughput-Textured-C24Z16-Vertex-lit-mean', 'Triangle-throughput-Textured-C24Z16-Offscreen-Vertex-lit-mean', - ],}, - } - -# test_suite is "vts-test" -vts = [ - 'vts-hal', - 'vts-kernel-kselftest', - 'vts-kernel-ltp', - 'vts-kernel-part1', - 'vts-library', - 'vts-performance', - ] - -# test_suite is the same as job name -cts_v7a = [ 'cts-focused1-v7a', - 'cts-focused2-v7a', - 'cts-media-v7a', - 'cts-media2-v7a', - 'cts-opengl-v7a', - 'cts-part1-v7a', - 'cts-part2-v7a', - 'cts-part3-v7a', - 'cts-part4-v7a', - 'cts-part5-v7a', - ] - -# test_suite is the same as job name -cts_v8a = [ 'cts-focused1-v8a', - 'cts-focused2-v8a', - 'cts-media-v8a', - 'cts-media2-v8a', - 'cts-opengl-v8a', - 'cts-part1-v8a', - 'cts-part2-v8a', - 'cts-part3-v8a', - 'cts-part4-v8a', - 'cts-part5-v8a', - ] - @login_required -@permission_required('report.can_testcase', login_url='/report/accounts/no_permission/') +@permission_required('report.add_testcase', login_url='/report/accounts/no_permission/') def test_report(request): build_name = request.GET.get("build_name", DEFAULT_BUILD_NAME) all_build_numbers = get_possible_builds(build_name) @@ -910,6 +909,7 @@ def test_report(request): base = None bugs = Bug.objects.filter(build_name=build_name, plan_suite=test_suite, module_testcase=test_suite) + comments = Comment.objects.filter(build_name=build_name, plan_suite=test_suite, module_testcase=test_suite) number_total = number_pass + number_fail + number_skip number_passrate = 0 @@ -925,6 +925,7 @@ def test_report(request): 'number_passrate': number_passrate, 'base': base, 'bugs': bugs, + 'comments': comments, }) if cache_to_base and ( job_id is not None): @@ -968,6 +969,7 @@ def test_report(request): base = None bugs = Bug.objects.filter(build_name=build_name, plan_suite=test_suite, module_testcase=test_case) + comments = Comment.objects.filter(build_name=build_name, plan_suite=test_suite, module_testcase=test_case) if measurement == '--': difference = -100 @@ -986,6 +988,7 @@ def test_report(request): 'measurement': measurement, 'base': base, 'bugs': bugs, + 'comments': comments, 'difference': difference, }) if cache_to_base and job_id is not None: @@ -1029,6 +1032,7 @@ def test_report(request): base = None bugs = Bug.objects.filter(build_name=build_name, plan_suite=job_name, module_testcase=job_name) + comments = Comment.objects.filter(build_name=build_name, plan_suite=job_name, module_testcase=job_name) vts_res.append({'job_name': job_name, 'job_id': job_id, @@ -1039,6 +1043,7 @@ def test_report(request): 'failed_testcases': failed_testcases, 'base': base, 'bugs': bugs, + 'comments': comments, }) if cache_to_base and job_id is not None: BaseResults.objects.create(build_name=build_name, build_no=build_no, job_name=job_name, job_id=job_id, lava_nick=lava_nick, @@ -1126,6 +1131,7 @@ def test_report(request): base = None bugs = Bug.objects.filter(build_name=build_name, plan_suite=job_name, module_testcase=module_name) + comments = Comment.objects.filter(build_name=build_name, plan_suite=job_name, module_testcase=module_name) cts_res.append({'job_name': job_name, 'job_id': job_id, 'module_name': module_name, @@ -1135,6 +1141,7 @@ def test_report(request): 'number_passrate': number_passrate, 'base': base, 'bugs': bugs, + 'comments': comments, }) if cache_to_base: BaseResults.objects.create(build_name=build_name, build_no=build_no, job_name=job_name, job_id=job_id, lava_nick=lava_nick, @@ -1233,31 +1240,36 @@ def test_report(request): 'vts_res': vts_res, 'cts_res': cts_res, 'build_bugs': build_bugs, + 'jobs_failed': jobs_failed, } ) class BugForm(forms.ModelForm): class Meta: model = Bug - fields = ['build_name', 'bug_id', 'link', 'subject', 'status', 'plan_suite', 'module_testcase'] + fields = ['build_name', 'build_no', 'bug_id', 'link', 'subject', 'status', 'plan_suite', 'module_testcase'] @login_required def add_bug(request): if request.method == 'POST': build_name = request.POST.get("build_name") + build_no = request.POST.get("build_no") form = BugForm(request.POST) form.save() build_info = { 'build_name': build_name, + 'build_no': build_no, 'message': 'Added bug successfully', } else: # GET build_name = request.GET.get("build_name", DEFAULT_BUILD_NAME) + build_no = request.GET.get("build_no", '') plan_suite = request.GET.get("plan_suite", '') module_testcase = request.GET.get("module_testcase", '') form_initial = {"build_name": build_name, + "build_no": build_no, "plan_suite": plan_suite, "status": 'unconfirmed', "module_testcase": module_testcase, @@ -1266,6 +1278,7 @@ def add_bug(request): build_info = { 'build_name': build_name, + 'build_no': build_no, } return render(request, 'add_bug.html', @@ -1275,6 +1288,50 @@ def add_bug(request): }) +class CommentForm(forms.ModelForm): + class Meta: + model = Comment + fields = ['build_name', 'build_no', 'plan_suite', 'module_testcase', 'comment'] + + +@login_required +def add_comment(request): + if request.method == 'POST': + build_name = request.POST.get("build_name") + build_no = request.POST.get("build_no") + form = CommentForm(request.POST) + form.save() + + build_info = { + 'build_name': build_name, + 'build_no': build_no, + 'message': 'Added comment successfully', + } + else: # GET + build_name = request.GET.get("build_name", DEFAULT_BUILD_NAME) + build_no = request.GET.get("build_no", '') + plan_suite = request.GET.get("plan_suite", '') + module_testcase = request.GET.get("module_testcase", '') + form_initial = {"build_name": build_name, + "build_no": build_no, + "plan_suite": plan_suite, + "status": 'unconfirmed', + "module_testcase": module_testcase, + } + form = CommentForm(initial=form_initial) + + build_info = { + 'build_name': build_name, + 'build_no': build_no, + } + + return render(request, 'add_comment.html', + { + "form": form, + "build_info": build_info, + }) + + if __name__ == "__main__": build_name = "android-lcr-reference-hikey-o" build_no = '20' |