From patchwork Fri Aug 19 04:16:13 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zygmunt Krynicki X-Patchwork-Id: 3527 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id CA92423E54 for ; Fri, 19 Aug 2011 04:16:15 +0000 (UTC) Received: from mail-ew0-f52.google.com (mail-ew0-f52.google.com [209.85.215.52]) by fiordland.canonical.com (Postfix) with ESMTP id BD0AEA183CE for ; Fri, 19 Aug 2011 04:16:15 +0000 (UTC) Received: by mail-ew0-f52.google.com with SMTP id 28so1409608ewy.11 for ; Thu, 18 Aug 2011 21:16:15 -0700 (PDT) Received: by 10.213.32.131 with SMTP id c3mr20426ebd.94.1313727375516; Thu, 18 Aug 2011 21:16:15 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.213.102.5 with SMTP id e5cs112770ebo; Thu, 18 Aug 2011 21:16:15 -0700 (PDT) Received: by 10.227.182.138 with SMTP id cc10mr1258872wbb.98.1313727374077; Thu, 18 Aug 2011 21:16:14 -0700 (PDT) Received: from indium.canonical.com (indium.canonical.com [91.189.90.7]) by mx.google.com with ESMTPS id em13si7367401wbb.38.2011.08.18.21.16.13 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 18 Aug 2011 21:16:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.7 as permitted sender) client-ip=91.189.90.7; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.7 as permitted sender) smtp.mail=bounces@canonical.com Received: from ackee.canonical.com ([91.189.89.26]) by indium.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1QuGVB-0008Ng-K9 for ; Fri, 19 Aug 2011 04:16:13 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id 9073AE03D1 for ; Fri, 19 Aug 2011 04:16:13 +0000 (UTC) MIME-Version: 1.0 X-Launchpad-Project: lava-dashboard X-Launchpad-Branch: ~linaro-validation/lava-dashboard/trunk X-Launchpad-Message-Rationale: Subscriber X-Launchpad-Branch-Revision-Number: 256 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-validation/lava-dashboard/trunk] Rev 256: Rewrite image_status_detail template to show visual overview ala meego reports Message-Id: <20110819041613.15284.94182.launchpad@ackee.canonical.com> Date: Fri, 19 Aug 2011 04:16:13 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="13697"; Instance="initZopeless config overlay" X-Launchpad-Hash: 5344b27a2248822211f1dbdb9736f21b0d435f7b ------------------------------------------------------------ revno: 256 committer: Zygmunt Krynicki branch nick: pristine timestamp: Fri 2011-08-19 04:19:06 +0200 message: Rewrite image_status_detail template to show visual overview ala meego reports modified: dashboard_app/models.py dashboard_app/templates/dashboard_app/image_status_detail.html --- lp:lava-dashboard https://code.launchpad.net/~linaro-validation/lava-dashboard/trunk You are subscribed to branch lp:lava-dashboard. To unsubscribe from this branch go to https://code.launchpad.net/~linaro-validation/lava-dashboard/trunk/+edit-subscription === modified file 'dashboard_app/models.py' --- dashboard_app/models.py 2011-07-22 00:57:44 +0000 +++ dashboard_app/models.py 2011-08-19 02:19:06 +0000 @@ -757,15 +757,21 @@ def get_permalink(self): return reverse("dashboard_app.views.redirect_to_test_run", args=[self.analyzer_assigned_uuid]) - def get_summary_results(self): + def _get_summary_results(self, factor=3): stats = self.test_results.values('result').annotate( count=models.Count('result')).order_by() result = dict([ (TestResult.RESULT_MAP[item['result']], item['count']) for item in stats]) result['total'] = sum(result.values()) + result['total_multiplied'] = result['total'] * factor return result + def get_summary_results(self): + if not hasattr(self, '_cached_summary_results'): + self._cached_summary_results = self._get_summary_results() + return self._cached_summary_results + class Meta: ordering = ['-import_assigned_date'] @@ -1234,6 +1240,28 @@ "fail_percent": fail_percent, } + def get_recent_test_runs(self, last_n_days=7 * 2): + until = datetime.datetime.now() + since = until - datetime.timedelta(days=last_n_days) + return self.get_test_runs( + ).select_related( + ).filter( + analyzer_assigned_date__range=(since, until) + ).order_by('-analyzer_assigned_date') + + def get_chart_data(self): + return TestResult.objects.filter( + test_run__in=self.get_recent_test_runs().order_by(), + ).values( + 'test_run__analyzer_assigned_date' + ).extra( + select={'bucket': 'date(analyzer_assigned_date)'}, + ).values( + 'bucket', 'result' + ).annotate( + count=models.Count('result') + ).order_by('result') + def get_test_runs(self): return TestRun.objects.filter( bundle__bundle_stream__pathname="/anonymous/lava-daily/" === modified file 'dashboard_app/templates/dashboard_app/image_status_detail.html' --- dashboard_app/templates/dashboard_app/image_status_detail.html 2011-07-22 00:57:44 +0000 +++ dashboard_app/templates/dashboard_app/image_status_detail.html 2011-08-19 02:19:06 +0000 @@ -1,71 +1,180 @@ {% extends "dashboard_app/_content.html" %} {% load call %} +{% load i18n %} + + +{% block extrahead %} +{{ block.super }} + + + + +{% endblock %} + {% block content %} - - - - - - - - - - - - - - - - - - - - - - - {% for test in image_health.get_tests %} - {% call image_health.current_health_for_test test as current_test_health %} - {% call image_health.overall_health_for_test test as overall_test_health %} - 0 %} - {% if current_test_health.pass_count == 0 %} - style="background-color: rgba(255, 0, 0, 0.5)" - {% else %} - style="background-color: rgba(255, 165, 0, 0.5)" - {% endif %} +

Test history for image {{ image_health.rootfs_type }} + {{ image_health.hwpack_type }}

+{% with image_health.get_recent_test_runs as recent_test_run_list %} +{% if recent_test_run_list %} +
+
+ +
TestTotalsMost Recent Test RunDescription
PASSFAILFAIL rateTest RunsTest ResultsPASSFAILFAIL rateTest Results
+ + + + + + + {% regroup recent_test_run_list by analyzer_assigned_date|date:"Y W" as test_run_cluster_list %} + {% for test_run_cluster in test_run_cluster_list %} + + + + {% for test_run in test_run_cluster.list %} + + + + + - - - - - - - - - - - - {% endcall %} - {% endcall %} - {% endfor %} - + {% endwith %} + {% endwith %} + + + {% endfor %} + {% endfor %}
+ History of testing {{ image_health.rootfs_type }}+{{ image_health.hwpack_type }} on a weekly basis. +
DateTestResults
{{ test_run_cluster.grouper }}
{{ test_run.analyzer_assigned_date|date:"m.d" }}{{ test_run.test }}{{ test_run.test_results.count }} + {% with test_run.get_summary_results as summary %} + {% with 500 as max_width %} + {% if summary.total_multiplied > max_width %} + {% if summary.pass %} +
+ {% endif %} + {% if summary.fail %} +
+ {% endif %} + {% if summary.skip %} +
+ {% endif %} + {% if summary.unknown %} +
+ {% endif %} +
{% trans "graph not to scale" %}
{% else %} - {% if current_test_health.pass_count > 0 %} - style="background-color: rgba(173, 255, 47, 0.5)" + {% if summary.pass %} +
+ {% endif %} + {% if summary.fail %} +
+ {% endif %} + {% if summary.skip %} +
+ {% endif %} + {% if summary.unknown %} +
{% endif %} {% endif %} - > -
{{ test.test_id }}{{ overall_test_health.pass_count }}{{ overall_test_health.fail_count }}{{ overall_test_health.fail_percent|default_if_none:0|floatformat }}%{{ overall_test_health.total_run_count }}{{ overall_test_health.total_count }}{{ current_test_health.pass_count|default:0 }}{{ current_test_health.fail_count|default:0 }}{{ current_test_health.fail_percent|default_if_none:0|floatformat }}%{{ current_test_health.total_count|default:0 }}{{ test.name|default:"not set" }}
+{% else %} +

This combination of of root file system + hwardware pack was not tested in +the last 14 days

+{% endif %} +{% endwith %} {% endblock %}