Bug 1301334 - Package Marionette tests via moz.build entries draft
authorHenrik Skupin <mail@hskupin.info>
Tue, 20 Sep 2016 18:05:43 +0200
changeset 415531 51147df409f39013f664b3070f7c6c262f3a6e3e
parent 415495 62f79d676e0e11b3ad59a5425b3ebb3ec5bbefb5
child 531634 bf299f50cf4f8061af649e396765235164418a9f
push id29898
push userbmo:hskupin@gmail.com
push dateTue, 20 Sep 2016 16:19:15 +0000
bugs1301334
milestone52.0a1
Bug 1301334 - Package Marionette tests via moz.build entries Move packaging for Marionette from make to test_archiver by using root manifest files. MozReview-Commit-ID: 1cxEBYQeJ2Z **
python/mozbuild/mozbuild/action/test_archive.py
python/mozbuild/mozbuild/frontend/context.py
python/mozbuild/mozbuild/testing.py
testing/marionette/harness/marionette/tests/print-manifest-dirs.py
testing/testsuite-targets.mk
--- a/python/mozbuild/mozbuild/action/test_archive.py
+++ b/python/mozbuild/mozbuild/action/test_archive.py
@@ -92,16 +92,45 @@ ARCHIVE_FILES = {
             ],
         },
         {
             'source': buildconfig.topobjdir,
             'base': '_tests',
             'pattern': 'modules/**',
         },
         {
+            'source': buildconfig.topsrcdir,
+            'base': 'testing/marionette',
+            'patterns': [
+                'client/**',
+                'mach_test_package_commands.py',
+            ],
+            'dest': 'marionette',
+        },
+        {
+            'source': buildconfig.topsrcdir,
+            'base': 'testing/marionette/harness',
+            'pattern': '**',
+            'dest': 'marionette',
+            'ignore': [
+                'marionette/tests'
+            ]
+        },
+        {
+            'source': buildconfig.topsrcdir,
+            'base': '',
+            'manifests': [
+                'testing/marionette/harness/marionette/tests/unit-tests.ini',
+                'testing/marionette/harness/marionette/tests/webapi-tests.ini',
+            ],
+            # We also need the manifests and harness_unit tests
+            'pattern': 'testing/marionette/harness/marionette/tests/**',
+            'dest': 'marionette/tests',
+        },
+        {
             'source': buildconfig.topobjdir,
             'base': '_tests',
             'pattern': 'mozbase/**',
         },
         {
             'source': buildconfig.topsrcdir,
             'base': 'testing',
             'pattern': 'firefox-ui/**',
--- a/python/mozbuild/mozbuild/frontend/context.py
+++ b/python/mozbuild/mozbuild/frontend/context.py
@@ -1514,20 +1514,16 @@ VARIABLES = {
     'ANDROID_INSTRUMENTATION_MANIFESTS': (ManifestparserManifestList, list,
         """List of manifest files defining Android instrumentation tests.
         """),
 
     'MARIONETTE_LAYOUT_MANIFESTS': (ManifestparserManifestList, list,
         """List of manifest files defining marionette-layout tests.
         """),
 
-    'MARIONETTE_LOOP_MANIFESTS': (ManifestparserManifestList, list,
-        """List of manifest files defining marionette-loop tests.
-        """),
-
     'MARIONETTE_UNIT_MANIFESTS': (ManifestparserManifestList, list,
         """List of manifest files defining marionette-unit tests.
         """),
 
     'MARIONETTE_UPDATE_MANIFESTS': (ManifestparserManifestList, list,
         """List of manifest files defining marionette-update tests.
         """),
 
--- a/python/mozbuild/mozbuild/testing.py
+++ b/python/mozbuild/mozbuild/testing.py
@@ -274,17 +274,16 @@ TEST_MANIFESTS = dict(
     BROWSER_CHROME=('browser-chrome', 'testing/mochitest', 'browser', True),
     ANDROID_INSTRUMENTATION=('instrumentation', 'instrumentation', '.', False),
     JETPACK_PACKAGE=('jetpack-package', 'testing/mochitest', 'jetpack-package', True),
     JETPACK_ADDON=('jetpack-addon', 'testing/mochitest', 'jetpack-addon', False),
 
     # marionette tests are run from the srcdir
     # TODO(ato): make packaging work as for other test suites
     MARIONETTE=('marionette', 'marionette', '.', False),
-    MARIONETTE_LOOP=('marionette', 'marionette', '.', False),
     MARIONETTE_UNIT=('marionette', 'marionette', '.', False),
     MARIONETTE_UPDATE=('marionette', 'marionette', '.', False),
     MARIONETTE_WEBAPI=('marionette', 'marionette', '.', False),
 
     METRO_CHROME=('metro-chrome', 'testing/mochitest', 'metro', True),
     MOCHITEST=('mochitest', 'testing/mochitest', 'tests', True),
     MOCHITEST_CHROME=('chrome', 'testing/mochitest', 'chrome', True),
     WEBRTC_SIGNALLING_TEST=('steeplechase', 'steeplechase', '.', True),
deleted file mode 100644
--- a/testing/marionette/harness/marionette/tests/print-manifest-dirs.py
+++ /dev/null
@@ -1,38 +0,0 @@
-# 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/.
-
-from manifestparser import TestManifest
-import os.path
-import sys
-
-def print_test_dirs(topsrcdir, manifest_file):
-    """
-    Simple routine which prints the paths of directories specified
-    in a Marionette manifest, relative to topsrcdir.  This does not recurse 
-    into manifests, as we currently have no need for that.
-    """
-
-    dirs = set()
-    # output the directory of this (parent) manifest
-    topsrcdir = os.path.abspath(topsrcdir)
-    scriptdir = os.path.abspath(os.path.dirname(__file__))
-    dirs.add(scriptdir[len(topsrcdir) + 1:])
-
-    # output the directories of all the other manifests
-    manifest = TestManifest()
-    manifest.read(manifest_file)
-    for i in manifest.get():
-        d = os.path.dirname(i['manifest'])[len(topsrcdir) + 1:]
-        dirs.add(d)
-    for path in dirs:
-        path = path.replace('\\', '/')
-        print path
-
-if __name__ == '__main__':
-    if len(sys.argv) < 3:
-        print >>sys.stderr, "Usage: %s topsrcdir manifest.ini" % sys.argv[0]
-        sys.exit(1)
-
-    print_test_dirs(sys.argv[1], sys.argv[2])
-
--- a/testing/testsuite-targets.mk
+++ b/testing/testsuite-targets.mk
@@ -177,17 +177,16 @@ PKG_STAGE = $(DIST)/test-stage
 
 stage-all: \
   stage-config \
   stage-mach \
   stage-extensions \
   stage-mochitest \
   stage-jstests \
   stage-jetpack \
-  stage-marionette \
   stage-luciddream \
   test-packages-manifest \
   $(NULL)
 ifdef MOZ_WEBRTC
 stage-all: stage-steeplechase
 endif
 
 ifdef COMPILE_ENVIRONMENT
@@ -326,34 +325,16 @@ stage-steeplechase: make-stage-dir
 	cp -RL $(DIST)/xpi-stage/specialpowers $(PKG_STAGE)/steeplechase
 	cp -RL $(topsrcdir)/testing/profiles/prefs_general.js $(PKG_STAGE)/steeplechase
 
 LUCIDDREAM_DIR=$(PKG_STAGE)/luciddream
 stage-luciddream: make-stage-dir
 	$(NSINSTALL) -D $(LUCIDDREAM_DIR)
 	@(cd $(topsrcdir)/testing/luciddream && tar $(TAR_CREATE_FLAGS) - *) | (cd $(LUCIDDREAM_DIR)/ && tar -xf -)
 
-MARIONETTE_DIR=$(PKG_STAGE)/marionette
-stage-marionette: make-stage-dir
-	$(NSINSTALL) -D $(MARIONETTE_DIR)/tests
-	$(NSINSTALL) -D $(MARIONETTE_DIR)/client
-	@(cd $(topsrcdir)/testing/marionette/harness && tar --exclude marionette/tests $(TAR_CREATE_FLAGS) - *) | (cd $(MARIONETTE_DIR)/ && tar -xf -)
-	@(cd $(topsrcdir)/testing/marionette/client && tar $(TAR_CREATE_FLAGS) - *) | (cd $(MARIONETTE_DIR)/client && tar -xf -)
-	cp $(topsrcdir)/testing/marionette/mach_test_package_commands.py $(MARIONETTE_DIR)
-	$(PYTHON) $(topsrcdir)/testing/marionette/harness/marionette/tests/print-manifest-dirs.py \
-          $(topsrcdir) \
-          $(topsrcdir)/testing/marionette/harness/marionette/tests/unit-tests.ini \
-          | (cd $(topsrcdir) && xargs tar $(TAR_CREATE_FLAGS) -) \
-          | (cd $(MARIONETTE_DIR)/tests && tar -xf -)
-	$(PYTHON) $(topsrcdir)/testing/marionette/harness/marionette/tests/print-manifest-dirs.py \
-          $(topsrcdir) \
-          $(topsrcdir)/testing/marionette/harness/marionette/tests/webapi-tests.ini \
-          | (cd $(topsrcdir) && xargs tar $(TAR_CREATE_FLAGS) -) \
-          | (cd $(MARIONETTE_DIR)/tests && tar -xf -)
-
 stage-instrumentation-tests: make-stage-dir
 	$(MAKE) -C $(DEPTH)/testing/instrumentation stage-package
 
 TEST_EXTENSIONS := \
     specialpowers@mozilla.org.xpi \
 	$(NULL)
 
 stage-extensions: make-stage-dir
@@ -371,14 +352,13 @@ stage-extensions: make-stage-dir
   make-stage-dir \
   stage-all \
   stage-b2g \
   stage-config \
   stage-mochitest \
   stage-jstests \
   stage-android \
   stage-jetpack \
-  stage-marionette \
   stage-steeplechase \
   stage-instrumentation-tests \
   stage-luciddream \
   test-packages-manifest \
   $(NULL)