From patchwork Wed Sep 26 13:57:16 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Doan X-Patchwork-Id: 11734 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 01C8A23EFB for ; Wed, 26 Sep 2012 13:57:20 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by fiordland.canonical.com (Postfix) with ESMTP id 883ABA18219 for ; Wed, 26 Sep 2012 13:57:19 +0000 (UTC) Received: by ieje10 with SMTP id e10so1382320iej.11 for ; Wed, 26 Sep 2012 06:57:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf :content-type:mime-version:x-launchpad-project:x-launchpad-branch :x-launchpad-message-rationale:x-launchpad-branch-revision-number :x-launchpad-notification-type:to:from:subject:message-id:date :reply-to:sender:errors-to:precedence:x-generated-by :x-launchpad-hash:x-gm-message-state; bh=xxxdsqMmanBkgCe3H7oFP8JF850CZv8XuixfwzHV4Ko=; b=TdgRa+IjqtzwVhttPVSNZb6y9jlw2Z+0U/wZRD2ziX84iiEfLndzXENxa5VceYFW3E pk60Xe6nXP+n5S1IMuQRX6Ye8X/HdPL0g5je8KrVPuo+KhBuC2c3g8b0z9qNEJJdZw3I 7rJg3FEPKQvxvi3Ql4SKKGKxkuvXaT0GismexpMEaJYRmxyLJIvq/GNvX5MOnCsP6vwt rnYS4QIYdA22xMsf7bdOgQYzJyKjqxO4lVosKVIhVbc3qQmCOBv7+W5XgawUyHNsACVZ xDsyvmOPO156UoZ0dGVguYVdwHchloK+ZzwXayRLdkmJti0hbPDxd6hnbF23szgZqaoC LlYg== Received: by 10.42.109.194 with SMTP id m2mr415431icp.48.1348667838924; Wed, 26 Sep 2012 06:57:18 -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.50.184.232 with SMTP id ex8csp356728igc; Wed, 26 Sep 2012 06:57:17 -0700 (PDT) Received: by 10.180.88.130 with SMTP id bg2mr8264689wib.22.1348667836756; Wed, 26 Sep 2012 06:57:16 -0700 (PDT) Received: from indium.canonical.com (indium.canonical.com. [91.189.90.7]) by mx.google.com with ESMTPS id dp1si8312985wib.9.2012.09.26.06.57.16 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 26 Sep 2012 06:57:16 -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 1TGs72-0006YA-6J for ; Wed, 26 Sep 2012 13:57:16 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id 2199AE03E6 for ; Wed, 26 Sep 2012 13:57:16 +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: 348 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-validation/lava-dashboard/trunk] Rev 348: Added XML-RPC call to retrieve test names Message-Id: <20120926135716.24803.31600.launchpad@ackee.canonical.com> Date: Wed, 26 Sep 2012 13:57:16 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="16033"; Instance="launchpad-lazr.conf" X-Launchpad-Hash: 5bfe25288b98b7c4d682c2a33127b018ccaaa516 X-Gm-Message-State: ALoCoQn1saLwucF8O9Y+xbUM9LplDLFk59Ui6mgv8KGZI8yZeMagcvgS+P9Z4yj9KNQMKbZdBy3T Merge authors: Milo Casagrande (milo) Related merge proposals: https://code.launchpad.net/~milo/lava-dashboard/get-test-names/+merge/124959 proposed by: Milo Casagrande (milo) review: Approve - Andy Doan (doanac) ------------------------------------------------------------ revno: 348 [merge] committer: Andy Doan branch nick: lava-dashboard timestamp: Wed 2012-09-26 08:55:57 -0500 message: Added XML-RPC call to retrieve test names modified: dashboard_app/xmlrpc.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/xmlrpc.py' --- dashboard_app/xmlrpc.py 2012-03-15 03:09:06 +0000 +++ dashboard_app/xmlrpc.py 2012-09-26 13:55:57 +0000 @@ -38,6 +38,7 @@ Bundle, BundleStream, DataView, + Test, ) @@ -112,7 +113,7 @@ except: logging.exception("big oops") raise - else: + else: logging.debug("Deserializing bundle") bundle.deserialize() return bundle @@ -364,7 +365,7 @@ the following fields: `uploaded_by`: string - The username of the user that uploaded this bundle or + The username of the user that uploaded this bundle or empty string if this bundle was uploaded anonymously. `uploaded_on`: datetime The timestamp when the bundle was uploaded @@ -407,6 +408,36 @@ 'is_deserialized': bundle.is_deserialized } for bundle in bundle_stream.bundles.all().order_by("uploaded_on")] + @xml_rpc_signature('str', 'str') + def get_test_names(self, device_type=None): + """ + Name + ---- + `get_test_names` ([`device_type`]]) + + Description + ----------- + Get the name of all the tests that have run on a particular device type. + + Arguments + --------- + `device_type`: string + The type of device the retrieved test names should apply to. + + Return value + ------------ + This function returns an XML-RPC array of test names. + """ + test_names = [] + if device_type: + for test in Test.objects.filter( + test_runs__attributes__name='target.device_type', + test_runs__attributes__value=device_type).distinct(): + test_names.append(test.name) + else: + for test in Test.objects.all(): + test_names.append(test.name) + return test_names def deserialize(self, content_sha1): """ @@ -457,7 +488,7 @@ Description ----------- - Create a bundle stream with the specified pathname + Create a bundle stream with the specified pathname Arguments --------- @@ -473,7 +504,7 @@ Exceptions raised ----------------- 403 - Pathname does not designate an anonymous stream + Pathname does not designate an anonymous stream 409 Bundle stream with the specified pathname already exists @@ -594,7 +625,7 @@ --------- `name`: string Name of the data view to lookup - + Return value ------------ @@ -632,7 +663,7 @@ "name": data_view.name, "summary": data_view.summary, "documentation": data_view.documentation, - "sql": query.sql_template if query is not None else None, + "sql": query.sql_template if query is not None else None, "arguments": [{ "name": arg.name, "type": arg.type,