Bug 1359988 - Remove gaia scripts and configs from mozharness; r=mshal

Firefox OS is dead.

MozReview-Commit-ID: CWX04cHHT7u

--HG--
extra : rebase_source : b455f916a4b673aad265d57560cf5e272a1740ca
This commit is contained in:
Gregory Szorc 2017-04-26 13:54:09 -07:00
parent a463bb4c4c
commit a873e406bd
6 changed files with 0 additions and 486 deletions

View File

@ -1,42 +0,0 @@
#!/usr/bin/env python
config = {
"log_name": "gaia_bump",
"log_max_rotate": 99,
"ssh_key": "~/.ssh/id_rsa",
"ssh_user": "asasaki@mozilla.com",
"hg_user": "Test Pusher <aki@escapewindow.com>",
"revision_file": "b2g/config/gaia.json",
"exes": {
# Get around the https warnings
"hg": ['hg', "--config", "web.cacerts=/etc/pki/tls/certs/ca-bundle.crt"],
},
"repo_list": [{
"polling_url": "https://hg.mozilla.org/integration/gaia-central/json-pushes?full=1",
"branch": "default",
"repo_url": "https://hg.mozilla.org/integration/gaia-central",
"repo_name": "gaia-central",
"target_push_url": "ssh://hg.mozilla.org/users/asasaki_mozilla.com/birch",
"target_pull_url": "https://hg.mozilla.org/users/asasaki_mozilla.com/birch",
"target_tag": "default",
"target_repo_name": "birch",
}, {
"polling_url": "https://hg.mozilla.org/integration/gaia-1_2/json-pushes?full=1",
"branch": "default",
"repo_url": "https://hg.mozilla.org/integration/gaia-1_2",
"repo_name": "gaia-1_2",
"target_push_url": "ssh://hg.mozilla.org/users/asasaki_mozilla.com/mozilla-aurora",
"target_pull_url": "https://hg.mozilla.org/users/asasaki_mozilla.com/mozilla-aurora",
"target_tag": "default",
"target_repo_name": "mozilla-aurora",
}, {
"polling_url": "https://hg.mozilla.org/integration/gaia-1_2/json-pushes?full=1",
"branch": "default",
"repo_url": "https://hg.mozilla.org/integration/gaia-1_2",
"repo_name": "gaia-1_2",
"target_push_url": "ssh://hg.mozilla.org/users/asasaki_mozilla.com/mozilla-aurora",
"target_pull_url": "https://hg.mozilla.org/users/asasaki_mozilla.com/mozilla-aurora",
"target_tag": "default",
"target_repo_name": "mozilla-aurora",
}],
}

View File

@ -1,56 +0,0 @@
#!/usr/bin/env python
# ***** 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 os
import sys
# load modules from parent dir
sys.path.insert(1, os.path.dirname(sys.path[0]))
from mozharness.mozilla.testing.gaia_test import GaiaTest
from mozharness.mozilla.testing.unittest import TestSummaryOutputParserHelper
class GaiaBuildIntegrationTest(GaiaTest):
def __init__(self, require_config_file=False):
GaiaTest.__init__(self, require_config_file)
def run_tests(self):
"""
Run the integration test suite.
"""
dirs = self.query_abs_dirs()
self.node_setup()
output_parser = TestSummaryOutputParserHelper(
config=self.config, log_obj=self.log_obj, error_list=self.error_list)
cmd = [
'make',
'build-test-integration',
'REPORTER=mocha-tbpl-reporter',
'NODE_MODULES_SRC=npm-cache',
'VIRTUALENV_EXISTS=1',
'TRY_ENV=1'
]
# for Mulet
if 'firefox' in self.binary_path:
cmd += ['RUNTIME=%s' % self.binary_path]
code = self.run_command(cmd, cwd=dirs['abs_gaia_dir'],
output_parser=output_parser,
output_timeout=600)
output_parser.print_summary('gaia-build-integration-tests')
self.publish(code)
if __name__ == '__main__':
gaia_build_integration_test = GaiaBuildIntegrationTest()
gaia_build_integration_test.run_and_exit()

View File

@ -1,56 +0,0 @@
#!/usr/bin/env python
# ***** 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 os
import sys
# load modules from parent dir
sys.path.insert(1, os.path.dirname(sys.path[0]))
from mozharness.mozilla.testing.gaia_test import GaiaTest
from mozharness.mozilla.testing.unittest import TestSummaryOutputParserHelper
class GaiaBuildUnitTest(GaiaTest):
def __init__(self, require_config_file=False):
GaiaTest.__init__(self, require_config_file)
def run_tests(self):
"""
Run the gaia build unit test suite.
"""
dirs = self.query_abs_dirs()
self.node_setup()
output_parser = TestSummaryOutputParserHelper(
config=self.config, log_obj=self.log_obj, error_list=self.error_list)
cmd = [
'make',
'build-test-unit',
'REPORTER=mocha-tbpl-reporter',
'NODE_MODULES_SRC=npm-cache',
'VIRTUALENV_EXISTS=1',
'TRY_ENV=1'
]
# for Mulet
if 'firefox' in self.binary_path:
cmd += ['RUNTIME=%s' % self.binary_path]
code = self.run_command(cmd, cwd=dirs['abs_gaia_dir'],
output_parser=output_parser,
output_timeout=330)
output_parser.print_summary('gaia-build-unit-tests')
self.publish(code)
if __name__ == '__main__':
gaia_build_unit_test = GaiaBuildUnitTest()
gaia_build_unit_test.run_and_exit()

View File

@ -1,75 +0,0 @@
#!/usr/bin/env python
# ***** 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 os
import sys
# load modules from parent dir
sys.path.insert(1, os.path.dirname(sys.path[0]))
from mozharness.mozilla.testing.gaia_test import GaiaTest
from mozharness.mozilla.testing.unittest import TestSummaryOutputParserHelper
class GaiaIntegrationTest(GaiaTest):
def __init__(self, require_config_file=False):
GaiaTest.__init__(self, require_config_file)
def run_tests(self):
"""
Run the integration test suite.
"""
dirs = self.query_abs_dirs()
self.node_setup()
output_parser = TestSummaryOutputParserHelper(
config=self.config, log_obj=self.log_obj, error_list=self.error_list)
# Bug 1046694 - add environment variables which govern test chunking
env = {}
if self.config.get('this_chunk') and self.config.get('total_chunks'):
env["PART"] = self.config.get('this_chunk')
env["NBPARTS"] = self.config.get('total_chunks')
env = self.query_env(partial_env=env)
# Bug 1137884 - marionette-js-runner needs to know about virtualenv
gaia_runner_service = (
dirs['abs_gaia_dir'] +
'/node_modules/marionette-js-runner/host/python/runner-service')
# Check whether python package is around since there exist versions
# of gaia that depend on versions of marionette-js-runner without
# the python stuff.
if os.path.exists(gaia_runner_service):
self.install_module('gaia-runner-service', gaia_runner_service)
env['VIRTUALENV_PATH'] = self.query_virtualenv_path()
env['HOST_LOG'] = os.path.join(dirs['abs_log_dir'], 'gecko_output.log')
cmd = [
'make',
'test-integration',
'REPORTER=mocha-tbpl-reporter',
'TEST_MANIFEST=./shared/test/integration/tbpl-manifest.json',
'NODE_MODULE_SRC=npm-cache',
'VIRTUALENV_EXISTS=1'
]
# for Mulet
if 'firefox' in self.binary_path:
cmd += ['RUNTIME=%s' % self.binary_path]
code = self.run_command(cmd, cwd=dirs['abs_gaia_dir'], env=env,
output_parser=output_parser,
output_timeout=330)
output_parser.print_summary('gaia-integration-tests')
self.publish(code, passed=output_parser.passed, failed=output_parser.failed)
if __name__ == '__main__':
gaia_integration_test = GaiaIntegrationTest()
gaia_integration_test.run_and_exit()

View File

@ -1,148 +0,0 @@
#!/usr/bin/env python
# ***** 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 os
import re
import sys
# load modules from parent dir
sys.path.insert(1, os.path.dirname(sys.path[0]))
from mozharness.base.log import OutputParser, ERROR
from mozharness.mozilla.testing.gaia_test import GaiaTest
class GaiaLinterOutputParser(OutputParser):
JSHINT_START = "Running jshint..."
JSHINT_DONE = "xfailed)"
JSHINT_ERROR = re.compile('(.+): (.*?) \(ERROR\)')
LAST_FILE = re.compile('----- FILE : (.*?) -----')
GJSLINT_START = "Running gjslint..."
GJSLINT_ERROR = re.compile('Line (\d+), E:(\d+):')
GENERAL_ERRORS = (re.compile('make(.*?)\*\*\*(.*?)Error'),)
def __init__(self, **kwargs):
self.base_dir = kwargs.pop('base_dir')
super(GaiaLinterOutputParser, self).__init__(**kwargs)
self.in_jshint = False
self.in_gjslint = False
self.last_file = 'unknown'
def log_error(self, message, filename=None):
if not filename:
self.log('TEST-UNEXPECTED-FAIL | make lint | %s' % message)
else:
path = filename
if self.base_dir in path:
path = os.path.relpath(filename, self.base_dir)
self.log('TEST-UNEXPECTED-FAIL | %s | %s' % (path, message),
level=ERROR)
self.num_errors += 1
self.worst_log_level = self.worst_level(ERROR,
self.worst_log_level)
def parse_single_line(self, line):
if not self.in_jshint:
if self.JSHINT_START in line:
self.in_jshint = True
self.in_gjslint = False
else:
if self.JSHINT_DONE in line:
self.in_jshint = False
if not self.in_gjslint:
if self.GJSLINT_START in line:
self.in_gjslint = True
if self.in_jshint:
m = self.JSHINT_ERROR.search(line)
if m:
self.log_error(m.groups()[1], m.groups()[0])
if self.in_gjslint:
m = self.LAST_FILE.search(line)
if m:
self.last_file = m.groups()[0]
m = self.GJSLINT_ERROR.search(line)
if m:
self.log_error(line, self.last_file)
for an_error in self.GENERAL_ERRORS:
if an_error.search(line):
self.log_error(line)
if self.log_output:
self.info(' %s' % line)
def evaluate_parser(self):
# generate the TinderboxPrint line for TBPL
if self.num_errors:
self.tsummary = '<em class="testfail">%d errors</em>' % self.num_errors
else:
self.tsummary = "0 errors"
def print_summary(self, suite_name):
self.evaluate_parser()
self.info("TinderboxPrint: %s: %s\n" % (suite_name, self.tsummary))
class GaiaIntegrationTest(GaiaTest):
virtualenv_modules = ['closure_linter==2.3.13',
'python-gflags',
]
def __init__(self, require_config_file=False):
GaiaTest.__init__(self, require_config_file)
def run_tests(self):
"""
Run the integration test suite.
"""
dirs = self.query_abs_dirs()
# Copy the b2g desktop we built to the gaia directory so that it
# gets used by the marionette-js-runner.
self.copytree(
os.path.join(os.path.dirname(self.binary_path)),
os.path.join(dirs['abs_gaia_dir'], 'b2g'),
overwrite='clobber'
)
cmd = [
'make',
'lint',
'NODE_MODULES_SRC=npm-cache',
'VIRTUALENV_EXISTS=1'
]
# for Mulet
if 'firefox' in self.binary_path:
cmd += ['RUNTIME=%s' % self.binary_path]
self.make_node_modules()
output_parser = GaiaLinterOutputParser(
base_dir=dirs['abs_gaia_dir'],
config=self.config,
log_obj=self.log_obj)
code = self.run_command(cmd, cwd=dirs['abs_gaia_dir'],
output_parser=output_parser,
output_timeout=600)
output_parser.print_summary('gaia-lint')
self.publish(code)
if __name__ == '__main__':
gaia_integration_test = GaiaIntegrationTest()
gaia_integration_test.run_and_exit()

View File

@ -1,109 +0,0 @@
#!/usr/bin/env python
# ***** 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 os
import sys
import glob
import subprocess
import json
# load modules from parent dir
sys.path.insert(1, os.path.dirname(sys.path[0]))
from mozharness.mozilla.testing.gaia_test import GaiaTest
from mozharness.mozilla.testing.unittest import TestSummaryOutputParserHelper
class GaiaUnitTest(GaiaTest):
def __init__(self, require_config_file=False):
GaiaTest.__init__(self, require_config_file)
def pull(self, **kwargs):
GaiaTest.pull(self, **kwargs)
def run_tests(self):
"""
Run the unit test suite.
"""
dirs = self.query_abs_dirs()
self.make_node_modules()
# make the gaia profile
self.make_gaia(dirs['abs_gaia_dir'],
self.config.get('xre_path'),
xre_url=self.config.get('xre_url'),
debug=True)
# build the testrunner command arguments
python = self.query_python_path('python')
cmd = [python, '-u', os.path.join(dirs['abs_runner_dir'],
'gaia_unit_test',
'main.py')]
executable = 'firefox'
if 'b2g' in self.binary_path:
executable = 'b2g-bin'
profile = os.path.join(dirs['abs_gaia_dir'], 'profile-debug')
binary = os.path.join(os.path.dirname(self.binary_path), executable)
cmd.extend(self._build_arg('--binary', binary))
cmd.extend(self._build_arg('--profile', profile))
cmd.extend(self._build_arg('--symbols-path', self.symbols_path))
cmd.extend(self._build_arg('--browser-arg', self.config.get('browser_arg')))
# Add support for chunking
if self.config.get('total_chunks') and self.config.get('this_chunk'):
chunker = [ os.path.join(dirs['abs_gaia_dir'], 'bin', 'chunk'),
self.config.get('total_chunks'), self.config.get('this_chunk') ]
disabled_tests = []
disabled_manifest = os.path.join(dirs['abs_runner_dir'],
'gaia_unit_test',
'disabled.json')
with open(disabled_manifest, 'r') as m:
try:
disabled_tests = json.loads(m.read())
except:
print "Error while decoding disabled.json; please make sure this file has valid JSON syntax."
sys.exit(1)
# Construct a list of all tests
unit_tests = []
for path in ('apps', 'tv_apps'):
test_root = os.path.join(dirs['abs_gaia_dir'], path)
full_paths = glob.glob(os.path.join(test_root, '*/test/unit/*_test.js'))
unit_tests += map(lambda x: os.path.relpath(x, test_root), full_paths)
# Remove the tests that are disabled
active_unit_tests = filter(lambda x: x not in disabled_tests, unit_tests)
# Chunk the list as requested
tests_to_run = subprocess.check_output(chunker + active_unit_tests).strip().split(' ')
cmd.extend(tests_to_run)
output_parser = TestSummaryOutputParserHelper(config=self.config,
log_obj=self.log_obj,
error_list=self.error_list)
upload_dir = self.query_abs_dirs()['abs_blob_upload_dir']
if not os.path.isdir(upload_dir):
self.mkdir_p(upload_dir)
env = self.query_env()
env['MOZ_UPLOAD_DIR'] = upload_dir
# I don't like this output_timeout hardcode, but bug 920153
code = self.run_command(cmd, env=env,
output_parser=output_parser,
output_timeout=1760)
output_parser.print_summary('gaia-unit-tests')
self.publish(code)
if __name__ == '__main__':
gaia_unit_test = GaiaUnitTest()
gaia_unit_test.run_and_exit()