Bug 1208320 - Produce cppunittest and reftest packages via Python; r=glandium
authorGregory Szorc <gps@mozilla.com>
Wed, 30 Sep 2015 09:58:31 -0700
changeset 265420 8957d96ac8f87af30b329532f13bc35df439d449
parent 265419 6d4afcd9ba64eaa8c2eec65a201957db02690511
child 265421 a35d20fb25d97ab1594faf27510a1f8f26d0f4ec
push id65931
push usergszorc@mozilla.com
push dateThu, 01 Oct 2015 05:36:32 +0000
treeherdermozilla-inbound@4a19c58da592 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs1208320
milestone44.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 1208320 - Produce cppunittest and reftest packages via Python; r=glandium With this change, all test ZIP archives are now generated via Python and mozpack. This change does not change I/O or file copy behavior at all. There is still a lot of room for eliminating extra file copies.
python/mozbuild/mozbuild/action/test_archive.py
testing/testsuite-targets.mk
--- a/python/mozbuild/mozbuild/action/test_archive.py
+++ b/python/mozbuild/mozbuild/action/test_archive.py
@@ -35,16 +35,23 @@ ARCHIVE_FILES = {
                 'mochitest/**',
                 'reftest/**',
                 'talos/**',
                 'web-platform/**',
                 'xpcshell/**',
             ],
         },
     ],
+    'cppunittest': [
+        {
+            'source': STAGE,
+            'base': '',
+            'pattern': 'cppunittest/**',
+        },
+    ],
     'mochitest': [
         {
             'source': buildconfig.topobjdir,
             'base': '_tests/testing',
             'pattern': 'mochitest/**',
         },
         {
             'source': STAGE,
@@ -54,16 +61,23 @@ ARCHIVE_FILES = {
     ],
     'mozharness': [
         {
             'source': buildconfig.topsrcdir,
             'base': 'testing',
             'pattern': 'mozharness/**',
         },
     ],
+    'reftest': [
+        {
+            'source': STAGE,
+            'base': '',
+            'pattern': 'reftest/**',
+        },
+    ],
     'talos': [
         {
             'source': buildconfig.topsrcdir,
             'base': 'testing',
             'pattern': 'talos/**',
         },
     ],
     'web-platform': [
--- a/testing/testsuite-targets.mk
+++ b/testing/testsuite-targets.mk
@@ -388,82 +388,65 @@ stage-all: \
   test-packages-manifest \
   test-packages-manifest-tc \
   $(NULL)
 ifdef MOZ_WEBRTC
 stage-all: stage-steeplechase
 endif
 
 TEST_PKGS := \
+  common \
   cppunittest \
+  mochitest \
   reftest \
-  $(NULL)
-
-PYTHON_TEST_PKGS := \
-  common \
-  mochitest \
   talos \
   web-platform \
   xpcshell \
   $(NULL)
 
-ALL_TEST_PKGS := $(TEST_PKGS) $(PYTHON_TEST_PKGS)
-
 PKG_ARG = --$(1) '$(PKG_BASENAME).$(1).tests.zip'
 
 test-packages-manifest-tc:
 	@rm -f $(MOZ_TEST_PACKAGES_FILE_TC)
 	$(NSINSTALL) -D $(dir $(MOZ_TEST_PACKAGES_FILE_TC))
 	$(PYTHON) $(topsrcdir)/build/gen_test_packages_manifest.py \
       --jsshell $(JSSHELL_NAME) \
       --dest-file $(MOZ_TEST_PACKAGES_FILE_TC) \
       --use-short-names \
       $(call PKG_ARG,common) \
-      $(foreach pkg,$(ALL_TEST_PKGS),$(call PKG_ARG,$(pkg)))
+      $(foreach pkg,$(TEST_PKGS),$(call PKG_ARG,$(pkg)))
 
 test-packages-manifest:
 	@rm -f $(MOZ_TEST_PACKAGES_FILE)
 	$(NSINSTALL) -D $(dir $(MOZ_TEST_PACKAGES_FILE))
 	$(PYTHON) $(topsrcdir)/build/gen_test_packages_manifest.py \
       --jsshell $(JSSHELL_NAME) \
       --dest-file $(MOZ_TEST_PACKAGES_FILE) \
       $(call PKG_ARG,common) \
-      $(foreach pkg,$(ALL_TEST_PKGS),$(call PKG_ARG,$(pkg)))
+      $(foreach pkg,$(TEST_PKGS),$(call PKG_ARG,$(pkg)))
 
 package-tests-prepare-dest:
 	@rm -f '$(DIST)/$(PKG_PATH)$(TEST_PACKAGE)'
 	$(NSINSTALL) -D $(DIST)/$(PKG_PATH)
 
 package-tests-mozharness: package-tests-prepare-dest
 	$(call py_action,test_archive, \
 		mozharness \
 		$(abspath $(DIST))/$(PKG_PATH)/mozharness.zip)
 package-tests: package-tests-mozharness
 
 define package_archive
 package-tests-$(1): stage-all package-tests-prepare-dest
-	rm -f '$$(DIST)/$$(PKG_PATH)$$(PKG_BASENAME).$(1).tests.zip' && \
-		cd $$(abspath $(PKG_STAGE)) && \
-		zip -rq9D '$$(abspath $$(DIST))/$$(PKG_PATH)$$(PKG_BASENAME).$(1).tests.zip' \
-		$(1) -x \*/.mkdir.done \*.pyc ;
-.PHONY += package-tests-$(1)
-package-tests: package-tests-$(1)
-endef
-
-$(foreach name,$(TEST_PKGS),$(eval $(call package_archive,$(name))))
-
-define python_test_archive
-package-tests-$(1): stage-all package-tests-prepare-dest
 	$$(call py_action,test_archive, \
 		$(1) \
 		$$(abspath $$(DIST))/$$(PKG_PATH)/$$(PKG_BASENAME).$(1).tests.zip)
 package-tests: package-tests-$(1)
 endef
 
-$(foreach name,$(PYTHON_TEST_PKGS),$(eval $(call python_test_archive,$(name))))
+$(foreach name,$(TEST_PKGS),$(eval $(call package_archive,$(name))))
 
 ifeq ($(MOZ_BUILD_APP),mobile/android)
 stage-all: stage-android
 stage-all: stage-instrumentation-tests
 endif
 
 ifeq ($(MOZ_BUILD_APP),mobile/android/b2gdroid)
 stage-all: stage-android