Comment 5 for bug 1052545

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote : Re: [Bug 1052545] Re: Missing XML-RPC to get list of test names

Andy Doan <email address hidden> writes:

> +Michael who's a DB query wizard.
>
> On 09/19/2012 03:17 AM, Milo Casagrande wrote:
>> Hello Andy,
>>
>> thanks for the input!
>>
>> On Wed, Sep 19, 2012 at 12:02 AM, Andy Doan <email address hidden> wrote:
>>> I think you are on the right track here. However, rather than listing
>>> all tests, we could probably make this function take some params. For
>>> example, if we know:
>>>
>>> device-type (panda, vexpress, origen, etc)
>>> build-type (android / ubuntu)

FWIW, I don't see a particularly clean or reliable way to tell tests
that have run on android from tests that have run on ubuntu currently...

>>> You could actually filter down the list of tests more appropriately.
>>
>> Something like that would be awesome for us, but I guess I need a
>> little bit of guidance here then.
>> Looking at the Test model in 'lava_dashboard/dashboard_app/models.py',
>> the model is pretty simple, there is no information about device or
>> build.
>>
>> The only reference about hardware I found is in TestRun model, that
>> refers to HardwareDevice, but the latter is not really helpful.
>>
>
> Michael - do you think there's a way to query for this semi-efficiently.
> ie somehow doing a "SELECT test where device_type=='panda'"

models.Test.objects.filter(
    test_runs__attributes__name='target.device_type',
    test_runs__attributes__value='panda').distinct()

returns all the tests that have evey been run on panda and seems to be
reasonably efficient (0.1s or so). Is that what you meant?

Cheers,
mwh