Merge lp:~milo/lava-dashboard/get-test-names into lp:lava-dashboard

Proposed by Milo Casagrande
Status: Merged
Merged at revision: 348
Proposed branch: lp:~milo/lava-dashboard/get-test-names
Merge into: lp:lava-dashboard
Diff against target: 48 lines (+31/-0)
1 file modified
dashboard_app/xmlrpc.py (+31/-0)
To merge this branch: bzr merge lp:~milo/lava-dashboard/get-test-names
Reviewer Review Type Date Requested Status
Andy Doan (community) Approve
Review via email: mp+124959@code.launchpad.net

Description of the change

Hi,

with this small branch here I added a simple XML-RPC 'get_test_names' to retrieve test names from lava-dashboard.

To post a comment you must log in.
Revision history for this message
Andy Doan (doanac) wrote :

I have one small nitpick. Can you change the method signature from:

 def get_tests_names(self, device=None):

to

 def get_tests_names(self, device_type=None):

Just to keep the wording of things in code consistent.

346. By Milo Casagrande

Renamed method argument.

Revision history for this message
Milo Casagrande (milo) wrote :

On Fri, Sep 21, 2012 at 4:39 PM, Andy Doan <email address hidden> wrote:
> I have one small nitpick. Can you change the method signature from:
>
> def get_tests_names(self, device=None):
>
> to
>
> def get_tests_names(self, device_type=None):
>
> Just to keep the wording of things in code consistent.

Absolutely!
This is now done.

Thanks.

--
Milo Casagrande
Infrastructure Engineer
Linaro.org <www.linaro.org> │ Open source software for ARM SoCs

347. By Milo Casagrande

Refactored method name.

Revision history for this message
Milo Casagrande (milo) wrote :

I refactored the method name, since it contained a typo: it was "get_tests_names" instead of "get_test_names".

Revision history for this message
Andy Doan (doanac) wrote :

I think this is sufficient for now. My team is discussing a real way to support this in the future, but I don't see anything in the MP that would hinder that process.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'dashboard_app/xmlrpc.py'
--- dashboard_app/xmlrpc.py 2012-03-15 03:09:06 +0000
+++ dashboard_app/xmlrpc.py 2012-09-25 10:58:30 +0000
@@ -38,6 +38,7 @@
38 Bundle,38 Bundle,
39 BundleStream,39 BundleStream,
40 DataView,40 DataView,
41 Test,
41)42)
4243
4344
@@ -407,6 +408,36 @@
407 'is_deserialized': bundle.is_deserialized408 'is_deserialized': bundle.is_deserialized
408 } for bundle in bundle_stream.bundles.all().order_by("uploaded_on")]409 } for bundle in bundle_stream.bundles.all().order_by("uploaded_on")]
409410
411 @xml_rpc_signature('str', 'str')
412 def get_test_names(self, device_type=None):
413 """
414 Name
415 ----
416 `get_test_names` ([`device`]])
417
418 Description
419 -----------
420 Get the name of all the tests ran.
421
422 Arguments
423 ---------
424 `device`: string
425 The type of device the retrieved test names should apply to.
426
427 Return value
428 ------------
429 This function returns an XML-RPC array of test names.
430 """
431 test_names = []
432 if device_type:
433 for test in Test.objects.filter(
434 test_runs__attributes__name='target.device_type',
435 test_runs__attributes__value=device_type).distinct():
436 test_names.append(test.name)
437 else:
438 for test in Test.objects.all():
439 test_names.append(test.name)
440 return test_names
410441
411 def deserialize(self, content_sha1):442 def deserialize(self, content_sha1):
412 """443 """

Subscribers

People subscribed via source and target branches