Bug 1239988 - Move resources for firefox-ui-tests out of tests folder. r?maja_zf
MozReview-Commit-ID: KtUiswz9gna
The resources folder should actually not be part of the tests folder. It contains test data for all tests and once tests are moved to other places the tests folder will not exist anymore.
--- a/testing/firefox-ui/mach_commands.py
+++ b/testing/firefox-ui/mach_commands.py
@@ -44,25 +44,25 @@ def run_firefox_ui_test(testtype=None, t
'update': {
'default_tests': [
os.path.join('update', 'manifest.ini'),
],
'cli_module': firefox_ui_harness.cli_update,
}
}
- tests_root = os.path.join(topsrcdir, 'testing', 'firefox-ui', 'tests')
+ fxui_dir = os.path.join(topsrcdir, 'testing', 'firefox-ui')
# Set the resources path which is used to serve test data via wptserve
if not kwargs['server_root']:
- kwargs['server_root'] = os.path.join(tests_root, 'resources')
+ kwargs['server_root'] = os.path.join(fxui_dir, 'resources')
# If no tests have been selected, set default ones
if not kwargs.get('tests'):
- kwargs['tests'] = [os.path.join(tests_root, test)
+ kwargs['tests'] = [os.path.join(fxui_dir, 'tests', test)
for test in test_types[testtype]['default_tests']]
kwargs['logger'] = commandline.setup_logging('Firefox UI - {} Tests'.format(testtype),
{"mach": sys.stdout})
# Bug 1255064 - Marionette requieres an argparse Namespace. So fake one for now.
args = argparse.Namespace()
for k, v in kwargs.iteritems():
rename from testing/firefox-ui/tests/resources/cookies/cookie_single.html
rename to testing/firefox-ui/resources/cookies/cookie_single.html
rename from testing/firefox-ui/tests/resources/images/firefox_favicon.ico
rename to testing/firefox-ui/resources/images/firefox_favicon.ico
rename from testing/firefox-ui/tests/resources/images/mozilla_favicon.ico
rename to testing/firefox-ui/resources/images/mozilla_favicon.ico
rename from testing/firefox-ui/tests/resources/images/mozilla_logo.jpg
rename to testing/firefox-ui/resources/images/mozilla_logo.jpg
rename from testing/firefox-ui/tests/resources/layout/mozilla.html
rename to testing/firefox-ui/resources/layout/mozilla.html
rename from testing/firefox-ui/tests/resources/layout/mozilla_community.html
rename to testing/firefox-ui/resources/layout/mozilla_community.html
rename from testing/firefox-ui/tests/resources/layout/mozilla_contribute.html
rename to testing/firefox-ui/resources/layout/mozilla_contribute.html
rename from testing/firefox-ui/tests/resources/layout/mozilla_governance.html
rename to testing/firefox-ui/resources/layout/mozilla_governance.html
rename from testing/firefox-ui/tests/resources/layout/mozilla_grants.html
rename to testing/firefox-ui/resources/layout/mozilla_grants.html
rename from testing/firefox-ui/tests/resources/layout/mozilla_mission.html
rename to testing/firefox-ui/resources/layout/mozilla_mission.html
rename from testing/firefox-ui/tests/resources/layout/mozilla_organizations.html
rename to testing/firefox-ui/resources/layout/mozilla_organizations.html
rename from testing/firefox-ui/tests/resources/layout/mozilla_projects.html
rename to testing/firefox-ui/resources/layout/mozilla_projects.html
rename from testing/firefox-ui/tests/resources/private_browsing/about.html
rename to testing/firefox-ui/resources/private_browsing/about.html
rename from testing/firefox-ui/tests/resources/security/enable_privilege.html
rename to testing/firefox-ui/resources/security/enable_privilege.html
--- a/testing/mozharness/mozharness/mozilla/testing/firefox_ui_tests.py
+++ b/testing/mozharness/mozharness/mozilla/testing/firefox_ui_tests.py
@@ -208,17 +208,17 @@ class FirefoxUITests(TestingMixin, VCSTo
return self.abs_dirs
abs_dirs = super(FirefoxUITests, self).query_abs_dirs()
abs_tests_install_dir = os.path.join(abs_dirs['abs_work_dir'], 'tests')
dirs = {
'abs_reports_dir': os.path.join(abs_dirs['base_work_dir'], 'reports'),
'abs_test_install_dir': abs_tests_install_dir,
- 'abs_fxui_tests_dir': os.path.join(abs_tests_install_dir, 'firefox-ui', 'tests'),
+ 'abs_fxui_dir': os.path.join(abs_tests_install_dir, 'firefox-ui'),
}
for key in dirs:
if key not in abs_dirs:
abs_dirs[key] = dirs[key]
self.abs_dirs = abs_dirs
return self.abs_dirs
@@ -298,17 +298,17 @@ class FirefoxUITests(TestingMixin, VCSTo
cmd = [
self.query_python_path(),
os.path.join(os.path.dirname(firefox_ui_harness.__file__),
self.cli_script),
'--binary', binary_path,
'--address', 'localhost:{}'.format(marionette_port),
# Resource files to serve via local webserver
- '--server-root', os.path.join(dirs['abs_fxui_tests_dir'], 'resources'),
+ '--server-root', os.path.join(dirs['abs_fxui_dir'], 'resources'),
# Use the work dir to get temporary data stored
'--workspace', dirs['abs_work_dir'],
# logging options
'--gecko-log=-', # output from the gecko process redirected to stdout
'--log-raw=-', # structured log for output parser redirected to stdout
@@ -329,17 +329,17 @@ class FirefoxUITests(TestingMixin, VCSTo
if self.query_minidump_stackwalk():
env['MINIDUMP_STACKWALK'] = self.minidump_stackwalk_path
parser = StructuredOutputParser(config=self.config,
log_obj=self.log_obj,
strict=False)
# Add the top-level tests manifest file
- cmd.append(os.path.join(dirs['abs_fxui_tests_dir'], self.tests_manifest))
+ cmd.append(os.path.join(dirs['abs_fxui_dir'], 'tests', self.tests_manifest))
return_code = self.run_command(cmd,
cwd=dirs['abs_work_dir'],
output_timeout=300,
output_parser=parser,
env=env)
tbpl_status, log_level = parser.evaluate_parser(return_code)