Bug 1301334 - Package Marionette tests via moz.build entries r=gps
authorHenrik Skupin <mail@hskupin.info>
Tue, 20 Sep 2016 18:05:43 +0200
changeset 357776 f9edea7fac2d0d8cc755910cfc9ac3bd30959526
parent 357775 7494f67a77793c68446ca10d7605aa228d1a97a2
child 357777 d28809f3b445adad02f30777ce416cc69593923f
push id6795
push userjlund@mozilla.com
push dateMon, 23 Jan 2017 14:19:46 +0000
treeherdermozilla-beta@76101b503191 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgps
bugs1301334
milestone52.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1301334 - Package Marionette tests via moz.build entries r=gps 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
@@ -1526,20 +1526,16 @@ VARIABLES = {
     'PUPPETEER_FIREFOX_MANIFESTS': (ManifestparserManifestList, list,
         """List of manifest files defining puppeteer unit tests for Firefox.
         """),
 
     '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
@@ -279,17 +279,16 @@ TEST_MANIFESTS = dict(
     JETPACK_ADDON=('jetpack-addon', 'testing/mochitest', 'jetpack-addon', False),
     FIREFOX_UI_FUNCTIONAL=('firefox-ui-functional', 'firefox-ui', '.', False),
     FIREFOX_UI_UPDATE=('firefox-ui-update', 'firefox-ui', '.', False),
     PUPPETEER_FIREFOX=('firefox-ui-functional', 'firefox-ui', '.', 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)