Bug 1462489 - Use test addons from dist/xpi-stage when running mochitests locally. r=ahal

MozReview-Commit-ID: IoaxxjtJLhX

--HG--
extra : rebase_source : 39c461649eca73f104b7f7954aa9420048818d58
This commit is contained in:
Chris Manchester 2018-05-30 15:21:39 -07:00
Родитель a5459b456c
Коммит 4690df6ce9
2 изменённых файлов: 23 добавлений и 12 удалений

Просмотреть файл

@ -753,7 +753,18 @@ class MochitestArguments(ArgumentContainer):
options.testingModulesDir = p
break
# Paths to specialpowers and mochijar from the tests zip.
options.stagedAddons = [
os.path.join(here, 'extensions', 'specialpowers'),
os.path.join(here, 'mochijar'),
]
if build_obj:
objdir_xpi_stage = os.path.join(build_obj.distdir, 'xpi-stage')
if os.path.isdir(objdir_xpi_stage):
options.stagedAddons = [
os.path.join(objdir_xpi_stage, 'specialpowers'),
os.path.join(objdir_xpi_stage, 'mochijar'),
]
plugins_dir = os.path.join(build_obj.distdir, 'plugins')
if os.path.isdir(plugins_dir) and plugins_dir not in options.extraProfileFiles:
options.extraProfileFiles.append(plugins_dir)

Просмотреть файл

@ -838,7 +838,6 @@ class MochitestDesktop(object):
Mochitest class for desktop firefox.
"""
oldcwd = os.getcwd()
mochijar = os.path.join(SCRIPT_DIR, 'mochijar')
# Path to the test script on the server
TEST_PATH = "tests"
@ -856,9 +855,10 @@ class MochitestDesktop(object):
# TODO: replace this with 'runtests.py' or 'mochitest' or the like
test_name = 'automation.py'
def __init__(self, flavor, logger_options, quiet=False):
def __init__(self, flavor, logger_options, staged_addons=None, quiet=False):
update_mozinfo()
self.flavor = flavor
self.staged_addons = staged_addons
self.server = None
self.wsserver = None
self.websocketProcessBridge = None
@ -1321,11 +1321,6 @@ toolbar#nav-bar {
manifest = self.writeChromeManifest(options)
if not os.path.isdir(self.mochijar):
self.log.error(
"TEST-UNEXPECTED-FAIL | invalid setup: missing mochikit extension")
return None
return manifest
def getExtensionsToInstall(self, options):
@ -2258,10 +2253,14 @@ toolbar#nav-bar {
# install specialpowers and mochikit addons
addons = Addons(self.marionette)
addons.install(create_zip(
os.path.join(here, 'extensions', 'specialpowers')
))
addons.install(create_zip(self.mochijar))
if self.staged_addons:
for addon_path in self.staged_addons:
if not os.path.isdir(addon_path):
self.log.error(
"TEST-UNEXPECTED-FAIL | invalid setup: missing extension at %s" %
addon_path)
return 1, self.lastTestSeen
addons.install(create_zip(addon_path))
self.execute_start_script()
@ -3066,7 +3065,8 @@ def run_test_harness(parser, options):
key: value for key, value in vars(options).iteritems()
if key.startswith('log') or key == 'valgrind'}
runner = MochitestDesktop(options.flavor, logger_options, quiet=options.quiet)
runner = MochitestDesktop(options.flavor, logger_options, options.stagedAddons,
quiet=options.quiet)
if hasattr(options, 'log'):
delattr(options, 'log')