Comment 11 for bug 1163661

Revision history for this message
Yongqin Liu (liuyq0307) wrote : Re: [Bug 1163661] Re: Not able to map float value to measurement field

For consistency, I think we need to fix it.
could you help to file a new bug and fix that?

And BTW, I can't image the difference on dashboard between the float and
Decimal.
do you know that?

Thanks,
Yongqin Liu

On 8 April 2013 13:35, Senthil Kumaran S <email address hidden> wrote:

> On Mon, 2013-04-08 at 05:02 +0000, Yongqin Liu wrote:
> > In lava-android-test, the validation is done too.
> > It is done by he DocumentIO.dump like here:
> >
> http://bazaar.launchpad.net/~linaro-validation/lava-android-test/trunk/view/head:/lava_android_test/commands.py#L412
>
> To be consistent with what we do, a patch to fix lava-android-test
> (untested) will look like the following:
>
> <snip>
> === modified file 'lava_android_test/testdef.py'
> --- lava_android_test/testdef.py 2012-12-06 11:02:22 +0000
> +++ lava_android_test/testdef.py 2013-04-08 05:29:14 +0000
> @@ -23,6 +23,7 @@
> import string
> import time
> import tempfile
> +import decimal
> from datetime import datetime
> from uuid import uuid4
>
> @@ -525,11 +526,18 @@
> return False
>
> def fixmeasurements(self):
> - """Measurements are often read as strings, but need to be float
> + """Measurements are often read as strings, but need to be
> + decimal.Decimal as per dashboard bundle format JSON schema.
> """
> for test_case in self.results['test_results']:
> if 'measurement' in test_case:
> - test_case['measurement'] =
> float(test_case['measurement'])
> + try:
> + test_case['measurement'] = decimal.Decimal(
> + test_case['measurement'])
> + except decimal.InvalidOperation:
> + logging.warning("Invalid measurement %s" % (
> + test_case['measurement']))
> + del test_case['measurement']
>
> def fixids(self, test_name=''):
> """
> </snip>
>
> Do we need to fix this in lava-android-test ? If so I feel a separate
> bug will be appropriate.
>
> Thank You.
>
> --
> Senthil Kumaran
> http://www.stylesen.org/
> http://www.sasenthilkumaran.com/
>
> --
> You received this bug notification because you are a member of Linaro
> Validation Team, which is subscribed to LAVA Dispatcher.
> https://bugs.launchpad.net/bugs/1163661
>
> Title:
> Not able to map float value to measurement field
>
> Status in LAVA Dispatcher:
> Fix Committed
>
> Bug description:
> After parsing, while mapping the fields to values lava_test_shell, It
> was throwing error
>
> root@master [rc=0]# <LAVA_DISPATCHER>2013-04-02 09:06:13 AM WARNING:
> [ACTION-E] lava_test_shell is finished with error (ValidationError:
> Object has incorrect type (expected number)
> object_expr='object.test_runs[0].test_results[0].measurement',
>
> schema_expr='schema.properties.test_runs.items.properties.test_results.items.properties.measurement.type')).
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/lava-dispatcher/+bug/1163661/+subscriptions
>

--
Thanks,
Yongqin Liu
---------------------------------------------------------------
#mailing list
<email address hidden> <email address hidden>
http://lists.linaro.org/mailman/listinfo/linaro-android
<email address hidden> <email address hidden>
http://lists.linaro.org/pipermail/linaro-validation