deleted file mode 100644
--- a/testing/mozharness/configs/marionette/automation_emulator_config.py
+++ /dev/null
@@ -1,124 +0,0 @@
-# This is a template config file for marionette production.
-# TODO: This could be removed after B2G ICS emulator buildbot builds is turned
-# off, Bug 1209180.
-import os
-
-
-HG_SHARE_BASE_DIR = "/builds/hg-shared"
-
-config = {
- # marionette options
- "emulator": "arm",
- "tooltool_cache": "/builds/tooltool_cache",
- "test_manifest": "unit-tests.ini",
-
- "vcs_share_base": HG_SHARE_BASE_DIR,
- "exes": {
- 'python': '/tools/buildbot/bin/python',
- 'virtualenv': ['/tools/buildbot/bin/python', '/tools/misc-python/virtualenv.py'],
- 'tooltool.py': "/tools/tooltool.py",
- },
-
- "find_links": [
- "http://pypi.pvt.build.mozilla.org/pub",
- "http://pypi.pub.build.mozilla.org/pub",
- ],
- "pip_index": False,
-
- "buildbot_json_path": "buildprops.json",
-
- "default_actions": [
- 'clobber',
- 'read-buildbot-config',
- 'download-and-extract',
- 'create-virtualenv',
- 'install',
- 'run-tests',
- ],
- "download_symbols": "ondemand",
- "download_minidump_stackwalk": True,
- "default_blob_upload_servers": [
- "https://blobupload.elasticbeanstalk.com",
- ],
- "blob_uploader_auth_file": os.path.join(os.getcwd(), "oauth.txt"),
- "suite_definitions": {
- "gaiatest_desktop": {
- "options": [
- "--restart",
- "--timeout=%(timeout)s",
- "--testvars=%(testvars)s",
- "--profile=%(profile)s",
- "--symbols-path=%(symbols_path)s",
- "--gecko-log=%(gecko_log)s",
- "--log-xunit=%(xml_output)s",
- "--html-output=%(html_output)s",
- "--log-raw=%(raw_log_file)s",
- "--log-errorsummary=%(error_summary_file)s",
- "--binary=%(binary)s",
- "--address=%(address)s",
- "--total-chunks=%(total_chunks)s",
- "--this-chunk=%(this_chunk)s"
- ],
- "run_filename": "",
- "testsdir": ""
- },
- "gaiatest_emulator": {
- "options": [
- "--restart",
- "--timeout=%(timeout)s",
- "--testvars=%(testvars)s",
- "--profile=%(profile)s",
- "--symbols-path=%(symbols_path)s",
- "--log-xunit=%(xml_output)s",
- "--html-output=%(html_output)s",
- "--log-raw=%(raw_log_file)s",
- "--log-errorsummary=%(error_summary_file)s",
- "--logcat-dir=%(logcat_dir)s",
- "--emulator=%(emulator)s",
- "--homedir=%(homedir)s"
- ],
- "run_filename": "",
- "testsdir": ""
- },
- "marionette_desktop": {
- "options": [
- "--log-raw=%(raw_log_file)s",
- "--log-errorsummary=%(error_summary_file)s",
- "--binary=%(binary)s",
- "--address=%(address)s",
- "--symbols-path=%(symbols_path)s"
- ],
- "run_filename": "",
- "testsdir": ""
- },
- "marionette_emulator": {
- "options": [
- "--log-raw=%(raw_log_file)s",
- "--log-errorsummary=%(error_summary_file)s",
- "--logcat-dir=%(logcat_dir)s",
- "--emulator=%(emulator)s",
- "--homedir=%(homedir)s",
- "--symbols-path=%(symbols_path)s"
- ],
- "run_filename": "",
- "testsdir": ""
- },
- "webapi_desktop": {
- "options": [],
- "run_filename": "",
- "testsdir": ""
- },
- "webapi_emulator": {
- "options": [
- "--log-raw=%(raw_log_file)s",
- "--log-errorsummary=%(error_summary_file)s",
- "--symbols-path=%(symbols_path)s",
- "--logcat-dir=%(logcat_dir)s",
- "--emulator=%(emulator)s",
- "--homedir=%(homedir)s"
- ],
- "run_filename": "",
- "testsdir": ""
- },
- },
-}
deleted file mode 100644
--- a/testing/mozharness/configs/marionette/gaia_ui_test_emu_config.py
+++ /dev/null
@@ -1,7 +0,0 @@
-# This is a config file for gaiatest on emulators; it's meant to be used
-# with the primary gaia-ui-test config file.
-
-config = {
- 'update_files': False,
- 'emulator': 'arm',
-}
deleted file mode 100644
--- a/testing/mozharness/configs/marionette/gaia_ui_test_prod_config.py
+++ /dev/null
@@ -1,132 +0,0 @@
-# This is a template config file for marionette production.
-import os
-import platform
-
-
-HG_SHARE_BASE_DIR = "/builds/hg-shared"
-
-if platform.system().lower() == 'darwin':
- xre_url = "https://api.pub.build.mozilla.org/tooltool/sha512/4d8d7a37d90c34a2a2fda3066a8fe85c189b183d05389cb957fc6fed31f10a6924e50c1b84488ff61c015293803f58a3aed5d4819374d04c8e0ee2b9e3997278"
-else:
- xre_url = "https://api.pub.build.mozilla.org/tooltool/sha512/dc9503b21c87b5a469118746f99e4f41d73888972ce735fa10a80f6d218086da0e3da525d9a4cd8e4ea497ec199fef720e4a525873d77a1af304ac505e076462"
-
-config = {
- # marionette options
- "marionette_address": "localhost:2828",
- "gaiatest": True,
- "xre_url": xre_url,
- "application": "b2g",
-
- "vcs_share_base": HG_SHARE_BASE_DIR,
- "exes": {
- 'python': '/tools/buildbot/bin/python',
- 'virtualenv': ['/tools/buildbot/bin/python', '/tools/misc-python/virtualenv.py'],
- 'tooltool.py': "/tools/tooltool.py",
- },
-
- "find_links": [
- "http://pypi.pvt.build.mozilla.org/pub",
- "http://pypi.pub.build.mozilla.org/pub",
- ],
- "pip_index": False,
-
- "buildbot_json_path": "buildprops.json",
-
- "default_actions": [
- 'clobber',
- 'read-buildbot-config',
- 'pull',
- 'download-and-extract',
- 'create-virtualenv',
- 'install',
- 'run-tests',
- ],
- "download_symbols": "ondemand",
- "download_minidump_stackwalk": True,
- "default_blob_upload_servers": [
- "https://blobupload.elasticbeanstalk.com",
- ],
- "blob_uploader_auth_file": os.path.join(os.getcwd(), "oauth.txt"),
- "vcs_output_timeout": 1760,
- "tooltool_cache": "/builds/tooltool_cache",
- "suite_definitions": {
- "gaiatest_desktop": {
- "options": [
- "--restart",
- "--timeout=%(timeout)s",
- "--testvars=%(testvars)s",
- "--profile=%(profile)s",
- "--symbols-path=%(symbols_path)s",
- "--gecko-log=%(gecko_log)s",
- "--log-xunit=%(xml_output)s",
- "--html-output=%(html_output)s",
- "--log-raw=%(raw_log_file)s",
- "--log-errorsummary=%(error_summary_file)s",
- "--binary=%(binary)s",
- "--address=%(address)s",
- "--total-chunks=%(total_chunks)s",
- "--this-chunk=%(this_chunk)s"
- ],
- "run_filename": "",
- "testsdir": ""
- },
- "gaiatest_emulator": {
- "options": [
- "--restart",
- "--timeout=%(timeout)s",
- "--testvars=%(testvars)s",
- "--profile=%(profile)s",
- "--symbols-path=%(symbols_path)s",
- "--log-xunit=%(xml_output)s",
- "--html-output=%(html_output)s",
- "--log-raw=%(raw_log_file)s",
- "--log-errorsummary=%(error_summary_file)s",
- "--logcat-dir=%(logcat_dir)s",
- "--emulator=%(emulator)s",
- "--homedir=%(homedir)s"
- ],
- "run_filename": "",
- "testsdir": ""
- },
- "marionette_desktop": {
- "options": [
- "--log-raw=%(raw_log_file)s",
- "--log-errorsummary=%(error_summary_file)s",
- "--binary=%(binary)s",
- "--address=%(address)s",
- "--symbols-path=%(symbols_path)s"
- ],
- "run_filename": "",
- "testsdir": ""
- },
- "marionette_emulator": {
- "options": [
- "--log-raw=%(raw_log_file)s",
- "--log-errorsummary=%(error_summary_file)s",
- "--logcat-dir=%(logcat_dir)s",
- "--emulator=%(emulator)s",
- "--homedir=%(homedir)s",
- "--symbols-path=%(symbols_path)s"
- ],
- "run_filename": "",
- "testsdir": ""
- },
- "webapi_desktop": {
- "options": [],
- "run_filename": "",
- "testsdir": ""
- },
- "webapi_emulator": {
- "options": [
- "--log-raw=%(raw_log_file)s",
- "--log-errorsummary=%(error_summary_file)s",
- "--symbols-path=%(symbols_path)s",
- "--logcat-dir=%(logcat_dir)s",
- "--emulator=%(emulator)s",
- "--homedir=%(homedir)s"
- ],
- "run_filename": "",
- "testsdir": ""
- }
- },
-}
--- a/testing/mozharness/configs/marionette/prod_config.py
+++ b/testing/mozharness/configs/marionette/prod_config.py
@@ -34,90 +34,23 @@ config = {
"default_blob_upload_servers": [
"https://blobupload.elasticbeanstalk.com",
],
"blob_uploader_auth_file" : os.path.join(os.getcwd(), "oauth.txt"),
"download_symbols": "ondemand",
"download_minidump_stackwalk": True,
"tooltool_cache": "/builds/tooltool_cache",
"suite_definitions": {
- "gaiatest_desktop": {
- "options": [
- "--restart",
- "--timeout=%(timeout)s",
- "--testvars=%(testvars)s",
- "--profile=%(profile)s",
- "--symbols-path=%(symbols_path)s",
- "--gecko-log=%(gecko_log)s",
- "--log-xunit=%(xml_output)s",
- "--html-output=%(html_output)s",
- "--log-raw=%(raw_log_file)s",
- "--log-errorsummary=%(error_summary_file)s",
- "--binary=%(binary)s",
- "--address=%(address)s",
- "--total-chunks=%(total_chunks)s",
- "--this-chunk=%(this_chunk)s"
- ],
- "run_filename": "",
- "testsdir": ""
- },
- "gaiatest_emulator": {
- "options": [
- "--restart",
- "--timeout=%(timeout)s",
- "--testvars=%(testvars)s",
- "--profile=%(profile)s",
- "--symbols-path=%(symbols_path)s",
- "--log-xunit=%(xml_output)s",
- "--html-output=%(html_output)s",
- "--log-raw=%(raw_log_file)s",
- "--log-errorsummary=%(error_summary_file)s",
- "--logcat-dir=%(logcat_dir)s",
- "--emulator=%(emulator)s",
- "--homedir=%(homedir)s"
- ],
- "run_filename": "",
- "testsdir": ""
- },
"marionette_desktop": {
"options": [
"-vv",
"--log-raw=%(raw_log_file)s",
"--log-errorsummary=%(error_summary_file)s",
"--binary=%(binary)s",
"--address=%(address)s",
"--symbols-path=%(symbols_path)s"
],
"run_filename": "",
"testsdir": ""
- },
- "marionette_emulator": {
- "options": [
- "--log-raw=%(raw_log_file)s",
- "--log-errorsummary=%(error_summary_file)s",
- "--logcat-dir=%(logcat_dir)s",
- "--emulator=%(emulator)s",
- "--homedir=%(homedir)s",
- "--symbols-path=%(symbols_path)s"
- ],
- "run_filename": "",
- "testsdir": ""
- },
- "webapi_desktop": {
- "options": [],
- "run_filename": "",
- "testsdir": ""
- },
- "webapi_emulator": {
- "options": [
- "--log-raw=%(raw_log_file)s",
- "--log-errorsummary=%(error_summary_file)s",
- "--symbols-path=%(symbols_path)s",
- "--logcat-dir=%(logcat_dir)s",
- "--emulator=%(emulator)s",
- "--homedir=%(homedir)s"
- ],
- "run_filename": "",
- "testsdir": ""
}
},
"structured_output": True,
}
--- a/testing/mozharness/configs/marionette/test_config.py
+++ b/testing/mozharness/configs/marionette/test_config.py
@@ -8,88 +8,21 @@ config = {
"default_actions": [
'clobber',
'download-and-extract',
'create-virtualenv',
'install',
'run-tests',
],
"suite_definitions": {
- "gaiatest_desktop": {
- "options": [
- "--restart",
- "--timeout=%(timeout)s",
- "--testvars=%(testvars)s",
- "--profile=%(profile)s",
- "--symbols-path=%(symbols_path)s",
- "--gecko-log=%(gecko_log)s",
- "--log-xunit=%(xml_output)s",
- "--html-output=%(html_output)s",
- "--log-raw=%(raw_log_file)s",
- "--log-errorsummary=%(error_summary_file)s",
- "--binary=%(binary)s",
- "--address=%(address)s",
- "--total-chunks=%(total_chunks)s",
- "--this-chunk=%(this_chunk)s"
- ],
- "run_filename": "",
- "testsdir": ""
- },
- "gaiatest_emulator": {
- "options": [
- "--restart",
- "--timeout=%(timeout)s",
- "--testvars=%(testvars)s",
- "--profile=%(profile)s",
- "--symbols-path=%(symbols_path)s",
- "--log-xunit=%(xml_output)s",
- "--html-output=%(html_output)s",
- "--log-raw=%(raw_log_file)s",
- "--log-errorsummary=%(error_summary_file)s",
- "--logcat-dir=%(logcat_dir)s",
- "--emulator=%(emulator)s",
- "--homedir=%(homedir)s"
- ],
- "run_filename": "",
- "testsdir": ""
- },
"marionette_desktop": {
"options": [
"--log-raw=%(raw_log_file)s",
"--log-errorsummary=%(error_summary_file)s",
"--binary=%(binary)s",
"--address=%(address)s",
"--symbols-path=%(symbols_path)s"
],
"run_filename": "",
"testsdir": ""
},
- "marionette_emulator": {
- "options": [
- "--log-raw=%(raw_log_file)s",
- "--log-errorsummary=%(error_summary_file)s",
- "--logcat-dir=%(logcat_dir)s",
- "--emulator=%(emulator)s",
- "--homedir=%(homedir)s",
- "--symbols-path=%(symbols_path)s"
- ],
- "run_filename": "",
- "testsdir": ""
- },
- "webapi_desktop": {
- "options": [],
- "run_filename": "",
- "testsdir": ""
- },
- "webapi_emulator": {
- "options": [
- "--log-raw=%(raw_log_file)s",
- "--log-errorsummary=%(error_summary_file)s",
- "--symbols-path=%(symbols_path)s",
- "--logcat-dir=%(logcat_dir)s",
- "--emulator=%(emulator)s",
- "--homedir=%(homedir)s"
- ],
- "run_filename": "",
- "testsdir": ""
- }
},
}
--- a/testing/mozharness/configs/marionette/windows_config.py
+++ b/testing/mozharness/configs/marionette/windows_config.py
@@ -36,88 +36,21 @@ config = {
],
"default_blob_upload_servers": [
"https://blobupload.elasticbeanstalk.com",
],
"blob_uploader_auth_file" : os.path.join(os.getcwd(), "oauth.txt"),
"download_minidump_stackwalk": True,
"download_symbols": "ondemand",
"suite_definitions": {
- "gaiatest_desktop": {
- "options": [
- "--restart",
- "--timeout=%(timeout)s",
- "--testvars=%(testvars)s",
- "--profile=%(profile)s",
- "--symbols-path=%(symbols_path)s",
- "--gecko-log=%(gecko_log)s",
- "--log-xunit=%(xml_output)s",
- "--html-output=%(html_output)s",
- "--log-raw=%(raw_log_file)s",
- "--log-errorsummary=%(error_summary_file)s",
- "--binary=%(binary)s",
- "--address=%(address)s",
- "--total-chunks=%(total_chunks)s",
- "--this-chunk=%(this_chunk)s"
- ],
- "run_filename": "",
- "testsdir": ""
- },
- "gaiatest_emulator": {
- "options": [
- "--restart",
- "--timeout=%(timeout)s",
- "--testvars=%(testvars)s",
- "--profile=%(profile)s",
- "--symbols-path=%(symbols_path)s",
- "--log-xunit=%(xml_output)s",
- "--html-output=%(html_output)s",
- "--log-raw=%(raw_log_file)s",
- "--log-errorsummary=%(error_summary_file)s",
- "--logcat-dir=%(logcat_dir)s",
- "--emulator=%(emulator)s",
- "--homedir=%(homedir)s"
- ],
- "run_filename": "",
- "testsdir": ""
- },
"marionette_desktop": {
"options": [
"--log-raw=%(raw_log_file)s",
"--log-errorsummary=%(error_summary_file)s",
"--binary=%(binary)s",
"--address=%(address)s",
"--symbols-path=%(symbols_path)s"
],
"run_filename": "",
"testsdir": ""
},
- "marionette_emulator": {
- "options": [
- "--log-raw=%(raw_log_file)s",
- "--log-errorsummary=%(error_summary_file)s",
- "--logcat-dir=%(logcat_dir)s",
- "--emulator=%(emulator)s",
- "--homedir=%(homedir)s",
- "--symbols-path=%(symbols_path)s"
- ],
- "run_filename": "",
- "testsdir": ""
- },
- "webapi_desktop": {
- "options": [],
- "run_filename": "",
- "testsdir": ""
- },
- "webapi_emulator": {
- "options": [
- "--log-raw=%(raw_log_file)s",
- "--log-errorsummary=%(error_summary_file)s",
- "--symbols-path=%(symbols_path)s",
- "--logcat-dir=%(logcat_dir)s",
- "--emulator=%(emulator)s",
- "--homedir=%(homedir)s"
- ],
- "run_filename": "",
- "testsdir": ""
- }
},
}
--- a/testing/mozharness/configs/marionette/windows_taskcluster_config.py
+++ b/testing/mozharness/configs/marionette/windows_taskcluster_config.py
@@ -35,88 +35,21 @@ config = {
],
"default_blob_upload_servers": [
"https://blobupload.elasticbeanstalk.com",
],
"blob_uploader_auth_file" : 'C:/builds/oauth.txt',
"download_minidump_stackwalk": True,
"download_symbols": "ondemand",
"suite_definitions": {
- "gaiatest_desktop": {
- "options": [
- "--restart",
- "--timeout=%(timeout)s",
- "--testvars=%(testvars)s",
- "--profile=%(profile)s",
- "--symbols-path=%(symbols_path)s",
- "--gecko-log=%(gecko_log)s",
- "--log-xunit=%(xml_output)s",
- "--html-output=%(html_output)s",
- "--log-raw=%(raw_log_file)s",
- "--log-errorsummary=%(error_summary_file)s",
- "--binary=%(binary)s",
- "--address=%(address)s",
- "--total-chunks=%(total_chunks)s",
- "--this-chunk=%(this_chunk)s"
- ],
- "run_filename": "",
- "testsdir": ""
- },
- "gaiatest_emulator": {
- "options": [
- "--restart",
- "--timeout=%(timeout)s",
- "--testvars=%(testvars)s",
- "--profile=%(profile)s",
- "--symbols-path=%(symbols_path)s",
- "--log-xunit=%(xml_output)s",
- "--html-output=%(html_output)s",
- "--log-raw=%(raw_log_file)s",
- "--log-errorsummary=%(error_summary_file)s",
- "--logcat-dir=%(logcat_dir)s",
- "--emulator=%(emulator)s",
- "--homedir=%(homedir)s"
- ],
- "run_filename": "",
- "testsdir": ""
- },
"marionette_desktop": {
"options": [
"--log-raw=%(raw_log_file)s",
"--log-errorsummary=%(error_summary_file)s",
"--binary=%(binary)s",
"--address=%(address)s",
"--symbols-path=%(symbols_path)s"
],
"run_filename": "",
"testsdir": ""
},
- "marionette_emulator": {
- "options": [
- "--log-raw=%(raw_log_file)s",
- "--log-errorsummary=%(error_summary_file)s",
- "--logcat-dir=%(logcat_dir)s",
- "--emulator=%(emulator)s",
- "--homedir=%(homedir)s",
- "--symbols-path=%(symbols_path)s"
- ],
- "run_filename": "",
- "testsdir": ""
- },
- "webapi_desktop": {
- "options": [],
- "run_filename": "",
- "testsdir": ""
- },
- "webapi_emulator": {
- "options": [
- "--log-raw=%(raw_log_file)s",
- "--log-errorsummary=%(error_summary_file)s",
- "--symbols-path=%(symbols_path)s",
- "--logcat-dir=%(logcat_dir)s",
- "--emulator=%(emulator)s",
- "--homedir=%(homedir)s"
- ],
- "run_filename": "",
- "testsdir": ""
- }
},
}
--- a/testing/mozharness/mozharness/base/script.py
+++ b/testing/mozharness/mozharness/base/script.py
@@ -485,18 +485,17 @@ class ScriptMixin(PlatformMixin):
except socket.timeout, e:
self.warning("Timed out accessing %s: %s" % (url, str(e)))
raise
except socket.error, e:
self.warning("Socket error when accessing %s: %s" % (url, str(e)))
raise
def _retry_download(self, url, error_level, file_name=None, retry_config=None):
- """ Helper method to retry download methods
- Split out so we can alter the retry logic in mozharness.mozilla.testing.gaia_test.
+ """ Helper method to retry download methods.
This method calls `self.retry` on `self._download_file` using the passed
parameters if a file_name is specified. If no file is specified, we will
instead call `self._urlopen`, which grabs the contents of a url but does
not create a file on disk.
Args:
url (str): URL path where the file is located.
deleted file mode 100644
--- a/testing/mozharness/mozharness/mozilla/gaia.py
+++ /dev/null
@@ -1,428 +0,0 @@
-"""
-Module for performing gaia-specific tasks
-"""
-
-import json
-import os
-import re
-
-from mozharness.base.errors import HgErrorList, BaseErrorList, TarErrorList, \
- ZipErrorList
-from mozharness.base.log import ERROR, FATAL
-
-gaia_config_options = [
- [["--gaia-dir"],
- {"action": "store",
- "dest": "gaia_dir",
- "help": "directory where gaia repo should be cloned"
- }],
- [["--gaia-repo"],
- {"action": "store",
- "dest": "gaia_repo",
- "help": "url of gaia repo to clone"
- }],
- [["--gaia-branch"],
- {"action": "store",
- "dest": "gaia_branch",
- "default": "default",
- "help": "branch of gaia repo to clone"
- }],
-]
-
-class GaiaMixin(object):
-
- npm_error_list = BaseErrorList + [
- {'substr': r'''npm ERR! Error:''', 'level': ERROR}
- ]
-
- # This requires self to inherit a VCSMixin.
- def clone_gaia(self, dest, repo, use_gaia_json=False):
- """
- Clones an hg mirror of gaia.
-
- repo: a dict containing 'repo_path', 'revision', and optionally
- 'branch' parameters
- use_gaia_json: if True, the repo parameter is used to retrieve
- a gaia.json file from a gecko repo, which in turn is used to
- clone gaia; if False, repo represents a gaia repo to clone.
- """
-
- repo_path = repo.get('repo_path')
- revision = repo.get('revision')
- branch = repo.get('branch')
- gaia_json_path = self.config.get("gaia_json_path", "{repo_path}/raw-file/{revision}/b2g/config/gaia.json")
- git = False
- pr_git_revision = None
- pr_remote = None
-
- self.info('dest: %s' % dest)
-
- if use_gaia_json:
- url = gaia_json_path.format(
- repo_path=repo_path,
- revision=revision)
- contents = self.retry(self.load_json_from_url, args=(url,))
- if contents.get('git') and contents['git'].get('remote'):
- git = True
- remote = contents['git']['remote']
- branch = contents['git'].get('branch')
- revision = contents['git'].get('git_revision')
- pr_git_revision = contents['git'].get('pr_git_revision')
- pr_remote = contents['git'].get('pr_remote')
- if pr_remote or pr_git_revision:
- if not (pr_remote and pr_git_revision):
- self.fatal('Pull request mode requres rev *and* remote')
- if not (branch or revision):
- self.fatal('Must specify branch or revision for git repo')
- elif contents.get('repo_path') and contents.get('revision'):
- repo_path = 'https://hg.mozilla.org/%s' % contents['repo_path']
- revision = contents['revision']
- branch = None
-
- if git:
- git_cmd = self.query_exe('git')
- needs_clobber = True
-
- # For pull requests, we only want to clobber when we can't find the
- # two exact commit ids that we'll be working with. As long as we
- # have those two commits, we don't care about the rest of the repo
- def has_needed_commit(commit, fatal=False):
- cmd = [git_cmd, 'rev-parse', '--quiet', '--verify', '%s^{commit}' % commit]
- rc = self.run_command(cmd, cwd=dest, halt_on_failure=False, success_codes=[1,0])
- if rc != 0:
- return False
- return True
-
- if not pr_remote and os.path.exists(dest) and os.path.exists(os.path.join(dest, '.git')):
- cmd = [git_cmd, 'remote', '-v']
- output = self.get_output_from_command(cmd, cwd=dest)
- for line in output:
- if remote in line:
- needs_clobber = False
-
-
- # We want to do some cleanup logic differently for pull requests
- if pr_git_revision and pr_remote:
- needs_clobber = False
- if os.path.exists(dest) and os.path.exists(os.path.join(dest, '.git')):
- cmd = [git_cmd, 'clean', '-f', '-f', '-x', '-d']
- self.run_command(cmd, cwd=dest, halt_on_failure=True,
- fatal_exit_code=3)
- if not has_needed_commit(revision):
- cmd = [git_cmd, 'fetch', 'origin']
- self.run_command(cmd, cwd=dest, halt_on_failure=True,
- fatal_exit_code=3)
- if not has_needed_commit(revision):
- self.warn('Repository does not contain required revisions, clobbering')
- needs_clobber = True
-
- # In pull request mode, we don't want to clone because we're satisfied
- # that the base directory is good enough because
- needs_clone = True
- if pr_git_revision and pr_remote:
- if os.path.exists(dest):
- if os.path.exists(os.path.join(dest, '.git')):
- needs_clone = False
- else:
- needs_clobber = True
-
- if needs_clobber:
- self.rmtree(dest)
- needs_clone = True
-
- if needs_clone:
- # git clone
- cmd = [git_cmd,
- 'clone',
- remote]
- self.run_command(cmd,
- cwd=os.path.dirname(dest),
- output_timeout=1760,
- halt_on_failure=True,
- fatal_exit_code=3)
-
- self.run_command([git_cmd, 'status'], cwd=dest);
-
-
- # handle pull request magic
- if pr_git_revision and pr_remote:
- # Optimization opportunity: instead of fetching all remote references,
- # pull only the single commit. I don't know how to right now
-
- # If the 'other' remote exists, get rid of it
- cmd = [git_cmd, 'remote']
- output = self.get_output_from_command(cmd, cwd=dest)
- for line in output.split('\n'):
- if 'other' in line:
- cmd = [git_cmd, 'remote', 'rm', 'other']
- self.run_command(cmd, cwd=dest, halt_on_failure=True,
- fatal_exit_code=3)
- break;
- # Set the correct remote
- cmd = [git_cmd, 'remote', 'add', 'other', pr_remote]
- self.run_command(cmd, cwd=dest, halt_on_failure=True,
- fatal_exit_code=3)
- if not has_needed_commit(pr_git_revision):
- cmd = [git_cmd, 'fetch', 'other']
- self.run_command(cmd, cwd=dest, halt_on_failure=True,
- fatal_exit_code=3)
- if not has_needed_commit(pr_git_revision):
- self.fatal('Missing the Pull Request target revision')
-
- # With these environment variables we should have deterministic
- # merge commit identifiers
- self.info('If you want to prove that this merge commit is the same')
- self.info('you get, use this environment while doing the merge')
- env = {
- 'GIT_COMMITTER_DATE': "Wed Feb 16 14:00 2037 +0100",
- 'GIT_AUTHOR_DATE': "Wed Feb 16 14:00 2037 +0100",
- 'GIT_AUTHOR_NAME': 'automation',
- 'GIT_AUTHOR_EMAIL': 'auto@mati.on',
- 'GIT_COMMITTER_NAME': 'automation',
- 'GIT_COMMITTER_EMAIL': 'auto@mati.on'
- }
- cmd = [git_cmd, 'reset', '--hard', revision or branch]
- self.run_command(cmd, cwd=dest, halt_on_failure=True,
- fatal_exit_code=3)
- cmd = [git_cmd, 'clean', '-f', '-f', '-x', '-d']
- self.run_command(cmd, cwd=dest, halt_on_failure=True,
- fatal_exit_code=3)
- cmd = [git_cmd, 'merge', '--no-ff', pr_git_revision]
- self.run_command(cmd, cwd=dest, env=env, halt_on_failure=True,
- fatal_exit_code=3)
- # So that people can verify that their merge commit is identical
- cmd = [git_cmd, 'rev-parse', 'HEAD']
- self.run_command(cmd, cwd=dest, halt_on_failure=True,
- fatal_exit_code=3)
-
- else:
- # checkout git branch
- cmd = [git_cmd,
- 'checkout',
- revision or branch]
- self.run_command(cmd, cwd=dest, halt_on_failure=True,
- fatal_exit_code=3)
-
-
- # verify
- for cmd in ([git_cmd, 'rev-parse', 'HEAD'], [git_cmd, 'branch']):
- self.run_command(cmd, cwd=dest, halt_on_failure=True,
- fatal_exit_code=3)
-
- else:
- # purge the repo if it already exists
- if os.path.exists(dest):
- if os.path.exists(os.path.join(dest, '.hg')):
- # this is an hg dir, so do an hg clone
- cmd = [self.query_exe('hg'),
- '--config',
- 'extensions.purge=',
- 'purge']
- if self.run_command(cmd, cwd=dest, error_list=HgErrorList):
- self.fatal("Unable to purge %s!" % dest)
- else:
- # there's something here, but it isn't hg; just delete it
- self.rmtree(dest)
-
- repo = {
- 'repo': repo_path,
- 'revision': revision,
- 'branch': branch,
- 'dest': dest,
- }
-
- self.vcs_checkout_repos([repo], parent_dir=os.path.dirname(dest))
-
- def preflight_pull(self):
- if not self.buildbot_config:
- if not self.config.get('gaia_repo'):
- # gaia_branch by default is set to default
- self.fatal("You're trying to run this outside of buildbot, " \
- "therefore, you need to specify --gaia-repo.")
- if not self.config.get('gaia_branch'):
- # gaia_branch by default is set to default
- self.fatal("You're trying to run this outside of buildbot, " \
- "therefore, you need to specify --gaia-branch.")
-
- def extract_xre(self, xre_url, xre_path=None, parent_dir=None):
- if not xre_path:
- xre_path = self.config.get('xre_path')
- xulrunner_bin = os.path.join(parent_dir,
- xre_path,
- 'bin', 'xpcshell')
- if os.access(xulrunner_bin, os.F_OK):
- return
-
- filename = self.download_file(xre_url, parent_dir=parent_dir)
- m = re.search('\.tar\.(bz2|gz)$', filename)
- if m:
- # a xulrunner archive, which has a top-level 'xulrunner-sdk' dir
- command = self.query_exe('tar', return_type='list')
- tar_cmd = "jxf"
- if m.group(1) == "gz":
- tar_cmd = "zxf"
- command.extend([tar_cmd, filename])
- self.run_command(command,
- cwd=parent_dir,
- error_list=TarErrorList,
- halt_on_failure=True,
- fatal_exit_code=3)
- else:
- # a tooltool xre.zip
- command = self.query_exe('unzip', return_type='list')
- command.extend(['-q', '-o', filename])
- # Gaia assumes that xpcshell is in a 'xulrunner-sdk' dir, but
- # xre.zip doesn't have a top-level directory name, so we'll
- # create it.
- parent_dir = os.path.join(parent_dir,
- self.config.get('xre_path'))
- if not os.access(parent_dir, os.F_OK):
- self.mkdir_p(parent_dir, error_level=FATAL)
- self.run_command(command,
- cwd=parent_dir,
- error_list=ZipErrorList,
- halt_on_failure=True,
- fatal_exit_code=3)
-
- def pull(self, **kwargs):
- '''
- Two ways of using this function:
- - The user specifies --gaia-repo or in a config file
- - The buildbot propeties exist and we query the gaia json url
- for the current gecko tree
- '''
- dirs = self.query_abs_dirs()
- dest = dirs['abs_gaia_dir']
- repo = {}
-
- if self.buildbot_config is not None:
- # get gaia commit via hgweb (gecko's gaia.json)
- repo = {
- 'revision': self.buildbot_config['properties']['revision'],
- 'repo_path': 'https://hg.mozilla.org/%s' % self.buildbot_config['properties']['repo_path'],
- 'branch': None,
- }
- else:
- repo = {
- 'repo_path': self.config['gaia_repo'],
- 'revision': 'default',
- 'branch': self.config['gaia_branch']
- }
-
- self.clone_gaia(dest, repo,
- use_gaia_json=self.buildbot_config is not None)
-
- def make_gaia(self, gaia_dir, xre_dir, debug=False, noftu=True,
- xre_url=None, build_config_path=None):
- if xre_url:
- self.extract_xre(xre_url, xre_path=xre_dir, parent_dir=gaia_dir)
-
- env = {'DEBUG': '1' if debug else '0',
- 'NOFTU': '1' if noftu else '0',
- 'DESKTOP': '0',
- 'DESKTOP_SHIMS': '1',
- 'USE_LOCAL_XULRUNNER_SDK': '1',
- 'XULRUNNER_DIRECTORY': xre_dir
- }
-
- # if tbpl_build_config.json exists, load it
- if build_config_path:
- if os.path.exists(build_config_path):
- with self.opened(build_config_path) as (f, err):
- if err:
- self.fatal("Error while reading %s, aborting" %
- build_config_path)
- else:
- contents = f.read()
- config = json.loads(contents)
- env.update(config.get('env', {}))
-
- self.info('Sending environment as make vars because of bug 1028816')
-
- cmd = self.query_exe('make', return_type="list")
- for key, value in env.iteritems():
- cmd.append('%s=%s' % (key, value))
- self.run_command(cmd,
- cwd=gaia_dir,
- halt_on_failure=True)
-
- def make_node_modules(self):
-
- dirs = self.query_abs_dirs()
-
- def cleanup_node_modules():
- node_dir = os.path.join(dirs['abs_gaia_dir'], 'node_modules')
- self.rmtree(node_dir)
-
- self.run_command(['npm', 'cache', 'clean'])
-
- # get the node modules first from the node module cache, if this fails it will
- # install the node modules from npmjs.org.
- cmd = ['taskcluster-npm-cache-get',
- '--namespace',
- 'gaia.npm_cache',
- 'package.json']
- kwargs = {
- 'output_timeout': 300
- }
- code = self.retry(self.run_command, attempts=3, good_statuses=(0,),
- args=[cmd, dirs['abs_gaia_dir']], cleanup=cleanup_node_modules, kwargs=kwargs)
- if code:
- self.fatal('Error occurred fetching node modules from cache',
- exit_code=code)
-
- # run 'make node_modules' second, so we can separately handle
- # errors that occur here
- cmd = ['make',
- 'node_modules',
- 'NODE_MODULES_SRC=npm-cache',
- 'VIRTUALENV_EXISTS=1']
- kwargs = {
- 'output_timeout': 300,
- 'error_list': self.npm_error_list
- }
- code = self.retry(self.run_command, attempts=3, good_statuses=(0,),
- args=[cmd, dirs['abs_gaia_dir']], cleanup=cleanup_node_modules, kwargs=kwargs)
- if code:
- # Dump npm-debug.log, if it exists
- npm_debug = os.path.join(dirs['abs_gaia_dir'], 'npm-debug.log')
- if os.access(npm_debug, os.F_OK):
- self.info('dumping npm-debug.log')
- self.run_command(['cat', npm_debug])
- else:
- self.info('npm-debug.log doesn\'t exist, not dumping')
- self.fatal('Errors during \'npm install\'', exit_code=code)
-
- cmd = ['make',
- 'update-common']
- kwargs = {
- 'output_timeout': 300
- }
- code = self.retry(self.run_command, attempts=3, good_statuses=(0,),
- args=[cmd, dirs['abs_gaia_dir']], kwargs=kwargs)
- if code:
- self.fatal('Errors during make update-common')
-
- def node_setup(self):
- """
- Set up environment for node-based Gaia tests.
- """
- dirs = self.query_abs_dirs()
-
- # Set-up node modules for project first. They must be older than
- # the b2g build we copy into place. Otherwise the b2g build will
- # be considered an out of date target and we don't want that! It
- # can cause our desired b2g-desktop build to be overwritten!
- self.make_node_modules()
-
- # Copy the b2g desktop we built to the gaia directory so that it
- # gets used by the marionette-js-runner.
- b2g_dest = os.path.join(dirs['abs_gaia_dir'], 'b2g')
- self.copytree(
- os.path.join(os.path.dirname(self.binary_path)),
- b2g_dest,
- overwrite='clobber'
- )
- # Ensure modified time is more recent than node_modules!
- self.run_command(['touch', '-c', b2g_dest])
-
deleted file mode 100644
--- a/testing/mozharness/mozharness/mozilla/testing/gaia_test.py
+++ /dev/null
@@ -1,234 +0,0 @@
-# ***** BEGIN LICENSE BLOCK *****
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this file,
-# You can obtain one at http://mozilla.org/MPL/2.0/.
-# ***** END LICENSE BLOCK *****
-
-import copy
-import os
-import sys
-import time
-
-# load modules from parent dir
-sys.path.insert(1, os.path.dirname(os.path.dirname(sys.path[0])))
-
-from mozharness.base.log import INFO, ERROR, WARNING, FATAL
-from mozharness.base.script import PreScriptAction
-from mozharness.base.transfer import TransferMixin
-from mozharness.base.vcs.vcsbase import MercurialScript
-from mozharness.mozilla.blob_upload import BlobUploadMixin, blobupload_config_options
-from mozharness.mozilla.buildbot import TBPL_SUCCESS, TBPL_WARNING, TBPL_FAILURE
-from mozharness.mozilla.gaia import GaiaMixin, gaia_config_options
-from mozharness.mozilla.testing.testbase import TestingMixin, testing_config_options
-from mozharness.mozilla.proxxy import Proxxy
-
-
-class GaiaTest(MercurialScript, TestingMixin, BlobUploadMixin, GaiaMixin, TransferMixin):
- config_options = [[
- ["--application"],
- {"action": "store",
- "dest": "application",
- "default": "b2g",
- "help": "application binary name"
- }
- ], [
- ["--browser-arg"],
- {"action": "store",
- "dest": "browser_arg",
- "default": None,
- "help": "optional command-line argument to pass to the browser"
- }
- ], [
- ["--xre-path"],
- {"action": "store",
- "dest": "xre_path",
- "default": "xulrunner-sdk",
- "help": "directory (relative to gaia repo) of xulrunner-sdk"
- }
- ], [
- ["--xre-url"],
- {"action": "store",
- "dest": "xre_url",
- "default": None,
- "help": "url of desktop xre archive"
- }
- ], [
- ["--npm-registry"],
- {"action": "store",
- "dest": "npm_registry",
- "default": "http://npm-mirror.pub.build.mozilla.org",
- "help": "where to go for node packages"
- }
- ], [
- ["--total-chunks"],
- {"action": "store",
- "dest": "total_chunks",
- "help": "Number of total chunks",
- }
- ], [
- ["--this-chunk"],
- {"action": "store",
- "dest": "this_chunk",
- "help": "Number of this chunk",
- }
- ]] + copy.deepcopy(testing_config_options) + \
- copy.deepcopy(blobupload_config_options) + \
- copy.deepcopy(gaia_config_options)
-
- error_list = [
- {'substr': 'FAILED (errors=', 'level': WARNING},
- ]
-
- virtualenv_modules = []
-
- repos = []
-
- def __init__(self, require_config_file=False):
- super(GaiaTest, self).__init__(
- config_options=self.config_options,
- all_actions=['clobber',
- 'read-buildbot-config',
- 'pull',
- 'download-and-extract',
- 'create-virtualenv',
- 'install',
- 'run-tests'],
- default_actions=['clobber',
- 'pull',
- 'download-and-extract',
- 'create-virtualenv',
- 'install',
- 'run-tests'],
- require_config_file=require_config_file,
- config={'virtualenv_modules': self.virtualenv_modules,
- 'repos': self.repos,
- 'require_test_zip': True})
-
- # these are necessary since self.config is read only
- c = self.config
- self.installer_url = c.get('installer_url')
- self.installer_path = c.get('installer_path')
- self.binary_path = c.get('binary_path')
- self.test_url = c.get('test_url')
- self.test_packages_url = c.get('test_packages_url')
-
- def pull(self, **kwargs):
- GaiaMixin.pull(self, **kwargs)
-
- def query_abs_dirs(self):
- if self.abs_dirs:
- return self.abs_dirs
- abs_dirs = super(GaiaTest, self).query_abs_dirs()
- dirs = {}
- gaia_root_dir = self.config.get('gaia_dir')
- if not gaia_root_dir:
- gaia_root_dir = self.config['base_work_dir']
- dirs['abs_gaia_dir'] = os.path.join(gaia_root_dir, 'gaia')
- dirs['abs_runner_dir'] = os.path.join(dirs['abs_gaia_dir'],
- 'tests', 'python', 'gaia-unit-tests')
- dirs['abs_test_install_dir'] = os.path.join(
- abs_dirs['abs_work_dir'], 'tests')
- dirs['abs_blob_upload_dir'] = os.path.join(abs_dirs['abs_work_dir'], 'blobber_upload_dir')
-
- for key in dirs.keys():
- if key not in abs_dirs:
- abs_dirs[key] = dirs[key]
- self.abs_dirs = abs_dirs
- return self.abs_dirs
-
- @PreScriptAction('create-virtualenv')
- def _pre_create_virtualenv(self, action):
-
- dirs = self.query_abs_dirs()
- requirements = os.path.join(dirs['abs_test_install_dir'],
- 'config',
- 'mozbase_requirements.txt')
- if os.access(requirements, os.F_OK):
- self.register_virtualenv_module(requirements=[requirements],
- two_pass=True)
- else:
- self.fatal('mozbase_requirements.txt not found!')
-
- self.register_virtualenv_module(
- 'gaia-unit-tests', url=dirs['abs_runner_dir'])
-
- def _build_arg(self, option, value):
- """
- Build a command line argument
- """
- if not value:
- return []
- return [str(option), str(value)]
-
- def _query_proxxy(self):
- if not self.proxxy:
- # we don't have a proxxy object. Create it.
- # By default, Proxxy accepts a full configuration looks for the
- # 'proxxy' element. If 'proxxy' is not defined it uses PROXXY_CONFIG
- # For GaiaTest, if there's no proxxy element, don't use a proxxy at
- # all. To do this we must pass a special configuraion
- proxxy_conf = {'proxxy': self.config.get('proxxy', {})}
- proxxy = Proxxy(proxxy_conf, self.log_obj)
- self.proxxy = proxxy
- return self.proxxy
-
- def _retry_download(self, url, file_name, error_level=FATAL, retry_config=None):
- if self.config.get("bypass_download_cache"):
- n = 0
- # ignore retry_config in this case
- max_attempts = 5
- sleeptime = 60
-
- while n < max_attempts:
- n += 1
- try:
- _url = "%s?rand=%s" % (url, time.strftime("%Y%m%d%H%M%S"))
- self.info("Trying %s..." % _url)
- status = self._download_file(_url, file_name)
- return status
- except Exception:
- if n >= max_attempts:
- self.log("Can't download from %s to %s!" % (url, file_name),
- level=error_level, exit_code=3)
- return None
- self.info("Sleeping %s before retrying..." % sleeptime)
- time.sleep(sleeptime)
- else:
- # Since we're overwritting _retry_download() we can't call download_file() directly
- return super(GaiaTest, self)._retry_download(
- url=url, file_name=file_name, error_level=error_level, retry_config=retry_config,
- )
-
- def run_tests(self):
- """
- Run the test suite.
- """
- pass
-
- def publish(self, code, passed=None, failed=None):
- """
- Publish the results of the test suite.
- """
- if code == 0:
- level = INFO
- # We used to check for passed == 0 as well but it can
- # be normal to end up with empty chunks especially when
- # large amounts of tests are disabled.
- if failed > 0:
- status = 'test failures'
- tbpl_status = TBPL_WARNING
- else:
- status = 'success'
- tbpl_status = TBPL_SUCCESS
- elif code == 10:
- level = INFO
- status = 'test failures'
- tbpl_status = TBPL_WARNING
- else:
- level = ERROR
- status = 'harness failures'
- tbpl_status = TBPL_FAILURE
-
- self.log('Tests exited with return code %s: %s' % (code, status),
- level=level)
- self.buildbot_status(tbpl_status)
--- a/testing/mozharness/scripts/marionette.py
+++ b/testing/mozharness/scripts/marionette.py
@@ -14,109 +14,65 @@ import sys
sys.path.insert(1, os.path.dirname(sys.path[0]))
from mozharness.base.errors import TarErrorList
from mozharness.base.log import INFO, ERROR, WARNING
from mozharness.base.script import PreScriptAction
from mozharness.base.transfer import TransferMixin
from mozharness.base.vcs.vcsbase import MercurialScript
from mozharness.mozilla.blob_upload import BlobUploadMixin, blobupload_config_options
-from mozharness.mozilla.gaia import GaiaMixin
from mozharness.mozilla.testing.errors import LogcatErrorList
from mozharness.mozilla.testing.testbase import TestingMixin, testing_config_options
from mozharness.mozilla.testing.unittest import TestSummaryOutputParserHelper
from mozharness.mozilla.structuredlog import StructuredOutputParser
# TODO: we could remove emulator specific code after B2G ICS emulator buildbot
# builds is turned off, Bug 1209180.
-class MarionetteTest(TestingMixin, MercurialScript, BlobUploadMixin, TransferMixin, GaiaMixin):
+class MarionetteTest(TestingMixin, MercurialScript, BlobUploadMixin, TransferMixin):
config_options = [[
["--application"],
{"action": "store",
"dest": "application",
"default": None,
"help": "application name of binary"
}
], [
["--app-arg"],
{"action": "store",
"dest": "app_arg",
"default": None,
"help": "Optional command-line argument to pass to the browser"
}
], [
- ["--gaia-dir"],
- {"action": "store",
- "dest": "gaia_dir",
- "default": None,
- "help": "directory where gaia repo should be cloned"
- }
- ], [
- ["--gaia-repo"],
- {"action": "store",
- "dest": "gaia_repo",
- "default": "https://hg.mozilla.org/integration/gaia-central",
- "help": "url of gaia repo to clone"
- }
- ], [
- ["--gaia-branch"],
- {"action": "store",
- "dest": "gaia_branch",
- "default": "default",
- "help": "branch of gaia repo to clone"
- }
- ], [
["--marionette-address"],
{"action": "store",
"dest": "marionette_address",
"default": None,
"help": "The host:port of the Marionette server running inside Gecko. Unused for emulator testing",
}
], [
["--emulator"],
{"action": "store",
"type": "choice",
"choices": ['arm', 'x86'],
"dest": "emulator",
"default": None,
"help": "Use an emulator for testing",
}
], [
- ["--gaiatest"],
- {"action": "store_true",
- "dest": "gaiatest",
- "default": False,
- "help": "Runs gaia-ui-tests by pulling down the test repo and invoking "
- "gaiatest's runtests.py rather than Marionette's."
- }
- ], [
["--test-manifest"],
{"action": "store",
"dest": "test_manifest",
"default": "unit-tests.ini",
"help": "Path to test manifest to run relative to the Marionette "
"tests directory",
}
], [
- ["--xre-path"],
- {"action": "store",
- "dest": "xre_path",
- "default": "xulrunner-sdk",
- "help": "directory (relative to gaia repo) of xulrunner-sdk"
- }
- ], [
- ["--xre-url"],
- {"action": "store",
- "dest": "xre_url",
- "default": None,
- "help": "url of desktop xre archive"
- }
- ], [
["--total-chunks"],
{"action": "store",
"dest": "total_chunks",
"help": "Number of total chunks",
}
], [
["--this-chunk"],
{"action": "store",
@@ -199,25 +155,17 @@ class MarionetteTest(TestingMixin, Mercu
dirs['abs_test_install_dir'], 'marionette', 'marionette')
dirs['abs_marionette_tests_dir'] = os.path.join(
dirs['abs_test_install_dir'], 'marionette', 'tests', 'testing',
'marionette', 'harness', 'marionette', 'tests')
dirs['abs_gecko_dir'] = os.path.join(
abs_dirs['abs_work_dir'], 'gecko')
dirs['abs_emulator_dir'] = os.path.join(
abs_dirs['abs_work_dir'], 'emulator')
- dirs['abs_b2g-distro_dir'] = os.path.join(
- dirs['abs_emulator_dir'], 'b2g-distro')
- gaia_root_dir = self.config.get('gaia_dir')
- if not gaia_root_dir:
- gaia_root_dir = self.config['base_work_dir']
- dirs['abs_gaia_dir'] = os.path.join(gaia_root_dir, 'gaia')
- dirs['abs_gaiatest_dir'] = os.path.join(
- dirs['abs_gaia_dir'], 'tests', 'python', 'gaia-ui-tests')
dirs['abs_blob_upload_dir'] = os.path.join(abs_dirs['abs_work_dir'], 'blobber_upload_dir')
for key in dirs.keys():
if key not in abs_dirs:
abs_dirs[key] = dirs[key]
self.abs_dirs = abs_dirs
return self.abs_dirs
@@ -242,61 +190,25 @@ class MarionetteTest(TestingMixin, Mercu
'mozcrash', 'mozinstall', 'mozdevice', 'mozprofile',
'mozprocess', 'mozrunner'):
self.register_virtualenv_module(
m, os.path.join(mozbase_dir, m))
self.register_virtualenv_module(
'marionette', os.path.join('tests', 'marionette'))
- if self.config.get('gaiatest'):
- requirements = os.path.join(self.query_abs_dirs()['abs_gaiatest_dir'],
- 'tbpl_requirements.txt')
- self.register_virtualenv_module(
- 'gaia-ui-tests',
- url=self.query_abs_dirs()['abs_gaiatest_dir'],
- method='pip',
- requirements=[requirements],
- editable=True)
-
- def pull(self, **kwargs):
- if self.config.get('gaiatest'):
- # clone the gaia dir
- dirs = self.query_abs_dirs()
- dest = dirs['abs_gaia_dir']
-
- repo = {
- 'repo_path': self.config.get('gaia_repo'),
- 'revision': 'default',
- 'branch': self.config.get('gaia_branch')
- }
-
- if self.buildbot_config is not None:
- # get gaia commit via hgweb
- repo.update({
- 'revision': self.buildbot_config['properties']['revision'],
- 'repo_path': 'https://hg.mozilla.org/%s' % self.buildbot_config['properties']['repo_path']
- })
-
- self.clone_gaia(dest, repo,
- use_gaia_json=self.buildbot_config is not None)
-
- super(MarionetteTest, self).pull(**kwargs)
-
- def _get_options_group(self, is_emulator, is_gaiatest):
+ def _get_options_group(self, is_emulator):
"""
Determine which in tree options group to use and return the
appropriate key.
"""
platform = 'emulator' if is_emulator else 'desktop'
- testsuite = 'gaiatest' if is_gaiatest else 'marionette'
# Currently running marionette on an emulator means webapi
# tests. This method will need to change if this does.
- if is_emulator and not is_gaiatest:
- testsuite = 'webapi'
+ testsuite = 'webapi' if is_emulator else 'marionette'
return '{}_{}'.format(testsuite, platform)
def download_and_extract(self):
super(MarionetteTest, self).download_and_extract()
if self.config.get('emulator'):
dirs = self.query_abs_dirs()
@@ -321,101 +233,54 @@ class MarionetteTest(TestingMixin, Mercu
raw_log_file = os.path.join(dirs['abs_blob_upload_dir'],
'marionette_raw.log')
error_summary_file = os.path.join(dirs['abs_blob_upload_dir'],
'marionette_errorsummary.log')
config_fmt_args = {
# emulator builds require a longer timeout
'timeout': 60000 if self.config.get('emulator') else 10000,
- 'profile': os.path.join(dirs['abs_gaia_dir'], 'profile'),
+ 'profile': os.path.join(dirs['abs_work_dir'], 'profile'),
'xml_output': os.path.join(dirs['abs_work_dir'], 'output.xml'),
'html_output': os.path.join(dirs['abs_blob_upload_dir'], 'output.html'),
'logcat_dir': dirs['abs_work_dir'],
- 'emulator': 'x86' if os.path.isdir(
- os.path.join(dirs['abs_b2g-distro_dir'], 'out',
- 'target', 'product', 'generic_x86')) else 'arm',
+ 'emulator': 'arm',
'symbols_path': self.symbols_path,
- 'homedir': os.path.join(dirs['abs_emulator_dir'], 'b2g-distro'),
'binary': self.binary_path,
'address': self.config.get('marionette_address'),
'raw_log_file': raw_log_file,
'error_summary_file': error_summary_file,
'gecko_log': dirs["abs_blob_upload_dir"],
'this_chunk': self.config.get('this_chunk', 1),
'total_chunks': self.config.get('total_chunks', 1)
}
self.info("The emulator type: %s" % config_fmt_args["emulator"])
# build the marionette command arguments
python = self.query_python_path('python')
- if self.config.get('gaiatest'):
- # make the gaia profile
- build_config = os.path.join(dirs['abs_gaia_dir'], 'tests',
- 'python', 'gaia-ui-tests',
- 'build_config.json')
-
- self.make_gaia(dirs['abs_gaia_dir'],
- self.config.get('xre_path'),
- xre_url=self.config.get('xre_url'),
- debug=False,
- noftu=False,
- build_config_path=build_config)
+ cmd = [python, '-u', os.path.join(dirs['abs_marionette_dir'],
+ 'runtests.py')]
- # write a testvars.json file
- testvars = os.path.join(dirs['abs_gaiatest_dir'],
- 'gaiatest', 'testvars.json')
- with open(testvars, 'w') as f:
- f.write("""{"acknowledged_risks": true,
- "skip_warning": true,
- "settings": {
- "time.timezone": "America/Los_Angeles",
- "time.timezone.user-selected": "America/Los_Angeles"
- }}
- """)
- config_fmt_args['testvars'] = testvars
+ manifest = os.path.join(dirs['abs_marionette_tests_dir'],
+ self.config['test_manifest'])
- # gaia-ui-tests on B2G desktop builds
- cmd = [python, '-u', os.path.join(dirs['abs_gaiatest_dir'],
- 'gaiatest',
- 'cli.py')]
-
- if not self.config.get('emulator'):
- # support desktop builds with and without a built-in profile
- binary_path = os.path.dirname(self.binary_path)
- if os.access(os.path.join(binary_path, 'b2g-bin'), os.F_OK):
- # first, try to find and use b2g-bin
- config_fmt_args['binary'] = os.path.join(binary_path, 'b2g-bin')
- else:
- # if b2g-bin cannot be found we must use just b2g
- config_fmt_args['binary'] = os.path.join(binary_path, 'b2g')
+ if self.config.get('app_arg'):
+ config_fmt_args['app_arg'] = self.config['app_arg']
- else:
- # Marionette or Marionette-webapi tests
- cmd = [python, '-u', os.path.join(dirs['abs_marionette_dir'],
- 'runtests.py')]
-
- manifest = os.path.join(dirs['abs_marionette_tests_dir'],
- self.config['test_manifest'])
+ if not self.config['e10s']:
+ cmd.append('--disable-e10s')
- if self.config.get('app_arg'):
- config_fmt_args['app_arg'] = self.config['app_arg']
-
- if not self.config['e10s']:
- cmd.append('--disable-e10s')
-
- cmd.append('--gecko-log=%s' % os.path.join(dirs["abs_blob_upload_dir"],
- 'gecko.log'))
+ cmd.append('--gecko-log=%s' % os.path.join(dirs["abs_blob_upload_dir"],
+ 'gecko.log'))
if self.config.get("structured_output"):
cmd.append("--log-raw=-")
- options_group = self._get_options_group(self.config.get('emulator'),
- self.config.get('gaiatest'))
+ options_group = self._get_options_group(self.config.get('emulator'))
if options_group not in self.config["suite_definitions"]:
self.fatal("%s is not defined in the config!" % options_group)
for s in self.config["suite_definitions"][options_group]["options"]:
cmd.append(s % config_fmt_args)
if self.mkdir_p(dirs["abs_blob_upload_dir"]) == -1:
@@ -426,19 +291,16 @@ class MarionetteTest(TestingMixin, Mercu
try_options, try_tests = self.try_args("marionette")
cmd.extend(self.query_tests_args(try_tests,
str_format_values=config_fmt_args))
env = {}
if self.query_minidump_stackwalk():
env['MINIDUMP_STACKWALK'] = self.minidump_stackwalk_path
- if self.config.get('gaiatest'):
- env['GAIATEST_ACKNOWLEDGED_RISKS'] = '1'
- env['GAIATEST_SKIP_WARNING'] = '1'
env['MOZ_UPLOAD_DIR'] = self.query_abs_dirs()['abs_blob_upload_dir']
env['MINIDUMP_SAVE_PATH'] = self.query_abs_dirs()['abs_blob_upload_dir']
if self.config['allow_software_gl_layers']:
env['MOZ_LAYERS_ALLOW_SOFTWARE_GL'] = '1'
if not os.path.isdir(env['MOZ_UPLOAD_DIR']):
self.mkdir_p(env['MOZ_UPLOAD_DIR'])