From patchwork Tue Oct 25 11:16:18 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yongqin Liu X-Patchwork-Id: 4806 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 5E60B23E0E for ; Tue, 25 Oct 2011 11:16:25 +0000 (UTC) Received: from mail-fx0-f52.google.com (mail-fx0-f52.google.com [209.85.161.52]) by fiordland.canonical.com (Postfix) with ESMTP id 4611AA18A1C for ; Tue, 25 Oct 2011 11:16:25 +0000 (UTC) Received: by faan26 with SMTP id n26so419134faa.11 for ; Tue, 25 Oct 2011 04:16:25 -0700 (PDT) Received: by 10.223.4.215 with SMTP id 23mr50513850fas.8.1319541385048; Tue, 25 Oct 2011 04:16:25 -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.152.1.71 with SMTP id 7cs108051lak; Tue, 25 Oct 2011 04:16:24 -0700 (PDT) Received: by 10.227.205.78 with SMTP id fp14mr2961182wbb.23.1319541378944; Tue, 25 Oct 2011 04:16:18 -0700 (PDT) Received: from indium.canonical.com (indium.canonical.com. [91.189.90.7]) by mx.google.com with ESMTPS id fo8si10363444wbb.80.2011.10.25.04.16.18 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 25 Oct 2011 04:16:18 -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 1RIezS-0004h1-Ef for ; Tue, 25 Oct 2011 11:16:18 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id 65AF0E01C5 for ; Tue, 25 Oct 2011 11:16:18 +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: 277 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-validation/lava-dashboard/trunk] Rev 277: merge for bug 877859: add measurement information to the json output Message-Id: <20111025111618.3797.84301.launchpad@ackee.canonical.com> Date: Tue, 25 Oct 2011 11:16:18 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="14185"; Instance="launchpad-lazr.conf" X-Launchpad-Hash: 21fcd2eebc17d1cbae01c9d98d91de2b30caf5fa Merge authors: Yongqin Liu (liuyq0307) Yongqin Liu (liuyq0307) Related merge proposals: https://code.launchpad.net/~liuyq0307/lava-dashboard/add-measurement-for-json/+merge/80305 proposed by: Yongqin Liu (liuyq0307) review: Approve - Zygmunt Krynicki (zkrynicki) ------------------------------------------------------------ revno: 277 [merge] committer: Yongqin Liu branch nick: lava-dashboard timestamp: Tue 2011-10-25 19:13:03 +0800 message: merge for bug 877859: add measurement information to the json output modified: dashboard_app/views.py --- 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/views.py' --- dashboard_app/views.py 2011-10-06 12:03:00 +0000 +++ dashboard_app/views.py 2011-10-25 11:13:03 +0000 @@ -187,10 +187,21 @@ bundle = bundle_stream.bundles.get(content_sha1=content_sha1) test_runs = [] for test_run in bundle.test_runs.all(): + results = test_run.get_summary_results() + + measurements = [{'item': str(item.test_case), + 'measurement': str(item.measurement), + 'units': str(item.units) + } + for item in test_run.test_results.filter( + measurement__isnull=False). + order_by('test_case__test_case_id')] + results['measurements'] = measurements + test_runs.append({ 'name': test_run.test.test_id, 'url': request.build_absolute_uri(test_run.get_absolute_url()), - 'results': test_run.get_summary_results() + 'results': results }) json_text = json.dumps({ 'test_runs':test_runs,