Merge lp:~doanac/phablet-tools/click-x86 into lp:phablet-tools

Proposed by Andy Doan
Status: Merged
Approved by: Sergio Schvezov
Approved revision: 273
Merged at revision: 272
Proposed branch: lp:~doanac/phablet-tools/click-x86
Merge into: lp:phablet-tools
Diff against target: 55 lines (+18/-7)
1 file modified
phablet-click-test-setup (+18/-7)
To merge this branch: bzr merge lp:~doanac/phablet-tools/click-x86
Reviewer Review Type Date Requested Status
Sergio Schvezov Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+219438@code.launchpad.net

Commit message

support click setup on x86 emulator

We have different packaging names for x86 emulator. This adds
the ability to do an arch specific package lookup.

Description of the change

Fixes phablet-click-test-setup when targeting the x86 emulator

To post a comment you must log in.
lp:~doanac/phablet-tools/click-x86 updated
272. By Andy Doan

support click setup on x86 emulator

We have different packaging names for x86 emulator. This adds
the ability to do an arch specific package lookup.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Sergio Schvezov (sergiusens) wrote :

How about using 'adb shell dpkg --print-architecture's result as another key entry to lookup in the map? Just in case we add some other arch sooner than later

review: Needs Information
Revision history for this message
Sergio Schvezov (sergiusens) wrote :

or maybe just do a 'binary': () tuple or [] and iterate over it until one is found

Revision history for this message
Andy Doan (doanac) wrote :

On 05/14/2014 09:39 AM, Sergio Schvezov wrote:
> How about using 'adb shell dpkg --print-architecture's result as another key entry to lookup in the map? Just in case we add some other arch sooner than later

can you elaborate? I'm not sure I understand what you are saying here.

Revision history for this message
Sergio Schvezov (sergiusens) wrote :

> On 05/14/2014 09:39 AM, Sergio Schvezov wrote:
> > How about using 'adb shell dpkg --print-architecture's result as another key
> entry to lookup in the map? Just in case we add some other arch sooner than
> later
>
> can you elaborate? I'm not sure I understand what you are saying here.

I guess I was too sleepy when I commented on this :-/

    arch = adb.shell('dpkg --print-architecture').strip()

But instead of constructing the 'key' from appending two strings, a map from the arches seems cleaner:

basic_packages = (
    {'source': 'unity8', 'binary': 'unity8'},
    {'source': 'ubuntu-ui-toolkit',
     'binary': {'armhf': 'qtdeclarative5-ubuntu-ui-toolkit-plugin',
                'i386': 'qtdeclarative5-ubuntu-ui-toolkit-plugin-gles'})

But this is just a hassle for the case where they are the same, so this could work:

basic_packages = (
    {'source': 'unity8', 'binary': {'all': 'unity8'}},
    {'source': 'ubuntu-ui-toolkit',
     'binary': {'armhf': 'qtdeclarative5-ubuntu-ui-toolkit-plugin',
                'i386': 'qtdeclarative5-ubuntu-ui-toolkit-plugin-gles'}})

then when looping over basic_packages just

binary = p['binary'][arch] if arch in p['binary'] else p['binary']['all']

or something like that

lp:~doanac/phablet-tools/click-x86 updated
273. By Andy Doan <email address hidden>

improve arch handling in click-setup

as per sergio

Revision history for this message
Andy Doan (doanac) wrote :

Sergio - nice idea. revno 273 should be close to your suggestion.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Sergio Schvezov (sergiusens) wrote :

> Sergio - nice idea. revno 273 should be close to your suggestion.

thanks, looks good!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'phablet-click-test-setup'
2--- phablet-click-test-setup 2014-02-24 14:01:06 +0000
3+++ phablet-click-test-setup 2014-05-14 20:13:26 +0000
4@@ -61,13 +61,22 @@
5 py2_subdir = 'legacy-py2'
6
7 basic_packages = (
8- {'source': 'unity8', 'binary': 'unity8'},
9- {'source': 'ubuntu-ui-toolkit',
10- 'binary': 'qtdeclarative5-ubuntu-ui-toolkit-plugin'})
11+ {
12+ 'source': 'unity8',
13+ 'binary': {'all': 'unity8'}
14+ },
15+ {
16+ 'source': 'ubuntu-ui-toolkit',
17+ 'binary': {
18+ 'armhf': 'qtdeclarative5-ubuntu-ui-toolkit-plugin',
19+ 'i386': 'qtdeclarative5-ubuntu-ui-toolkit-plugin-gles'
20+ }
21+ }
22+)
23
24 python_packages = (
25 'python-mock', 'python-dateutil', 'python3-dateutil'
26- )
27+)
28
29
30 class UbuntuDevice(AndroidBridge):
31@@ -193,11 +202,13 @@
32 shutil.move(test_dir, target_dir)
33
34
35-def fetch_test_base(adb, test_dir):
36+def fetch_test_base(adb, test_dir, arch):
37 for package in python_packages:
38 get_python_binary_package(package, test_dir)
39 for package in basic_packages:
40- version = adb.get_package_version(package['binary'])
41+ binaries = package['binary']
42+ binary = binaries[arch] if arch in binaries else binaries['all']
43+ version = adb.get_package_version(binary)
44 get_source_package_tests(package['source'], version, test_dir)
45
46
47@@ -230,7 +241,7 @@
48 test_dir = tempfile.mkdtemp()
49 os.mkdir(os.path.join(test_dir, py2_subdir))
50 atexit.register(cleanup, test_dir)
51- fetch_test_base(adb, test_dir)
52+ fetch_test_base(adb, test_dir, arch)
53 fetch_click_tests(adb, test_dir, args.user, args.click)
54 destination = path.join('/home', args.user, 'autopilot')
55 if args.wipe:

Subscribers

People subscribed via source and target branches