Merge lp://staging/~brendan-donegan/checkbox/piglit_wrapper into lp://staging/checkbox
Status: | Merged |
---|---|
Merged at revision: | 1849 |
Proposed branch: | lp://staging/~brendan-donegan/checkbox/piglit_wrapper |
Merge into: | lp://staging/checkbox |
Diff against target: |
194 lines (+154/-16) 3 files modified
debian/changelog (+2/-0) jobs/piglit.txt.in (+54/-16) scripts/piglit_test (+98/-0) |
To merge this branch: | bzr merge lp://staging/~brendan-donegan/checkbox/piglit_wrapper |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Zygmunt Krynicki (community) | Approve | ||
Brendan Donegan (community) | Needs Resubmitting | ||
Daniel Manrique (community) | Approve | ||
Review via email: mp+139181@code.staging.launchpad.net |
Description of the change
Should really be called piglit_revamp. Adds a wrapper script which makes the result of the test easier to read, as well as ensuring the job result is failure if any of the tests fail or crash. Also included is a revamp of the tests that are actually run. The piglit/fbo job is kept in name, but the set of tests run is changed, and the piglit/texturize test is completely removed. Instead what is run is a selection of tests which have been agreed to be essential for proper functioning of Ubuntu.
Whitelists which use the piglit tests will need to be updated with:
__piglit__
piglit/fbo
piglit/gl-2.1
piglit/vbo
piglit/
piglit/
piglit/glx-tfp
piglit/
piglit/
piglit/tarball
instead of what was there before
117 + log_path = os.environ. get('CHECKBOX_ DATA',' .') + '/piglit-results/' + self._nam
I'm bike-shedding here but that's something I'd use os.path.join() for
Also there's a missing space after the first comma
156 + type=open,
This is wrong, use argparse. FileType( "wt")
150 + parser. add_argument( "--test" , "-t",
151 + action='append',
152 + help="The expression used to get the tests to run.")
I'm not 100% sure here but action="append" without default=() will give you _either_ a list or None which is annoying from coding point of view. You may want to check if a default value makes sense here. A simple sanity check is to ask yourself what happens when you run the test program without the -t argument.
102 +from subprocess import check_output, PIPE, STDOUT
103 +from argparse import ArgumentParser
You may want to sort those
126 + piglit_output = check_output( run_command, newlines= True, output. split(' \n'): line.split( ' :: ')[-1].strip()] = \
127 + universal_
128 + stderr=STDOUT)
129 + # TODO: Capture stderr instead?
130 + for line in piglit_
131 + if ' :: ' in line:
132 + self._results[
133 + line.split(' :: ')[-2].strip()
This got me confused, arguably I never ran piglit but where is it printing the interesting bits to? stdout or stderr? If both then this is probably fine (but kill the comment), otherwise capture only the relevant stream.
112 + def run(self, output=None): get('CHECKBOX_ DATA',' .') + '/piglit-results/' + self._name
113 + piglit_output = ''
114 + if output:
115 + piglit_output = output.read()
116 + else:
117 + log_path = os.environ.
This is strange, the output parameter smells like something you'd do to unit-test the code below that does parsing.
If that is the case it'd be nice to write some actual tests. If not I don't understand what it is for. In either case
it feels less dirty to split this into _run and _parse that are easily testable without any mocking or just use the excellent mocker built into python so that the special-case argument is no longer needed.
Thanks
ZK