LAVA regexp does not handle "none" in measurements

Bug #1258679 reported by Mike Holmes
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
LAVA Project
Confirmed
Medium
Tyler Baker

Bug Description

The following data is a snippet from 10s of results that have multiple measurement data and an overall result for the test, requiring the mixing of LAVA results which have measurements and some without measurements all in the same run.

For eample the test produces

    sched_latency_stddev measurement:12.1115 units:us result:skip
    sched_latency_test result:FAIL

    Externally to lava this regexp works
    ^(?P<test_case_id>[-\w]+)s*(?:measurement:)?(?P<measurement>[0-9.]+)?(?:\s*units:)?(?P<units>\w+)?\s*result:(?P<result>[\w]+).*$

    Using non matching (:?..) parens and the 0 or 1 '?'

    Giving:-

    units us
    measurement 12.1115
    result skip
    test_case_id sched_latency_stddev

    units None
    measurement None
    result FAIL
    test_case_id sched_latency_test

    LAVA gives results like the following, and it looks like it sees the "None" for the measurement and freaks out that it is not a number :)

     Traceback (most recent call last):

      File "/srv/lava/.cache/git-cache/exports/lava-dispatcher/2013-11-08-8a9833c/lava_dispatcher/lava_test_shell.py", line 400, in get_bundle
      testruns.append(_get_test_run(test_run_path, hwctx, build, pkginfo, testdef_objs, err_log))

      File "/srv/lava/.cache/git-cache/exports/lava-dispatcher/2013-11-08-8a9833c/lava_dispatcher/lava_test_shell.py", line 366, in _get_test_run
      'test_results': _get_test_results(test_run_dir, testdef, stdout, err_log),

      File "/srv/lava/.cache/git-cache/exports/lava-dispatcher/2013-11-08-8a9833c/lava_dispatcher/lava_test_shell.py", line 267, in _get_test_results
      res['measurement'] = decimal.Decimal(res['measurement'])

      File "/usr/lib/python2.7/decimal.py", line 658, in __new__
      raise TypeError("Cannot convert %r to Decimal" % value)
     TypeError: Cannot convert None to Decimal

It would be nice for the "None" case where presumably the none is becasue there was no match for measurement, if it did not try to convert it to a decimal.

summary: - LAVA regexp does not handle "none" in masurements
+ LAVA regexp does not handle "none" in measurements
Changed in lava-project:
importance: Undecided → Medium
assignee: nobody → Tyler Baker (tyler-baker)
status: New → Confirmed
Revision history for this message
Antonio Terceiro (terceiro) wrote :

agreed, LAVA should be able to handle a None value properly when there is no match

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.