Merge lp://qastaging/~liuyq0307/lava-android-test/support-custom-command into lp://qastaging/lava-android-test
Proposed by
Yongqin Liu
Status: | Merged |
---|---|
Merged at revision: | 142 |
Proposed branch: | lp://qastaging/~liuyq0307/lava-android-test/support-custom-command |
Merge into: | lp://qastaging/lava-android-test |
Diff against target: |
311 lines (+152/-18) 4 files modified
lava_android_test/commands.py (+128/-8) lava_android_test/main.py (+5/-1) lava_android_test/testdef.py (+17/-9) setup.py (+2/-0) |
To merge this branch: | bzr merge lp://qastaging/~liuyq0307/lava-android-test/support-custom-command |
Related bugs: | |
Related blueprints: |
Support custom android command
(Essential)
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Zygmunt Krynicki (community) | Approve | ||
Le Chi Thu (community) | Needs Fixing | ||
Zach Pfeffer | Pending | ||
Review via email:
|
This proposal supersedes a proposal from 2012-03-07.
Description of the change
mainly 3 points:
1. add support for running android command that user specified
2. add run option for run command
3. change the parent directory of temporary directory to 777,
so that anyone can write and read for that directory.
And about the support for specified android command,
if it's acceptable, then I will modify lava-dispatcher and linaro-
to make it can be used on android-build.
To post a comment you must log in.
18 + parser. add_argument( '-O', '--run-option', help=("Specified in the job file for using in the real test action,"
19 + " so that we can customize some test when need"))
This is probably too long. I'd split it before help= if I were you. Running pep8 lava_android_test will tell you more.
+ except Exception as strerror: r("Test execution error: %s" % strerror)
37 + raise LavaCommandErro
By convention the exception should be named 'exc'. Using strerror is confusing as it may imply this is the C equivalent which it is not.
52 + parser. add_argument( '-c', '--android- command' , action='append', help=("Specified in the job file for using in the real test action," add_argument( '-p', '--parse-regex', help=("Specified the regular expression used for analyzing command output"))
53 + " so that we can customize some test when need"))
54 + parser.
Probably too long as well
74 + tip_msg = '' %s):\n\ t\t%s" % (self.args.serial, '\n\t\t' .join(ADB_ SHELL_STEPS) ) t'.join( ADB_SHELL_ STEPS))
75 + if self.args.serial:
76 + tip_msg = "Run following custom test(s) on device(
77 + else:
78 + tip_msg = "Run following custom test(s):\n\t\t%s" % ('\n\t\
Line 74 is not needed. Python scoping will ensure that tip_msg is present after the if/else statement.
81 + inst = AndroidTestInst aller() er(adbshell_ steps=ADB_ SHELL_STEPS) er(pattern= PATTERN) testname= test_name, installer=inst, self.adb)
82 + run = AndroidTestRunn
83 + parser = AndroidTestPars
84 + test = AndroidTest(
85 + runner=run, parser=parser)
86 + test.parser.results = {'test_results':[]}
87 + test.setadb(
I cannot help to notice that we're duplicating part of lava-test. Could we consider depending on lava-test and reuse the TestArtifacts class defined there? I know this is a long topic so we can postpone this discussion but I want to reverse the trend so that we go towards unified APIs for both host-driven (lava-android-test, upcoming lava-uboot-test) and target-driven (lava-test) frameworks.
188 + #make every user can write/read this directory config. tempdir_ host, 0777)
189 + os.chmod(
Why is this needed?