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
>
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: bazaar. launchpad. net/~linaro- validation/ lava-android- test/trunk/ view/head: /lava_android_ test/commands. py#L412 test/testdef. py' test/testdef. py 2012-12-06 11:02:22 +0000 test/testdef. py 2013-04-08 05:29:14 +0000 (self): 'test_results' ]: 'measurement' ] = case['measureme nt']) 'measurement' ] = decimal.Decimal( 'measurement' ]) InvalidOperatio n: warning( "Invalid measurement %s" % ( 'measurement' ])) 'measurement' ] www.stylesen. org/ www.sasenthilku maran.com/ /bugs.launchpad .net/bugs/ 1163661 R>2013- 04-02 09:06:13 AM WARNING: expr='object. test_runs[ 0].test_ results[ 0].measurement' , expr='schema. properties. test_runs. items.propertie s.test_ results. items.propertie s.measurement. type')) . /bugs.launchpad .net/lava- dispatcher/ +bug/1163661/ +subscriptions
> > In lava-android-test, the validation is done too.
> > It is done by he DocumentIO.dump like here:
> >
> http://
>
> 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_
> --- lava_android_
> +++ lava_android_
> @@ -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
> - """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[
> if 'measurement' in test_case:
> - test_case[
> float(test_
> + try:
> + test_case[
> + test_case[
> + except decimal.
> + logging.
> + test_case[
> + del test_case[
>
> 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://
> http://
>
> --
> You received this bug notification because you are a member of Linaro
> Validation Team, which is subscribed to LAVA Dispatcher.
> https:/
>
> 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_DISPATCHE
> [ACTION-E] lava_test_shell is finished with error (ValidationError:
> Object has incorrect type (expected number)
> object_
>
> schema_
>
> To manage notifications about this bug go to:
> https:/
>
-- ------- ------- ------- ------- ------- ------- ------- ------- lists.linaro. org/mailman/ listinfo/ linaro- android lists.linaro. org/pipermail/ linaro- validation
Thanks,
Yongqin Liu
-------
#mailing list
<email address hidden> <email address hidden>
http://
<email address hidden> <email address hidden>
http://