зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1372051 - Remove external media tests from /testing, /build, /python. r=maja_zf
MozReview-Commit-ID: 7X2kYf7HLZY --HG-- extra : rebase_source : 09421cf96c4d214795362e0f53c51310bff0abba
This commit is contained in:
Родитель
dfec97e376
Коммит
6b2d7e6552
|
@ -28,7 +28,6 @@ mozilla.pth:build/pymake
|
|||
mozilla.pth:config
|
||||
mozilla.pth:dom/bindings
|
||||
mozilla.pth:dom/bindings/parser
|
||||
mozilla.pth:dom/media/test/external
|
||||
mozilla.pth:layout/tools/reftest
|
||||
mozilla.pth:other-licenses/ply/
|
||||
mozilla.pth:taskcluster
|
||||
|
|
|
@ -152,12 +152,6 @@ ARCHIVE_FILES = {
|
|||
'base': 'testing',
|
||||
'pattern': 'firefox-ui/**',
|
||||
},
|
||||
{
|
||||
'source': buildconfig.topsrcdir,
|
||||
'base': 'dom/media/test/external',
|
||||
'pattern': '**',
|
||||
'dest': 'external-media-tests',
|
||||
},
|
||||
{
|
||||
'source': buildconfig.topsrcdir,
|
||||
'base': 'js/src',
|
||||
|
|
|
@ -1,2 +0,0 @@
|
|||
-r marionette_requirements.txt
|
||||
../external-media-tests/
|
|
@ -73,9 +73,6 @@ with Files("config/mozbase_requirements.txt"):
|
|||
with Files("config/firefox_ui_requirements.txt"):
|
||||
BUG_COMPONENT = ("Testing", "Firfox UI Tests")
|
||||
|
||||
with Files("config/external-media-tests-requirements.txt"):
|
||||
BUG_COMPONENT = ("Testing", "external-media-tests")
|
||||
|
||||
with Files("tools/**"):
|
||||
BUG_COMPONENT = ("Testing", "General")
|
||||
|
||||
|
|
|
@ -1,39 +0,0 @@
|
|||
import os
|
||||
import mozharness
|
||||
|
||||
external_tools_path = os.path.join(
|
||||
os.path.abspath(os.path.dirname(os.path.dirname(mozharness.__file__))),
|
||||
'external_tools',
|
||||
)
|
||||
|
||||
config = {
|
||||
"virtualenv_path": 'venv',
|
||||
"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-media-tests',
|
||||
],
|
||||
"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",
|
||||
}
|
|
@ -1,45 +0,0 @@
|
|||
import os
|
||||
import sys
|
||||
import mozharness
|
||||
|
||||
external_tools_path = os.path.join(
|
||||
os.path.abspath(os.path.dirname(os.path.dirname(mozharness.__file__))),
|
||||
'external_tools',
|
||||
)
|
||||
|
||||
config = {
|
||||
"virtualenv_python_dll": 'c:/mozilla-build/python27/python27.dll',
|
||||
"virtualenv_path": 'venv',
|
||||
"exes": {
|
||||
'python': 'c:/mozilla-build/python27/python',
|
||||
'virtualenv': ['c:/mozilla-build/python27/python', 'c:/mozilla-build/buildbotve/virtualenv.py'],
|
||||
'hg': 'c:/mozilla-build/hg/hg',
|
||||
'mozinstall': ['{}/build/venv/scripts/python'.format(os.getcwd()),
|
||||
'{}/build/venv/scripts/mozinstall-script.py'.format(os.getcwd())],
|
||||
'tooltool.py': [sys.executable, 'C:/mozilla-build/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-media-tests',
|
||||
],
|
||||
"default_blob_upload_servers": [
|
||||
"https://blobupload.elasticbeanstalk.com",
|
||||
],
|
||||
"blob_uploader_auth_file" : os.path.join(os.getcwd(), "oauth.txt"),
|
||||
"in_tree_config": "config/mozharness/marionette.py",
|
||||
"download_minidump_stackwalk": True,
|
||||
"download_symbols": "ondemand",
|
||||
}
|
|
@ -1,34 +0,0 @@
|
|||
# Default configuration as used by Mozmill CI (Jenkins)
|
||||
|
||||
import os
|
||||
import platform
|
||||
import sys
|
||||
|
||||
import mozharness
|
||||
|
||||
|
||||
external_tools_path = os.path.join(
|
||||
os.path.abspath(os.path.dirname(os.path.dirname(mozharness.__file__))),
|
||||
'external_tools',
|
||||
)
|
||||
|
||||
config = {
|
||||
# PIP
|
||||
'find_links': ['http://pypi.pub.build.mozilla.org/pub'],
|
||||
'pip_index': False,
|
||||
|
||||
# mozcrash support
|
||||
'download_minidump_stackwalk': True,
|
||||
'download_symbols': 'ondemand',
|
||||
'download_tooltool': True,
|
||||
|
||||
'default_actions': [
|
||||
'clobber',
|
||||
'download-and-extract',
|
||||
'create-virtualenv',
|
||||
'install',
|
||||
'run-media-tests',
|
||||
],
|
||||
|
||||
}
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
import os
|
||||
import mozharness
|
||||
|
||||
external_tools_path = os.path.join(
|
||||
os.path.abspath(os.path.dirname(os.path.dirname(mozharness.__file__))),
|
||||
'external_tools',
|
||||
)
|
||||
|
||||
config = {
|
||||
# Python env
|
||||
"virtualenv_path": 'venv',
|
||||
"exes": {
|
||||
'python': '/tools/buildbot/bin/python',
|
||||
'virtualenv': ['/tools/buildbot/bin/python', '/tools/misc-python/virtualenv.py'],
|
||||
'tooltool.py': "/tools/tooltool.py",
|
||||
},
|
||||
|
||||
# PIP
|
||||
"find_links": [
|
||||
"http://pypi.pvt.build.mozilla.org/pub",
|
||||
"http://pypi.pub.build.mozilla.org/pub",
|
||||
],
|
||||
"pip_index": False,
|
||||
|
||||
#mozcrash support
|
||||
"download_minidump_stackwalk": True,
|
||||
"download_symbols": "ondemand",
|
||||
|
||||
"default_actions": [
|
||||
'clobber',
|
||||
'download-and-extract',
|
||||
'create-virtualenv',
|
||||
'install',
|
||||
'run-media-tests',
|
||||
],
|
||||
}
|
|
@ -1,39 +0,0 @@
|
|||
import os
|
||||
import sys
|
||||
import mozharness
|
||||
|
||||
external_tools_path = os.path.join(
|
||||
os.path.abspath(os.path.dirname(os.path.dirname(mozharness.__file__))),
|
||||
'external_tools',
|
||||
)
|
||||
|
||||
config = {
|
||||
"virtualenv_python_dll": os.path.join(os.path.dirname(sys.executable), 'python27.dll'),
|
||||
"virtualenv_path": 'venv',
|
||||
"exes": {
|
||||
'python': sys.executable,
|
||||
'virtualenv': [
|
||||
sys.executable,
|
||||
os.path.join(os.path.dirname(sys.executable), 'Lib', 'site-packages', 'virtualenv.py')
|
||||
],
|
||||
'mozinstall': ['build/venv/scripts/python', 'build/venv/scripts/mozinstall-script.py'],
|
||||
'tooltool.py': [sys.executable, os.path.join(os.environ['MOZILLABUILD'], 'tooltool.py')],
|
||||
'hg': os.path.join(os.environ['PROGRAMFILES'], 'Mercurial', 'hg')
|
||||
},
|
||||
"proxxy": {},
|
||||
"find_links": [
|
||||
"http://pypi.pub.build.mozilla.org/pub",
|
||||
],
|
||||
"pip_index": False,
|
||||
|
||||
"download_minidump_stackwalk": True,
|
||||
"download_symbols": "ondemand",
|
||||
|
||||
"default_actions": [
|
||||
'clobber',
|
||||
'download-and-extract',
|
||||
'create-virtualenv',
|
||||
'install',
|
||||
'run-media-tests',
|
||||
],
|
||||
}
|
|
@ -1,335 +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/.
|
||||
# ***** BEGIN LICENSE BLOCK *****
|
||||
|
||||
import copy
|
||||
import os
|
||||
import re
|
||||
import urlparse
|
||||
|
||||
from mozharness.base.log import ERROR, WARNING
|
||||
from mozharness.base.script import PreScriptAction
|
||||
from mozharness.mozilla.testing.testbase import (TestingMixin,
|
||||
testing_config_options)
|
||||
from mozharness.mozilla.testing.unittest import TestSummaryOutputParserHelper
|
||||
from mozharness.mozilla.vcstools import VCSToolsScript
|
||||
from mozharness.mozilla.buildbot import (
|
||||
TBPL_SUCCESS, TBPL_WARNING, TBPL_FAILURE
|
||||
)
|
||||
|
||||
BUSTED = 'busted'
|
||||
TESTFAILED = 'testfailed'
|
||||
UNKNOWN = 'unknown'
|
||||
EXCEPTION = 'exception'
|
||||
SUCCESS = 'success'
|
||||
|
||||
MEDIA_SUITE = 'media-tests'
|
||||
YOUTUBE_SUITE = 'media-youtube-tests'
|
||||
TWITCH_SUITE = 'media-twitch-tests'
|
||||
|
||||
media_test_config_options = [
|
||||
[["--media-urls"],
|
||||
{"action": "store",
|
||||
"dest": "media_urls",
|
||||
"help": "Path to ini file that lists media urls for tests.",
|
||||
}],
|
||||
[["--profile"],
|
||||
{"action": "store",
|
||||
"dest": "profile",
|
||||
"default": None,
|
||||
"help": "Path to FF profile that should be used by Marionette",
|
||||
}],
|
||||
[["--test-timeout"],
|
||||
{"action": "store",
|
||||
"dest": "test_timeout",
|
||||
"default": 10000,
|
||||
"help": ("Number of seconds without output before"
|
||||
"firefox-media-tests is killed."
|
||||
"Set this based on expected time for all media to play."),
|
||||
}],
|
||||
[["--tests"],
|
||||
{"action": "store",
|
||||
"dest": "tests",
|
||||
"default": None,
|
||||
"help": ("Test(s) to run. Path to test_*.py or "
|
||||
"test manifest (*.ini)"),
|
||||
}],
|
||||
[["--e10s"],
|
||||
{"dest": "e10s",
|
||||
"action": "store_true",
|
||||
"default": False,
|
||||
"help": "Enable e10s when running marionette tests."
|
||||
}],
|
||||
[["--suite"],
|
||||
{"action": "store",
|
||||
"dest": "test_suite",
|
||||
"default": MEDIA_SUITE,
|
||||
"help": ("Name of test suite to run. Possible values: "
|
||||
"{} (default), {}, {}".format(MEDIA_SUITE,
|
||||
YOUTUBE_SUITE,
|
||||
TWITCH_SUITE)),
|
||||
}],
|
||||
[['--browsermob-script'],
|
||||
{'help': 'path to the browsermob-proxy shell script or batch file',
|
||||
}],
|
||||
[['--browsermob-port'],
|
||||
{'help': 'port to run the browsermob proxy on',
|
||||
}],
|
||||
[["--allow-software-gl-layers"],
|
||||
{"action": "store_true",
|
||||
"dest": "allow_software_gl_layers",
|
||||
"default": False,
|
||||
"help": "Permits a software GL implementation (such as LLVMPipe) to use the GL compositor."
|
||||
}],
|
||||
[["--enable-webrender"],
|
||||
{"action": "store_true",
|
||||
"dest": "enable_webrender",
|
||||
"default": False,
|
||||
"help": "Tries to enable the WebRender compositor."
|
||||
}],
|
||||
] + (copy.deepcopy(testing_config_options))
|
||||
|
||||
class JobResultParser(TestSummaryOutputParserHelper):
|
||||
""" Parses test output to determine overall result."""
|
||||
def __init__(self, **kwargs):
|
||||
super(JobResultParser, self).__init__(**kwargs)
|
||||
self.return_code = 0
|
||||
# External-resource errors that should not count as test failures
|
||||
self.exception_re = re.compile(r'^TEST-UNEXPECTED-ERROR.*'
|
||||
r'TimeoutException: Error loading page,'
|
||||
r' timed out')
|
||||
self.exceptions = []
|
||||
|
||||
def parse_single_line(self, line):
|
||||
super(JobResultParser, self).parse_single_line(line)
|
||||
if self.exception_re.match(line):
|
||||
self.exceptions.append(line)
|
||||
|
||||
@property
|
||||
def status(self):
|
||||
status = UNKNOWN
|
||||
if self.passed and self.failed == 0:
|
||||
status = SUCCESS
|
||||
elif self.exceptions:
|
||||
status = EXCEPTION
|
||||
elif self.failed:
|
||||
status = TESTFAILED
|
||||
elif self.return_code:
|
||||
status = BUSTED
|
||||
return status
|
||||
|
||||
|
||||
class FirefoxMediaTestsBase(TestingMixin, VCSToolsScript):
|
||||
job_result_parser = None
|
||||
|
||||
error_list = [
|
||||
{'substr': 'FAILED (errors=', 'level': WARNING},
|
||||
{'substr': r'''Could not successfully complete transport of message to Gecko, socket closed''', 'level': ERROR},
|
||||
{'substr': r'''Connection to Marionette server is lost. Check gecko''', 'level': ERROR},
|
||||
{'substr': 'Timeout waiting for marionette on port', 'level': ERROR},
|
||||
{'regex': re.compile(r'''(TEST-UNEXPECTED|PROCESS-CRASH|CRASH|ERROR|FAIL)'''), 'level': ERROR},
|
||||
{'regex': re.compile(r'''(\b\w*Exception)'''), 'level': ERROR},
|
||||
{'regex': re.compile(r'''(\b\w*Error)'''), 'level': ERROR},
|
||||
]
|
||||
|
||||
def __init__(self, config_options=None, all_actions=None,
|
||||
default_actions=None, **kwargs):
|
||||
self.config_options = media_test_config_options + (config_options or [])
|
||||
actions = [
|
||||
'clobber',
|
||||
'download-and-extract',
|
||||
'create-virtualenv',
|
||||
'install',
|
||||
'run-media-tests',
|
||||
]
|
||||
super(FirefoxMediaTestsBase, self).__init__(
|
||||
config_options=self.config_options,
|
||||
all_actions=all_actions or actions,
|
||||
default_actions=default_actions or actions,
|
||||
**kwargs
|
||||
)
|
||||
c = self.config
|
||||
|
||||
self.media_urls = c.get('media_urls')
|
||||
self.profile = c.get('profile')
|
||||
self.test_timeout = int(c.get('test_timeout'))
|
||||
self.tests = c.get('tests')
|
||||
self.e10s = c.get('e10s')
|
||||
self.installer_url = c.get('installer_url')
|
||||
self.installer_path = c.get('installer_path')
|
||||
self.binary_path = c.get('binary_path')
|
||||
self.test_packages_url = c.get('test_packages_url')
|
||||
self.test_url = c.get('test_url')
|
||||
self.browsermob_script = c.get('browsermob_script')
|
||||
self.browsermob_port = c.get('browsermob_port')
|
||||
|
||||
@PreScriptAction('create-virtualenv')
|
||||
def _pre_create_virtualenv(self, action):
|
||||
dirs = self.query_abs_dirs()
|
||||
|
||||
media_tests_requirements = os.path.join(dirs['abs_test_install_dir'],
|
||||
'config',
|
||||
'external-media-tests-requirements.txt')
|
||||
|
||||
if os.access(media_tests_requirements, os.F_OK):
|
||||
self.register_virtualenv_module(requirements=[media_tests_requirements],
|
||||
two_pass=True)
|
||||
|
||||
def download_and_extract(self):
|
||||
"""Overriding method from TestingMixin for more specific behavior.
|
||||
|
||||
We use the test_packages_url command line argument to check where to get the
|
||||
harness, puppeteer, and tests from and how to set them up.
|
||||
|
||||
"""
|
||||
extract_dirs = ['config/*',
|
||||
'external-media-tests/*',
|
||||
'marionette/*',
|
||||
'mozbase/*',
|
||||
'puppeteer/*',
|
||||
'tools/wptserve/*',
|
||||
]
|
||||
super(FirefoxMediaTestsBase, self).download_and_extract(extract_dirs=extract_dirs)
|
||||
|
||||
def query_abs_dirs(self):
|
||||
if self.abs_dirs:
|
||||
return self.abs_dirs
|
||||
abs_dirs = super(FirefoxMediaTestsBase, self).query_abs_dirs()
|
||||
dirs = {
|
||||
'abs_test_install_dir' : os.path.join(abs_dirs['abs_work_dir'],
|
||||
'tests')
|
||||
}
|
||||
dirs['external-media-tests'] = os.path.join(dirs['abs_test_install_dir'],
|
||||
'external-media-tests')
|
||||
abs_dirs.update(dirs)
|
||||
self.abs_dirs = abs_dirs
|
||||
return self.abs_dirs
|
||||
|
||||
def _query_cmd(self):
|
||||
""" Determine how to call firefox-media-tests """
|
||||
if not self.binary_path:
|
||||
self.fatal("Binary path could not be determined. "
|
||||
"Should be set by default during 'install' action.")
|
||||
dirs = self.query_abs_dirs()
|
||||
|
||||
import external_media_harness.runtests
|
||||
|
||||
cmd = [
|
||||
self.query_python_path(),
|
||||
external_media_harness.runtests.__file__
|
||||
]
|
||||
|
||||
cmd += ['--binary', self.binary_path]
|
||||
if self.symbols_path:
|
||||
cmd += ['--symbols-path', self.symbols_path]
|
||||
if self.profile:
|
||||
cmd += ['--profile', self.profile]
|
||||
if self.tests:
|
||||
cmd.append(self.tests)
|
||||
if not self.e10s:
|
||||
cmd.append('--disable-e10s')
|
||||
if self.browsermob_script:
|
||||
cmd += ['--browsermob-script', self.browsermob_script]
|
||||
if self.browsermob_port:
|
||||
cmd += ['--browsermob-port', self.browsermob_port]
|
||||
|
||||
test_suite = self.config.get('test_suite')
|
||||
if test_suite not in [MEDIA_SUITE,
|
||||
YOUTUBE_SUITE,
|
||||
TWITCH_SUITE]:
|
||||
self.fatal("{} is not on of the possibele suites! "
|
||||
"See the --suites arg for more info"
|
||||
.format(test_suite))
|
||||
|
||||
if test_suite == YOUTUBE_SUITE:
|
||||
test_manifest = os.path.join(dirs['external-media-tests'],
|
||||
'external_media_tests',
|
||||
'playback', 'youtube',
|
||||
'manifest.ini')
|
||||
elif test_suite == TWITCH_SUITE:
|
||||
test_manifest = os.path.join(dirs['external-media-tests'],
|
||||
'external_media_tests',
|
||||
'playback', 'twitch',
|
||||
'manifest.ini')
|
||||
if not self.media_urls:
|
||||
# The default URLs are for youtube and won't play nice with
|
||||
# the twitch tests, so set URLs to the default twitch ones
|
||||
self.media_urls = os.path.join(dirs['external-media-tests'],
|
||||
'external_media_tests', 'urls',
|
||||
'twitch', 'default.ini')
|
||||
else:
|
||||
test_manifest = None
|
||||
|
||||
if test_manifest:
|
||||
cmd.append(test_manifest)
|
||||
|
||||
if self.media_urls:
|
||||
cmd += ['--urls', self.media_urls]
|
||||
|
||||
return cmd
|
||||
|
||||
def query_minidump_stackwalk(self):
|
||||
"""We don't have an extracted test package available to get the manifest file.
|
||||
|
||||
So we have to explicitely download the latest version of the manifest from the
|
||||
mozilla-central repository and feed it into the query_minidump_stackwalk() method.
|
||||
|
||||
We can remove this whole method once our tests are part of the tree.
|
||||
|
||||
"""
|
||||
manifest_path = None
|
||||
|
||||
if os.environ.get('MINIDUMP_STACKWALK') or self.config.get('download_minidump_stackwalk'):
|
||||
tooltool_manifest = self.query_minidump_tooltool_manifest()
|
||||
url_base = 'https://hg.mozilla.org/mozilla-central/raw-file/default/testing/'
|
||||
|
||||
dirs = self.query_abs_dirs()
|
||||
manifest_path = os.path.join(dirs['abs_work_dir'], 'releng.manifest')
|
||||
try:
|
||||
self.download_file(urlparse.urljoin(url_base, tooltool_manifest),
|
||||
manifest_path)
|
||||
except Exception as e:
|
||||
self.fatal('Download of tooltool manifest file failed: {}'.format(e.message))
|
||||
|
||||
return super(FirefoxMediaTestsBase, self).query_minidump_stackwalk(manifest=manifest_path)
|
||||
|
||||
def run_media_tests(self):
|
||||
cmd = self._query_cmd()
|
||||
self.job_result_parser = JobResultParser(
|
||||
config=self.config,
|
||||
log_obj=self.log_obj,
|
||||
error_list=self.error_list
|
||||
)
|
||||
|
||||
env = self.query_env()
|
||||
if self.query_minidump_stackwalk():
|
||||
env['MINIDUMP_STACKWALK'] = self.minidump_stackwalk_path
|
||||
env['RUST_BACKTRACE'] = '1'
|
||||
|
||||
if self.config['allow_software_gl_layers']:
|
||||
env['MOZ_LAYERS_ALLOW_SOFTWARE_GL'] = '1'
|
||||
if self.config['enable_webrender']:
|
||||
env['MOZ_WEBRENDER'] = '1'
|
||||
|
||||
return_code = self.run_command(
|
||||
cmd,
|
||||
output_timeout=self.test_timeout,
|
||||
output_parser=self.job_result_parser,
|
||||
env=env
|
||||
)
|
||||
self.job_result_parser.return_code = return_code
|
||||
# Handle our setting our return code via buildbot_status. We aren't
|
||||
# guaranteed to be running with buildbot, but for the sake of
|
||||
# consistency we use the same return codes. Note the overrides
|
||||
# of this function may also alter self.return code as appropriate.
|
||||
if self.job_result_parser.status == SUCCESS:
|
||||
tbpl_status = TBPL_SUCCESS
|
||||
elif self.job_result_parser.status == TESTFAILED:
|
||||
tbpl_status = TBPL_WARNING
|
||||
else:
|
||||
tbpl_status = TBPL_FAILURE
|
||||
self.buildbot_status(tbpl_status)
|
||||
return self.job_result_parser.status
|
|
@ -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/.
|
||||
# ***** BEGIN LICENSE BLOCK *****
|
||||
"""firefox_media_tests_buildbot.py
|
||||
|
||||
Author: Maja Frydrychowicz
|
||||
"""
|
||||
import copy
|
||||
import glob
|
||||
import os
|
||||
import sys
|
||||
|
||||
sys.path.insert(1, os.path.dirname(sys.path[0]))
|
||||
|
||||
from mozharness.base.log import DEBUG, ERROR, INFO
|
||||
from mozharness.base.script import PostScriptAction
|
||||
from mozharness.mozilla.blob_upload import (
|
||||
BlobUploadMixin,
|
||||
blobupload_config_options
|
||||
)
|
||||
from mozharness.mozilla.testing.firefox_media_tests import (
|
||||
FirefoxMediaTestsBase
|
||||
)
|
||||
|
||||
|
||||
class FirefoxMediaTestsBuildbot(FirefoxMediaTestsBase, BlobUploadMixin):
|
||||
|
||||
def __init__(self):
|
||||
config_options = copy.deepcopy(blobupload_config_options)
|
||||
super(FirefoxMediaTestsBuildbot, self).__init__(
|
||||
config_options=config_options,
|
||||
all_actions=['clobber',
|
||||
'read-buildbot-config',
|
||||
'download-and-extract',
|
||||
'create-virtualenv',
|
||||
'install',
|
||||
'run-media-tests',
|
||||
],
|
||||
)
|
||||
|
||||
def query_abs_dirs(self):
|
||||
if self.abs_dirs:
|
||||
return self.abs_dirs
|
||||
abs_dirs = super(FirefoxMediaTestsBuildbot, self).query_abs_dirs()
|
||||
dirs = {
|
||||
'abs_blob_upload_dir': os.path.join(abs_dirs['abs_work_dir'],
|
||||
'blobber_upload_dir')
|
||||
}
|
||||
abs_dirs.update(dirs)
|
||||
self.abs_dirs = abs_dirs
|
||||
return self.abs_dirs
|
||||
|
||||
def _query_cmd(self):
|
||||
cmd = super(FirefoxMediaTestsBuildbot, self)._query_cmd()
|
||||
dirs = self.query_abs_dirs()
|
||||
# configure logging
|
||||
blob_upload_dir = dirs.get('abs_blob_upload_dir')
|
||||
cmd += ['--gecko-log', os.path.join(blob_upload_dir, 'gecko.log')]
|
||||
cmd += ['--log-html', os.path.join(blob_upload_dir, 'media_tests.html')]
|
||||
cmd += ['--log-mach', os.path.join(blob_upload_dir, 'media_tests_mach.log')]
|
||||
return cmd
|
||||
|
||||
@PostScriptAction('run-media-tests')
|
||||
def _collect_uploads(self, action, success=None):
|
||||
""" Copy extra (log) files to blob upload dir. """
|
||||
dirs = self.query_abs_dirs()
|
||||
log_dir = dirs.get('abs_log_dir')
|
||||
blob_upload_dir = dirs.get('abs_blob_upload_dir')
|
||||
if not log_dir or not blob_upload_dir:
|
||||
return
|
||||
self.mkdir_p(blob_upload_dir)
|
||||
# Move firefox-media-test screenshots into log_dir
|
||||
screenshots_dir = os.path.join(dirs['base_work_dir'],
|
||||
'screenshots')
|
||||
log_screenshots_dir = os.path.join(log_dir, 'screenshots')
|
||||
if os.access(log_screenshots_dir, os.F_OK):
|
||||
self.rmtree(log_screenshots_dir)
|
||||
if os.access(screenshots_dir, os.F_OK):
|
||||
self.move(screenshots_dir, log_screenshots_dir)
|
||||
|
||||
# logs to upload: broadest level (info), error, screenshots
|
||||
uploads = glob.glob(os.path.join(log_screenshots_dir, '*'))
|
||||
log_files = self.log_obj.log_files
|
||||
log_level = self.log_obj.log_level
|
||||
|
||||
def append_path(filename, dir=log_dir):
|
||||
if filename:
|
||||
uploads.append(os.path.join(dir, filename))
|
||||
|
||||
append_path(log_files.get(ERROR))
|
||||
# never upload debug logs
|
||||
if log_level == DEBUG:
|
||||
append_path(log_files.get(INFO))
|
||||
else:
|
||||
append_path(log_files.get(log_level))
|
||||
# in case of SimpleFileLogger
|
||||
append_path(log_files.get('default'))
|
||||
for f in uploads:
|
||||
if os.access(f, os.F_OK):
|
||||
dest = os.path.join(blob_upload_dir, os.path.basename(f))
|
||||
self.copyfile(f, dest)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
media_test = FirefoxMediaTestsBuildbot()
|
||||
media_test.run_and_exit()
|
|
@ -1,48 +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/.
|
||||
# ***** BEGIN LICENSE BLOCK *****
|
||||
"""firefox_media_tests_jenkins.py
|
||||
|
||||
Author: Syd Polk
|
||||
"""
|
||||
import os
|
||||
import sys
|
||||
|
||||
sys.path.insert(1, os.path.dirname(sys.path[0]))
|
||||
|
||||
from mozharness.mozilla.testing.firefox_media_tests import (
|
||||
FirefoxMediaTestsBase
|
||||
)
|
||||
|
||||
|
||||
class FirefoxMediaTestsJenkins(FirefoxMediaTestsBase):
|
||||
|
||||
def __init__(self):
|
||||
super(FirefoxMediaTestsJenkins, self).__init__(
|
||||
all_actions=['clobber',
|
||||
'download-and-extract',
|
||||
'create-virtualenv',
|
||||
'install',
|
||||
'run-media-tests',
|
||||
],
|
||||
)
|
||||
|
||||
def _query_cmd(self):
|
||||
cmd = super(FirefoxMediaTestsJenkins, self)._query_cmd()
|
||||
|
||||
dirs = self.query_abs_dirs()
|
||||
|
||||
# configure logging
|
||||
log_dir = dirs.get('abs_log_dir')
|
||||
cmd += ['--gecko-log', os.path.join(log_dir, 'gecko.log')]
|
||||
cmd += ['--log-html', os.path.join(log_dir, 'media_tests.html')]
|
||||
cmd += ['--log-mach', os.path.join(log_dir, 'media_tests_mach.log')]
|
||||
|
||||
return cmd
|
||||
|
||||
if __name__ == '__main__':
|
||||
media_test = FirefoxMediaTestsJenkins()
|
||||
media_test.run_and_exit()
|
|
@ -1,110 +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/.
|
||||
# ***** BEGIN LICENSE BLOCK *****
|
||||
"""firefox_media_tests_taskcluster.py
|
||||
|
||||
Adapted from firefox_media_tests_buildbot.py
|
||||
|
||||
Author: Bryce Van Dyk
|
||||
"""
|
||||
import copy
|
||||
import glob
|
||||
import os
|
||||
import sys
|
||||
|
||||
sys.path.insert(1, os.path.dirname(sys.path[0]))
|
||||
|
||||
from mozharness.base.log import DEBUG, ERROR, INFO
|
||||
from mozharness.base.script import PostScriptAction
|
||||
from mozharness.mozilla.blob_upload import (
|
||||
BlobUploadMixin,
|
||||
blobupload_config_options
|
||||
)
|
||||
from mozharness.mozilla.testing.firefox_media_tests import (
|
||||
FirefoxMediaTestsBase, TESTFAILED, SUCCESS
|
||||
)
|
||||
|
||||
|
||||
class FirefoxMediaTestsTaskcluster(FirefoxMediaTestsBase):
|
||||
|
||||
def __init__(self):
|
||||
config_options = copy.deepcopy(blobupload_config_options)
|
||||
super(FirefoxMediaTestsTaskcluster, self).__init__(
|
||||
config_options=config_options,
|
||||
all_actions=['clobber',
|
||||
'download-and-extract',
|
||||
'create-virtualenv',
|
||||
'install',
|
||||
'run-media-tests',
|
||||
],
|
||||
)
|
||||
|
||||
def query_abs_dirs(self):
|
||||
if self.abs_dirs:
|
||||
return self.abs_dirs
|
||||
abs_dirs = super(FirefoxMediaTestsTaskcluster, self).query_abs_dirs()
|
||||
dirs = {
|
||||
'abs_blob_upload_dir': os.path.join(abs_dirs['abs_work_dir'],
|
||||
'blobber_upload_dir')
|
||||
}
|
||||
abs_dirs.update(dirs)
|
||||
self.abs_dirs = abs_dirs
|
||||
return self.abs_dirs
|
||||
|
||||
def _query_cmd(self):
|
||||
cmd = super(FirefoxMediaTestsTaskcluster, self)._query_cmd()
|
||||
dirs = self.query_abs_dirs()
|
||||
# configure logging
|
||||
blob_upload_dir = dirs.get('abs_blob_upload_dir')
|
||||
cmd += ['--gecko-log', os.path.join(blob_upload_dir, 'gecko.log')]
|
||||
cmd += ['--log-html', os.path.join(blob_upload_dir, 'media_tests.html')]
|
||||
cmd += ['--log-mach', os.path.join(blob_upload_dir, 'media_tests_mach.log')]
|
||||
return cmd
|
||||
|
||||
@PostScriptAction('run-media-tests')
|
||||
def _collect_uploads(self, action, success=None):
|
||||
""" Copy extra (log) files to blob upload dir. """
|
||||
dirs = self.query_abs_dirs()
|
||||
log_dir = dirs.get('abs_log_dir')
|
||||
blob_upload_dir = dirs.get('abs_blob_upload_dir')
|
||||
if not log_dir or not blob_upload_dir:
|
||||
return
|
||||
self.mkdir_p(blob_upload_dir)
|
||||
# Move firefox-media-test screenshots into log_dir
|
||||
screenshots_dir = os.path.join(dirs['base_work_dir'],
|
||||
'screenshots')
|
||||
log_screenshots_dir = os.path.join(log_dir, 'screenshots')
|
||||
if os.access(log_screenshots_dir, os.F_OK):
|
||||
self.rmtree(log_screenshots_dir)
|
||||
if os.access(screenshots_dir, os.F_OK):
|
||||
self.move(screenshots_dir, log_screenshots_dir)
|
||||
|
||||
# logs to upload: broadest level (info), error, screenshots
|
||||
uploads = glob.glob(os.path.join(log_screenshots_dir, '*'))
|
||||
log_files = self.log_obj.log_files
|
||||
log_level = self.log_obj.log_level
|
||||
|
||||
def append_path(filename, dir=log_dir):
|
||||
if filename:
|
||||
uploads.append(os.path.join(dir, filename))
|
||||
|
||||
append_path(log_files.get(ERROR))
|
||||
# never upload debug logs
|
||||
if log_level == DEBUG:
|
||||
append_path(log_files.get(INFO))
|
||||
else:
|
||||
append_path(log_files.get(log_level))
|
||||
# in case of SimpleFileLogger
|
||||
append_path(log_files.get('default'))
|
||||
for f in uploads:
|
||||
if os.access(f, os.F_OK):
|
||||
dest = os.path.join(blob_upload_dir, os.path.basename(f))
|
||||
self.copyfile(f, dest)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
media_test = FirefoxMediaTestsTaskcluster()
|
||||
media_test.run_and_exit()
|
|
@ -190,7 +190,6 @@ class AutoTry(object):
|
|||
"jsreftest",
|
||||
"marionette",
|
||||
"marionette-e10s",
|
||||
"media-tests",
|
||||
"mochitests",
|
||||
"reftest",
|
||||
"web-platform-tests",
|
||||
|
|
Загрузка…
Ссылка в новой задаче