Merge lp:~sergiusens/phablet-tools/emu_prov into lp:phablet-tools

Proposed by Sergio Schvezov
Status: Needs review
Proposed branch: lp:~sergiusens/phablet-tools/emu_prov
Merge into: lp:phablet-tools
Prerequisite: lp:~doanac/phablet-tools/autopilot-args
Diff against target: 80 lines (+27/-4)
3 files modified
click-buddy (+1/-0)
phablet-click-test-setup (+15/-2)
phablet-config (+11/-2)
To merge this branch: bzr merge lp:~sergiusens/phablet-tools/emu_prov
Reviewer Review Type Date Requested Status
Nicholas Skaggs (community) Needs Fixing
PS Jenkins bot continuous-integration Approve
Andy Doan Pending
Ubuntu Phablet Team Pending
Review via email: mp+207440@code.launchpad.net

Commit message

Adding emulator (and future ap) provisioning; in the future this would only work if the tests are py3.

Description of the change

Tested from the branch like
PATH=$PWD:$PATH click-buddy --dir ~/source/apps/clock/trunk --provision
PATH=$PWD:$PATH phablet-test-run -o $(mktemp -d) -f xml ubuntu_clock_app

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Nicholas Skaggs (nskaggs) wrote :

Works fine, but I would like to see a one option added to click-buddy:

1) Support to skip the phablet-config autopilot --setup step; in the case where we already have pulled things, we don't need to do it again. Heck, I'm not even sure the step should be on by default. The first time you run tests from your project it's needed, but after you don't need it. I suppose having it default means it will do the right thing for new folks, but I'd like to be able to skip it at least.. Just makes me want to adb push even more if it takes too long . . .

In addition;

2) Potentially provision and push tests only; don't push the click package. I might want to test using the pre-installed click, but with my newer tests. This is really a corner case, and not important or critical. I wouldn't hold up this merge for it :-)

review: Needs Fixing

Unmerged revisions

244. By Sergio Schvezov

Adding emulator (and future ap) provisioning; in the future this would only work if the tests ar py3.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'click-buddy'
2--- click-buddy 2014-01-20 18:31:52 +0000
3+++ click-buddy 2014-02-20 13:39:04 +0000
4@@ -123,6 +123,7 @@
5 done
6
7 adb $ADBOPTS shell mkdir -p /home/$DEVICE_USER/autopilot
8+ phablet-config autopilot --setup
9 adb $ADBOPTS push $SOURCE/tests/autopilot /home/$DEVICE_USER/autopilot
10 adb $ADBOPTS shell chown -R "$DEVICE_USER":"$DEVICE_USER" /home/$DEVICE_USER/autopilot
11 set +e
12
13=== modified file 'phablet-click-test-setup'
14--- phablet-click-test-setup 2014-02-20 13:39:04 +0000
15+++ phablet-click-test-setup 2014-02-20 13:39:04 +0000
16@@ -101,6 +101,13 @@
17 help='User on device to use')
18 parser.add_argument('--wipe', action='store_true',
19 help='Clean up previous setup on device')
20+ base = parser.add_mutually_exclusive_group()
21+ base.add_argument('--skip-base', action='store_true',
22+ help='''Skips the base setup such as installation of
23+ emulators and autopilot.''')
24+ base.add_argument('--only-base', action='store_true',
25+ help='''Only sets up the base for testing such as the
26+ emulators and autopilot.''')
27 return parser.parse_args()
28
29
30@@ -223,8 +230,14 @@
31 test_dir = tempfile.mkdtemp()
32 os.mkdir(os.path.join(test_dir, py2_subdir))
33 atexit.register(cleanup, test_dir)
34- fetch_test_base(adb, test_dir)
35- fetch_click_tests(adb, test_dir, args.user, args.click)
36+ if args.wipe and args.skip_base:
37+ print('Ignoring request to skip base provisioning as wipe was also '
38+ 'requested')
39+ args.skip_base = False
40+ if not args.skip_base:
41+ fetch_test_base(adb, test_dir)
42+ if not args.only_base:
43+ fetch_click_tests(adb, test_dir, args.user, args.click)
44 destination = path.join('/home', args.user, 'autopilot')
45 if args.wipe:
46 print('Clearing previous test setup in %s' % destination)
47
48=== modified file 'phablet-config'
49--- phablet-config 2013-12-12 23:45:16 +0000
50+++ phablet-config 2014-02-20 13:39:04 +0000
51@@ -104,8 +104,15 @@
52 if args.dbus_probe == 'enable':
53 rfile = '/usr/share/autopilot-touch/apparmor/click.rules'
54 adb.shell('aa-clickhook -f --include=%s' % rfile)
55- else:
56+ elif args.dbus_probe == 'disable':
57 adb.shell('aa-clickhook -f')
58+ elif args.setup:
59+ # TODO replace with better implementation, phablet-click-test-setup
60+ # scheduled to depart
61+ subprocess.check_call(['phablet-click-test-setup', '--only-base'])
62+ else:
63+ print('Use --help for additional information')
64+ exit(1)
65
66
67 def _handle_writable_image(adb, args):
68@@ -213,9 +220,11 @@
69
70 ap = sub.add_parser('autopilot', help='Configure autopilot for device.')
71 ap.add_argument('--dbus-probe', choices=('enable', 'disable'),
72- required=True,
73+ default='None',
74 help='''Allows autopilot the ability to introspect DBUS
75 objects so that tests will work.''')
76+ ap.add_argument('--setup', action='store_true',
77+ help='''Sets up autopilot (not yet) and it's emulators''')
78 ap.set_defaults(func=_handle_autopilot)
79 dm = sub.add_parser('writable-image', help='''Enable read/write access to
80 device partitions and optionally install extra

Subscribers

People subscribed via source and target branches