Permalink
Browse files

Seperate out updating apps on phone from updating dashboard

Before we would update the apps from the update-dashboard script, which
resulted in quite a bit of duplicated work (since every dashboard update
entailed running that script once for each test)
  • Loading branch information...
1 parent 9456933 commit 7b77b842fb28acc93d428ca325e3e07469717ffe @wlach wlach committed Jun 12, 2012
Showing with 66 additions and 31 deletions.
  1. +3 −0 bin/run-update-dashboard.sh
  2. +2 −31 bin/update-dashboard.py
  3. +44 −0 bin/update-phone.py
  4. +17 −0 src/eideticker/eideticker/products.py
@@ -20,6 +20,9 @@ cd $EIDETICKER
# I don't know how to make things come back with that enabled by default
#./bin/reboot-device.py
+# Update apps on the phone to the latest
+./bin/update-phone.py
+
for TEST in $TESTS; do
echo "Running $TEST"
./bin/update-dashboard.py --product xul $TEST src/dashboard
@@ -9,34 +9,16 @@
import subprocess
import sys
import time
-import urllib2
import videocapture
import zipfile
+from eideticker.products import default_products
class NestedDict(dict):
def __getitem__(self, key):
if key in self:
return self.get(key)
return self.setdefault(key, NestedDict())
-default_products = [
- {
- "name": "nightly",
- "url": "http://ftp.mozilla.org/pub/mozilla.org/mobile/nightly/latest-mozilla-central-android/fennec-15.0a1.multi.android-arm.apk",
- "appname": "org.mozilla.fennec"
- },
- {
- "name": "xul",
- "url": "http://ftp.mozilla.org/pub/mozilla.org/mobile/releases/latest/android/en-US/fennec-10.0.4esr.en-US.android-arm.apk",
- "appname": "org.mozilla.firefox"
- },
- {
- "name": "stock",
- "url": None,
- "appname": "com.android.browser"
- }
-]
-
default_tests = [
{
'name': 'clock',
@@ -156,9 +138,6 @@ def runtest(dm, product, current_date, appname, appinfo, test, capture_name,
def main(args=sys.argv[1:]):
usage = "usage: %prog [options] <test> <output dir>"
parser = optparse.OptionParser(usage)
- parser.add_option("--no-download",
- action="store_true", dest = "no_download",
- help = "Don't download new versions of the app")
parser.add_option("--product",
action="store", dest="product",
help = "Restrict testing to product (options: %s)" %
@@ -202,16 +181,8 @@ def main(args=sys.argv[1:]):
device = eideticker.device.getDevice(**deviceParams)
for product in products:
- product_fname = os.path.join(DOWNLOAD_DIR, "%s.apk" % product['name'])
-
- if not options.no_download and product.get('url'):
- print "Downloading %s" % product['name']
- dl = urllib2.urlopen(product['url'])
- with open(product_fname, 'w') as f:
- f.write(dl.read())
-
if product.get('url'):
- device.updateApp(product_fname)
+ product_fname = os.path.join(DOWNLOAD_DIR, "%s.apk" % product['name'])
appinfo = get_appinfo(product_fname)
appname = appinfo['appname']
capture_name = "%s %s" % (product['name'], appinfo['date'])
View
@@ -0,0 +1,44 @@
+#!/usr/bin/env python
+
+import eideticker.device
+import optparse
+import os
+import sys
+import urllib2
+from eideticker.products import default_products
+
+DOWNLOAD_DIR = os.path.join(os.path.dirname(__file__), "../downloads")
+
+def main(args=sys.argv[1:]):
+ usage = "usage: %prog [product1] [product2]"
+ parser = optparse.OptionParser(usage)
+ eideticker.device.addDeviceOptionsToParser(parser)
+
+ options, args = parser.parse_args()
+ if len(args):
+ products = [product for product in default_products if product['name'] in args]
+ else:
+ products = default_products
+
+ if not products:
+ print "No products matching arguments!"
+ sys.exit(1)
+
+ print products
+
+ deviceParams = eideticker.device.getDeviceParams(options)
+ device = eideticker.device.getDevice(**deviceParams)
+
+ for product in products:
+ if not product.get('url'):
+ print "No download / installation needed for %s" % product['name']
+ else:
+ print "Downloading %s" % product['name']
+ product_fname = os.path.join(DOWNLOAD_DIR, "%s.apk" % product['name'])
+
+ dl = urllib2.urlopen(product['url'])
+ with open(product_fname, 'w') as f:
+ f.write(dl.read())
+ device.updateApp(product_fname)
+
+main()
@@ -0,0 +1,17 @@
+default_products = [
+ {
+ "name": "nightly",
+ "url": "http://ftp.mozilla.org/pub/mozilla.org/mobile/nightly/latest-mozilla-central-android/fennec-16.0a1.multi.android-arm.apk",
+ "appname": "org.mozilla.fennec"
+ },
+ {
+ "name": "xul",
+ "url": "http://ftp.mozilla.org/pub/mozilla.org/mobile/releases/latest/android/en-US/fennec-10.0.4esr.en-US.android-arm.apk",
+ "appname": "org.mozilla.firefox"
+ },
+ {
+ "name": "stock",
+ "url": None,
+ "appname": "com.android.browser"
+ }
+]

0 comments on commit 7b77b84

Please sign in to comment.