Bug 1309060 - Run |mach python-test| in parallel from make check, r?gps draft
authorAndrew Halberstadt <ahalberstadt@mozilla.com>
Tue, 11 Oct 2016 16:06:35 -0400
changeset 439363 db69822343bd7e4e6d66b085fd166e5bcd2c57f1
parent 439362 15d2b8db61b0c34d40caac5ab9c35c50f43f4f99
child 537146 7bada58e55383ae27cba710b9acb7d41ee8bf7a7
push id35982
push userahalberstadt@mozilla.com
push dateTue, 15 Nov 2016 22:19:24 +0000
reviewersgps
bugs1309060
milestone53.0a1
Bug 1309060 - Run |mach python-test| in parallel from make check, r?gps This duplicates code in client.mk to retrieve the number of cores. We should probably just get the build system to define a global variable for this, but I don't know how to do that. MozReview-Commit-ID: CfAGbVMJXXT
testing/testsuite-targets.mk
--- a/testing/testsuite-targets.mk
+++ b/testing/testsuite-targets.mk
@@ -308,17 +308,18 @@ TEST_EXTENSIONS := \
 	$(NULL)
 
 stage-extensions: make-stage-dir
 	$(NSINSTALL) -D $(PKG_STAGE)/extensions/
 	@$(foreach ext,$(TEST_EXTENSIONS), cp -RL $(DIST)/xpi-stage/$(ext) $(PKG_STAGE)/extensions;)
 
 
 check::
-	@$(topsrcdir)/mach --log-no-times python-test
+	$(eval cores=$(shell $(PYTHON) -c 'import multiprocessing; print(multiprocessing.cpu_count())'))
+	@$(topsrcdir)/mach --log-no-times python-test -j$(cores)
 
 
 .PHONY: \
   reftest \
   crashtest \
   xpcshell-tests \
   jstestbrowser \
   package-tests \