Merge lp:~afrantzis/lava-test/render-bench into lp:lava-test/0.0

Proposed by Alexandros Frantzis
Status: Merged
Merged at revision: 131
Proposed branch: lp:~afrantzis/lava-test/render-bench
Merge into: lp:lava-test/0.0
Diff against target: 37 lines (+33/-0)
1 file modified
abrek/test_definitions/render-bench.py (+33/-0)
To merge this branch: bzr merge lp:~afrantzis/lava-test/render-bench
Reviewer Review Type Date Requested Status
Zygmunt Krynicki (community) Approve
Paul Larson Pending
Review via email: mp+37247@code.launchpad.net

Description of the change

Add render-bench test definition.

To post a comment you must log in.
Revision history for this message
Paul Larson (pwlars) wrote :

Similar comments to other branches, test_case_id has characters unsupported by the dashboard. I've thought about putting something into AbrekTestParser to convert ' '->'_' and remove all others perhaps, not sure if I should do this though or maybe just throw an exception if it has illegal characters in the test_case_id and leave it to the test developer to sort this out in a way that makes sense for that particular test. Thoughts?

Revision history for this message
Alexandros Frantzis (afrantzis) wrote :

I think it is worth having this in abrek. The test definition developer should not have to care about he internal restrictions of the system (which may change at any time). The only complication with this is that abrek should make sure to not transform two distinct invalid test case ids to the same valid id.

Any developers that want to customize a test id can do it anyway. They just have to make sure they don't use any invalid characters, so that abrek's internal transformation doesn't kick in.

Revision history for this message
Zygmunt Krynicki (zyga) wrote :

Looks good

review: Approve
Revision history for this message
Zygmunt Krynicki (zyga) wrote :

Two more comments as I merge this:

1) Add an entry doc/changes.rst the next time
2) Put a docstring and ensure it builds to a sensible test description

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'abrek/test_definitions/render-bench.py'
2--- abrek/test_definitions/render-bench.py 1970-01-01 00:00:00 +0000
3+++ abrek/test_definitions/render-bench.py 2010-10-01 13:21:02 +0000
4@@ -0,0 +1,33 @@
5+import re
6+import abrek.testdef
7+
8+class RenderBenchParser(abrek.testdef.AbrekTestParser):
9+ def parse(self):
10+ PAT1 = "^Test: (?P<test_case_id>.*)"
11+ PAT2 = "^Time: (?P<measurement>\d+\.\d+)"
12+ filename = "testoutput.log"
13+ pat1 = re.compile(PAT1)
14+ pat2 = re.compile(PAT2)
15+ cur_test = None
16+ with open(filename, 'r') as fd:
17+ for line in fd:
18+ match = pat1.search(line)
19+ if match:
20+ cur_test = match.groupdict()['test_case_id']
21+ else:
22+ match = pat2.search(line)
23+ if match:
24+ d = match.groupdict()
25+ d['test_case_id'] = cur_test
26+ self.results['test_results'].append(d)
27+
28+ self.appendtoall({'units':'seconds', 'result':'pass'})
29+
30+RUNSTEPS = ["render_bench"]
31+
32+inst = abrek.testdef.AbrekTestInstaller(deps=["render-bench"])
33+run = abrek.testdef.AbrekTestRunner(RUNSTEPS)
34+parse = RenderBenchParser()
35+
36+testobj = abrek.testdef.AbrekTest(testname="render-bench", installer=inst,
37+ runner=run, parser=parse)

Subscribers

People subscribed via source and target branches