Bug 1239988 - Move resources for firefox-ui-tests out of tests folder. r?maja_zf draft
authorHenrik Skupin <mail@hskupin.info>
Thu, 10 Mar 2016 14:21:54 +0100
changeset 339233 25d83b3fd5b05997d19dda939cd6f1c252351c3f
parent 339232 3ceb018c6305c44e582147b37a7da926e099f738
child 339234 9cbd71fd7fa94e11010d93c84cddcf5dfe5fd482
push id12676
push userbmo:hskupin@gmail.com
push dateThu, 10 Mar 2016 21:17:45 +0000
reviewersmaja_zf
bugs1239988
milestone48.0a1
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.
testing/firefox-ui/mach_commands.py
testing/firefox-ui/resources/cookies/cookie_single.html
testing/firefox-ui/resources/images/firefox_favicon.ico
testing/firefox-ui/resources/images/mozilla_favicon.ico
testing/firefox-ui/resources/images/mozilla_logo.jpg
testing/firefox-ui/resources/layout/mozilla.html
testing/firefox-ui/resources/layout/mozilla_community.html
testing/firefox-ui/resources/layout/mozilla_contribute.html
testing/firefox-ui/resources/layout/mozilla_governance.html
testing/firefox-ui/resources/layout/mozilla_grants.html
testing/firefox-ui/resources/layout/mozilla_mission.html
testing/firefox-ui/resources/layout/mozilla_organizations.html
testing/firefox-ui/resources/layout/mozilla_projects.html
testing/firefox-ui/resources/private_browsing/about.html
testing/firefox-ui/resources/security/enable_privilege.html
testing/firefox-ui/tests/resources/cookies/cookie_single.html
testing/firefox-ui/tests/resources/images/firefox_favicon.ico
testing/firefox-ui/tests/resources/images/mozilla_favicon.ico
testing/firefox-ui/tests/resources/images/mozilla_logo.jpg
testing/firefox-ui/tests/resources/layout/mozilla.html
testing/firefox-ui/tests/resources/layout/mozilla_community.html
testing/firefox-ui/tests/resources/layout/mozilla_contribute.html
testing/firefox-ui/tests/resources/layout/mozilla_governance.html
testing/firefox-ui/tests/resources/layout/mozilla_grants.html
testing/firefox-ui/tests/resources/layout/mozilla_mission.html
testing/firefox-ui/tests/resources/layout/mozilla_organizations.html
testing/firefox-ui/tests/resources/layout/mozilla_projects.html
testing/firefox-ui/tests/resources/private_browsing/about.html
testing/firefox-ui/tests/resources/security/enable_privilege.html
testing/mozharness/mozharness/mozilla/testing/firefox_ui_tests.py
--- 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)