Bug 1280637 - Implement autospider.py --nobuild for running tests on existing build, r=terrence
authorSteve Fink <sfink@mozilla.com>
Wed, 13 Jul 2016 18:46:02 -0700
changeset 330689 be79f9b6ecc4a46ccff6c0d65d797d1b8bf17325
parent 330688 bc11f3fed0a55bbcb5ca84f4d0fb4b81a94a8dda
child 330690 9b4a6326df6eaeb8cfbae6bdf7ef034b651b5918
push id9858
push userjlund@mozilla.com
push dateMon, 01 Aug 2016 14:37:10 +0000
treeherdermozilla-aurora@203106ef6cb6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersterrence
bugs1280637
milestone50.0a1
Bug 1280637 - Implement autospider.py --nobuild for running tests on existing build, r=terrence MozReview-Commit-ID: 9D4fT6TKa6b
js/src/devtools/automation/autospider.py
--- a/js/src/devtools/automation/autospider.py
+++ b/js/src/devtools/automation/autospider.py
@@ -50,16 +50,18 @@ parser.add_argument('--run-tests', '--te
                     default='',
                     help="comma-separated set of test suites to add to the variant's default set")
 parser.add_argument('--skip-tests', '--skip', type=str, metavar='TESTSUITE',
                     default='',
                     help="comma-separated set of test suites to remove from the variant's default set")
 parser.add_argument('--build-only', '--build',
                     dest='skip_tests', action='store_const', const='all',
                     help="only do a build, do not run any tests")
+parser.add_argument('--nobuild', action='store_true',
+                    help='Do not do a build. Rerun tests on existing build.')
 parser.add_argument('variant', type=str,
                     help='type of job requested, see variants/ subdir')
 args = parser.parse_args()
 
 
 def set_vars_from_script(script, vars):
     '''Run a shell script, then dump out chosen environment variables. The build
        system uses shell scripts to do some configuration that we need to
@@ -131,20 +133,21 @@ with open(os.path.join(DIR.scripts, "var
 if args.variant == 'nonunified':
     # Rewrite js/src/**/moz.build to replace UNIFIED_SOURCES to SOURCES.
     # Note that this modifies the current checkout.
     for dirpath, dirnames, filenames in os.walk(DIR.js_src):
         if 'moz.build' in filenames:
             subprocess.check_call(['sed', '-i', 's/UNIFIED_SOURCES/SOURCES/',
                                    os.path.join(dirpath, 'moz.build')])
 
-autoconfs = ['autoconf-2.13', 'autoconf2.13', 'autoconf213']
-if call_alternates(autoconfs, [], cwd=DIR.js_src) != 0:
-    logging.error('autoconf failed')
-    sys.exit(1)
+if not args.nobuild:
+    autoconfs = ['autoconf-2.13', 'autoconf2.13', 'autoconf213']
+    if call_alternates(autoconfs, [], cwd=DIR.js_src) != 0:
+        logging.error('autoconf failed')
+        sys.exit(1)
 
 OBJDIR = os.path.join(DIR.source, args.objdir)
 OUTDIR = os.path.join(OBJDIR, "out")
 POBJDIR = posixpath.join(PDIR.source, args.objdir)
 AUTOMATION = env.get('AUTOMATION', False)
 MAKE = env.get('MAKE', 'make')
 MAKEFLAGS = env.get('MAKEFLAGS', '-j6')
 CONFIGURE_ARGS = variant['configure-args']
@@ -232,17 +235,17 @@ def killall():
     for proc in ACTIVE_PROCESSES:
         proc.kill()
     ACTIVE_PROCESSES.clear()
 
 timer = Timer(args.timeout, killall)
 timer.daemon = True
 timer.start()
 
-ensure_dir_exists(OBJDIR, clobber=not args.dep)
+ensure_dir_exists(OBJDIR, clobber=not args.dep and not args.nobuild)
 ensure_dir_exists(OUTDIR)
 
 
 def run_command(command, check=False, **kwargs):
     proc = Popen(command, cwd=OBJDIR, **kwargs)
     ACTIVE_PROCESSES.add(proc)
     stdout, stderr = None, None
     try:
@@ -259,21 +262,22 @@ def run_command(command, check=False, **
 for k, v in variant.get('env', {}).items():
     env[k] = v.format(
         DIR=DIR.scripts,
         TOOLTOOL_CHECKOUT=DIR.tooltool,
         MOZ_UPLOAD_DIR=env['MOZ_UPLOAD_DIR'],
         OUTDIR=OUTDIR,
     )
 
-CONFIGURE_ARGS += ' --enable-nspr-build'
-CONFIGURE_ARGS += ' --prefix={OBJDIR}/dist'.format(OBJDIR=POBJDIR)
-run_command(['sh', '-c', posixpath.join(PDIR.js_src, 'configure') + ' ' + CONFIGURE_ARGS], check=True)
+if not args.nobuild:
+    CONFIGURE_ARGS += ' --enable-nspr-build'
+    CONFIGURE_ARGS += ' --prefix={OBJDIR}/dist'.format(OBJDIR=POBJDIR)
+    run_command(['sh', '-c', posixpath.join(PDIR.js_src, 'configure') + ' ' + CONFIGURE_ARGS], check=True)
 
-run_command('%s -s -w %s' % (MAKE, MAKEFLAGS), shell=True, check=True)
+    run_command('%s -s -w %s' % (MAKE, MAKEFLAGS), shell=True, check=True)
 
 COMMAND_PREFIX = []
 # On Linux, disable ASLR to make shell builds a bit more reproducible.
 if subprocess.call("type setarch >/dev/null 2>&1", shell=True) == 0:
     COMMAND_PREFIX.extend(['setarch', UNAME_M, '-R'])
 
 
 def run_test_command(command, **kwargs):