Merge lp:~liuyq0307/linaro-android-build-tools/add-monkey-l-a-t into lp:linaro-android-build-tools

Proposed by Yongqin Liu
Status: Merged
Approved by: Paul Sokolovsky
Approved revision: 337
Merged at revision: 355
Proposed branch: lp:~liuyq0307/linaro-android-build-tools/add-monkey-l-a-t
Merge into: lp:linaro-android-build-tools
Diff against target: 115 lines (+54/-21)
1 file modified
build-scripts/post-build-lava.py (+54/-21)
To merge this branch: bzr merge lp:~liuyq0307/linaro-android-build-tools/add-monkey-l-a-t
Reviewer Review Type Date Requested Status
Paul Sokolovsky Pending
James Westby Pending
Review via email: mp+76940@code.launchpad.net

This proposal supersedes a proposal from 2011-09-23.

Description of the change

modify for adding monkey test to android build
BP:
    https://blueprints.launchpad.net/linaro-android/+spec/linaro-android-run-monkey-in-lava

modify according review comments:
1. typo of submin_results_command
2. delete of IMAGE_TYPE revelant source
3. fix braces style

To post a comment you must log in.
Revision history for this message
James Westby (james-w) wrote : Posted in a previous version of this proposal

Hi,

This looks great, thanks, and there are some good cleanups
here too.

Is the new linaro_android_test_run action available on validation.linaro.org
and able to run both monkey and 0xbench?

If not then we will have to hold off on deploying this until it is.

54 + # Board-specific parameters

Extra space included in the indentation on that line.

122 + submin_results_command = "submit_results"
123 + if image_type == 'android':
124 + submin_results_command = "submit_results_on_host"

Typo in variable name, it should be "submit_results_command"

Thanks,

James

review: Approve
Revision history for this message
Paul Sokolovsky (pfalcon) wrote : Posted in a previous version of this proposal

+ image_type = os.environ.get("IMAGE_TYPE")

What's being done here? If it calls for adding another build config variable, it's likely superfluous (unless there're reasons why it's not).

Also, braces placement needs fixing, it for sure worse than was before. Rule of thumb is to just follow style of the existing code (and minimize any whitespace changes).

And can you please look thru associated blueprint's whiteboard, it seems to have typos which make it a bit unclear ("Acceptance: Monkey for as long as it can", "Update the meeting to a weekly")

review: Needs Fixing
Revision history for this message
Yongqin Liu (liuyq0307) wrote : Posted in a previous version of this proposal

thanks for review
> Is the new linaro_android_test_run action available on validation.linaro.org
> and able to run both monkey and 0xbench?
yes, linaro_android_test_run is available on validation.linaro.org, and can run both monkey and 0xbench

> If not then we will have to hold off on deploying this until it is.
>
> 54 + # Board-specific parameters
>
> Extra space included in the indentation on that line.
sorry, delete the extra space

> 122 + submin_results_command = "submit_results"
> 123 + if image_type == 'android':
> 124 + submin_results_command = "submit_results_on_host"
>
> Typo in variable name, it should be "submit_results_command"
sorry, I will fixing it.

Revision history for this message
Yongqin Liu (liuyq0307) wrote : Posted in a previous version of this proposal

> + image_type = os.environ.get("IMAGE_TYPE")
>
> What's being done here? If it calls for adding another build config variable,
> it's likely superfluous (unless there're reasons why it's not).
sorry, I didn't recognize that this file only be used for android-build.
I will delete the relevant source.

> Also, braces placement needs fixing, it for sure worse than was before. Rule
> of thumb is to just follow style of the existing code (and minimize any
> whitespace changes).
I have modify the braces placement according the policy that minimize any whitespace changes.
BTW, is there any coding style for braces?

> And can you please look thru associated blueprint's whiteboard, it seems to
> have typos which make it a bit unclear ("Acceptance: Monkey for as long as it
> can", "Update the meeting to a weekly")
I have updated the bp, is it ok now.

And is there any environment that I can test this file?
I want to see after the execution of this file, is the result displayed ok.

334. By Yongqin Liu

modify for undefined error

335. By Yongqin Liu

delete parameter result_disk for command "submit_results_on_host"

336. By Yongqin Liu

use the latest url for submit_results_on_host

337. By Yongqin Liu

make android.build a string instead of integer for lava-dashboard display

Revision history for this message
Paul Sokolovsky (pfalcon) wrote : Posted in a previous version of this proposal

On Mon, 26 Sep 2011 08:07:25 -0000
Yongqin Liu <email address hidden> wrote:

> > + image_type = os.environ.get("IMAGE_TYPE")
> >
> > What's being done here? If it calls for adding another build config
> > variable, it's likely superfluous (unless there're reasons why it's
> > not).
> sorry, I didn't recognize that this file only be used for
> android-build. I will delete the relevant source.

Thanks.

>
> > Also, braces placement needs fixing, it for sure worse than was
> > before. Rule of thumb is to just follow style of the existing code
> > (and minimize any whitespace changes).
> I have modify the braces placement according the policy that minimize
> any whitespace changes. BTW, is there any coding style for braces?

Well, we generally follow PEP8, though some grounded deviation may be
used. By general rule is the same as for C: everyone places braces in
different way, but when you submit patch for some code, you're expected
to follow the style of surrounding code. If you really think that
formatting should be changed, it should be separate commit - just
change formatting, no semantic changes.

> > And can you please look thru associated blueprint's whiteboard, it
> > seems to have typos which make it a bit unclear ("Acceptance:
> > Monkey for as long as it can", "Update the meeting to a weekly")
> I have updated the bp, is it ok now.
>
> And is there any environment that I can test this file?
> I want to see after the execution of this file, is the result
> displayed ok.

Thanks for bringing that up, that's how we'd like to handle such
changes for sure - test them on a sandbox before deploying on
production. I've created one at
https://ec2-75-101-195-88.compute-1.amazonaws.com/

Reviewing changes once again:

97 - "server": "http://validation.linaro.org/lava-server/dashboard",
98 + "server": "http://validation.linaro.org/lava-server/RPC2/",

Are you sure this is right? Why exactly such change is needed?

--
Best Regards,
Paul

Linaro.org | Open source software for ARM SoCs
Follow Linaro: http://www.facebook.com/pages/Linaro
http://twitter.com/#!/linaroorg - http://www.linaro.org/linaro-blog

Revision history for this message
Yongqin Liu (liuyq0307) wrote : Posted in a previous version of this proposal

thanks for review.

Thanks for bringing that up, that's how we'd like to handle such
> changes for sure - test them on a sandbox before deploying on
> production. I've created one at
> https://ec2-75-101-195-88.compute-1.amazonaws.com/
>
Thanks, but until now there hasn't been one build:(
How can i make a build there?

> Reviewing changes once again:
>
> 97 - "server": "http://validation.linaro.org/lava-server/dashboard",
> 98 + "server": "http://validation.linaro.org/lava-server/RPC2/",
>
> Are you sure this is right? Why exactly such change is needed?
>

yes, this is right. the dashoard one is deprecated.
and in the future we will use the new url, see the hlep of api about
lava-server.
http://validation.linaro.org/lava-server/api/help/

Thanks,
Yongqin Liu

Revision history for this message
Paul Sokolovsky (pfalcon) wrote : Posted in a previous version of this proposal

Thanks for clarification and checking that the sandbox now works. So, please test that it works as expected, and I'll merge it then.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'build-scripts/post-build-lava.py'
2--- build-scripts/post-build-lava.py 2011-09-15 15:46:49 +0000
3+++ build-scripts/post-build-lava.py 2011-09-28 06:15:29 +0000
4@@ -3,6 +3,29 @@
5 import json
6 import xmlrpclib
7
8+def gen_lava_android_test_actions(tests=[]):
9+ actions = []
10+ if len(tests) == 0:
11+ return actions
12+ inst_action = {
13+ "command": "lava_android_test_install",
14+ "parameters": {
15+ "tests": tests
16+ }
17+ }
18+ actions.append(inst_action)
19+
20+ for test in tests:
21+ run_action = {
22+ "command": "lava_android_test_run",
23+ "parameters": {
24+ "test_name": test
25+ }
26+ }
27+ actions.append(run_action)
28+ return actions
29+
30+
31 def main():
32 """Script entry point: return some JSON based on calling args.
33 We should be called from Jenkins and expect the following to
34@@ -19,8 +42,13 @@
35 build_url = os.environ.get("BUILD_URL")
36 test_plan = os.environ.get("LAVA_TEST_PLAN")
37 if test_plan == None:
38- test_plan = "test_android_0xbench"
39-
40+ test_plan = '0xbench, monkey'
41+ test_plans = test_plan.split(',')
42+ for index in range(len(test_plans)):
43+ test_plans[index] = test_plans[index].strip()
44+ if test_plans[index] == "test_android_0xbench":
45+ test_plans[index] = "0xbench"
46+
47 # Board-specific parameters
48 if target_product == "pandaboard":
49 # Board type to test on. Validation does the load balancing.
50@@ -35,12 +63,10 @@
51 print "Don't know how to test this board. Skip testing."
52 return
53
54- config = json.dumps( { "job_name": build_url,
55- "image_type": "android",
56- "device_type": test_target,
57- "timeout": 18000,
58- "actions": [
59- {
60+
61+ android_test_actions = gen_lava_android_test_actions(test_plans)
62+ actions = [
63+ {
64 "command": "deploy_linaro_android_image",
65 "parameters":
66 {
67@@ -53,28 +79,35 @@
68 },
69 "metadata":
70 {
71- "android.name": job_name,
72- "android.build": build_number,
73+ "android.name": job_name,
74+ "android.build": '%s' % build_number,
75 "android.url": build_url
76- }
77+ }
78 },
79 {
80 "command": "boot_linaro_android_image"
81 },
82- {
83- "command": test_plan
84- },
85- {
86- "command": "submit_results",
87+]
88+
89+ actions.extend(android_test_actions)
90+
91+ actions.append(
92+ {
93+ "command": "submit_results_on_host",
94 "parameters":
95 {
96- "result_disk": "sdcard",
97- "server": "http://validation.linaro.org/lava-server/dashboard",
98+ "server": "http://validation.linaro.org/lava-server/RPC2/",
99 "stream": test_stream
100 }
101- }
102- ]
103-}, indent=4)
104+ })
105+
106+ config = json.dumps({"job_name": build_url,
107+ "image_type": 'android',
108+ "device_type": test_target,
109+ "timeout": 18000,
110+ "actions":actions
111+ },
112+ indent=4)
113
114 print config
115 lava_user = os.environ.get("LAVA_USER")

Subscribers

People subscribed via source and target branches