Comment 4 for bug 1296880

Revision history for this message
Mike Holmes (mike-holmes) wrote : Re: [Bug 1296880] Re: LAVA result regex can't be validated prior to a run

Your test implies that python regex should work, let my try my snippet with
your test, I expect it to pass your test also.

On 25 March 2014 07:49, Milosz Wasilewski <email address hidden>wrote:

> OK, understood.
> I'm using a simple script for checking my regexps:
>
> import sys
> import re
>
> r = re.compile("^(?P<result>(PASS|FAIL))\s(?P<test_case_id>[a-zA-Z\.]+)")
> f = open(sys.argv[1], "r")
> for line in f.readlines():
> w = r.search(line)
> if w:
> print w.group('result'), w.group('test_case_id')
> f.close()
>
> This is how I understand LAVA parses the output. I copy the output from
> the full log and save it to file. Than I pass this file to the script.
> The only difference is that the single backslashes have to be replaced
> with double ones in YAML file. That works perfectly fine for me. I guess
> it might save your day in a short term (while the LAVA regexp parser
> tool is not available).
>
> --
> You received this bug notification because you are a member of Linaro
> Validation Team, which is subscribed to LAVA Project.
> https://bugs.launchpad.net/bugs/1296880
>
> Title:
> LAVA result regex can't be validated prior to a run
>
> Status in LAVA Project:
> New
>
> Bug description:
> When developing a test, python regex tools can provide some validation
> of the results string parsing outside of LAVA.
>
> However the results are not always the same or complete, and this is a
> problem with tests that take hours to run.
>
> A tool - ideally web based and thus always current, that could
> validate a results string pasted into a window similar to how JSON
> scripts can be run would be very valuable. It should return the same
> results that LAVA would be expecting such as test_case_id, results
> etc.
>
> e.g.
> If I were to paste in the regex
> ^(?P<test_case_id>[\s\S]+)\s+Result:(?P<result>(pass|fail))
> and
> a results string such as
> test atomic inc/dec of signed word_1_2 Result:pass
>
> I would expect to see
>
> LAVA results = OK
> test_case_id = "test atomic inc/dec of signed word_1_2"
> result = "pass"
>
> Or some helpful diagnosis if the result would not have produced any
> test result had this been a real run.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/lava-project/+bug/1296880/+subscriptions
>