Bug 939719 - stop packaging tests.jar up during a build - p=jmaher, r=ted, a=bajaj
authorChris Cooper <ccooper@deadsquid.com>
Wed, 22 Jan 2014 19:32:11 -0800
changeset 167028 50293ac6deb8302d8a97ff4814cfacdf88334ab4
parent 167027 85dea29cbde9992e443c792720ab8fceba52f85e
child 167029 08f8e09f0d6192364e235adba2a61e57bb2fa317
push id3202
push usercoop@mozilla.com
push dateThu, 23 Jan 2014 03:32:27 +0000
treeherdermozilla-beta@50293ac6deb8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersted, bajaj
bugs939719
milestone27.0
Bug 939719 - stop packaging tests.jar up during a build - p=jmaher, r=ted, a=bajaj
docshell/test/chrome/test_bug456980.xul
docshell/test/chrome/test_bug608669.xul
testing/mochitest/Makefile.in
testing/mochitest/runtests.py
testing/mochitest/runtestsremote.py
testing/testsuite-targets.mk
--- a/docshell/test/chrome/test_bug456980.xul
+++ b/docshell/test/chrome/test_bug456980.xul
@@ -15,18 +15,16 @@ https://bugzilla.mozilla.org/show_bug.cg
   <!-- test results are displayed in the html:body -->
   <body xmlns="http://www.w3.org/1999/xhtml">
   <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=456980"
      target="_blank">Mozilla Bug 396519</a>
   </body>
 
   <!-- test code goes here -->
   <script type="application/javascript"><![CDATA[
-    SimpleTest.expectAssertions(1);
-
     SimpleTest.waitForExplicitFinish();
 
     addLoadEvent(function() {
       window.open("bug113934_window.xul?chrome", "bug456980",
                   "chrome,width=800,height=800");
     });
 
   ]]></script>
--- a/docshell/test/chrome/test_bug608669.xul
+++ b/docshell/test/chrome/test_bug608669.xul
@@ -34,19 +34,17 @@ function setCachePref(enabled) {
     gOrigMaxTotalViewers = undefined;
     try {
       prefBranch.clearUserPref("browser.sessionhistory.cache_subframes");
     } catch (e) { /* Pref didn't exist, meh */ }
   }
 }
 
 
-SimpleTest.expectAssertions(1);
-
-    /** Test for Bug 608669 **/
+/** Test for Bug 608669 **/
 SimpleTest.waitForExplicitFinish();
 
 addLoadEvent(nextTest);
 
 gen = doTest();
 
 function nextTest() {
   gen.next();
--- a/testing/mochitest/Makefile.in
+++ b/testing/mochitest/Makefile.in
@@ -5,19 +5,16 @@
 
 NO_JS_MANIFEST = 1
 MOZ_CHROME_FILE_FORMAT = jar
 DIST_FILES = install.rdf
 
 # Used in install.rdf
 USE_EXTENSION_MANIFEST = 1
 
-# we turn this off for UNIVERSAL_BINARY
-CHROME_JAR = 1
-
 include $(topsrcdir)/config/rules.mk
 # We're installing to _tests/testing/mochitest, so this is the depth
 # necessary for relative objdir paths.
 TARGET_DEPTH = ../../..
 include $(topsrcdir)/build/automation-build.mk
 
 # files that get copied into $objdir/_tests/
 _SERV_FILES = 	\
@@ -169,35 +166,16 @@ TEST_HARNESS_PLUGINS := \
   $(DLL_PREFIX)nptest$(DLL_SUFFIX) \
   $(DLL_PREFIX)npsecondtest$(DLL_SUFFIX)
 endif
 
 # Rules for staging the necessary harness bits for a test package
 PKG_STAGE = $(DIST)/test-package-stage
 DIST_BIN = $(DIST)/bin
 
-PKG_CHROMEJAR = $(PKG_STAGE)/mochitest/content/
-
-ifdef CHROME_JAR
-stage-chromejar:
-	$(NSINSTALL) -D $(PKG_CHROMEJAR)
-	cp -RL $(DEPTH)/_tests/testing/mochitest/browser $(PKG_CHROMEJAR)
-	cp -RL $(DEPTH)/_tests/testing/mochitest/chrome $(PKG_CHROMEJAR)
-ifdef MOZ_METRO
-	cp -RL $(DEPTH)/_tests/testing/mochitest/metro $(PKG_CHROMEJAR)
-endif
-ifdef ACCESSIBILITY
-	cp -RL $(DEPTH)/_tests/testing/mochitest/a11y $(PKG_CHROMEJAR)
-endif
-	(cd $(PKG_STAGE)/mochitest && zip -rq tests.jar content/)
-	@(rm -rf $(PKG_CHROMEJAR))
-
-stage-package: stage-chromejar
-endif
-
 $(_DEST_DIR):
 	$(NSINSTALL) -D $@
 
 stage-package:
 	$(NSINSTALL) -D $(PKG_STAGE)/mochitest && $(NSINSTALL) -D $(PKG_STAGE)/bin/plugins && $(NSINSTALL) -D $(DIST)/plugins
 	cp $(DEPTH)/mozinfo.json $(PKG_STAGE)/mochitest
 	(cd $(DEPTH)/_tests/testing/mochitest/ && tar $(TAR_CREATE_FLAGS) - *) | (cd $(PKG_STAGE)/mochitest && tar -xf -)
 	@cp $(DEPTH)/mozinfo.json $(PKG_STAGE)/mochitest
--- a/testing/mochitest/runtests.py
+++ b/testing/mochitest/runtests.py
@@ -418,25 +418,16 @@ class MochitestUtilsMixin(object):
       if os.path.isfile(abspath):
         shutil.copy2(abspath, options.profilePath)
       elif os.path.isdir(abspath):
         dest = os.path.join(options.profilePath, os.path.basename(abspath))
         shutil.copytree(abspath, dest)
       else:
         log.warning("runtests.py | Failed to copy %s to profile", abspath)
 
-  def copyTestsJarToProfile(self, options):
-    """ copy tests.jar to the profile directory so we can auto register it in the .xul harness """
-    testsJarFile = os.path.join(SCRIPT_DIR, "tests.jar")
-    if not os.path.isfile(testsJarFile):
-      return False
-
-    shutil.copy2(testsJarFile, options.profilePath)
-    return True
-
   def installChromeJar(self, chrome, options):
     """
       copy mochijar directory to profile as an extension so we have chrome://mochikit for all harness code
     """
     # Write chrome.manifest.
     with open(os.path.join(options.profilePath, "extensions", "staged", "mochikit@mozilla.org", "chrome.manifest"), "a") as mfile:
       mfile.write(chrome)
 
@@ -456,28 +447,23 @@ toolbarpalette {
 }
 toolbar#nav-bar {
   background-image: none !important;
 }
 """
     with open(os.path.join(options.profilePath, "userChrome.css"), "a") as chromeFile:
       chromeFile.write(chrome)
 
-    # Call copyTestsJarToProfile(), Write tests.manifest.
     manifest = os.path.join(options.profilePath, "tests.manifest")
     with open(manifest, "w") as manifestFile:
-      if self.copyTestsJarToProfile(options):
-        # Register tests.jar.
-        manifestFile.write("content mochitests jar:tests.jar!/content/\n");
-      else:
-        # Register chrome directory.
-        chrometestDir = os.path.abspath(".") + "/"
-        if mozinfo.isWin:
-          chrometestDir = "file:///" + chrometestDir.replace("\\", "/")
-        manifestFile.write("content mochitests %s contentaccessible=yes\n" % chrometestDir)
+      # Register chrome directory.
+      chrometestDir = os.path.abspath(".") + "/"
+      if mozinfo.isWin:
+        chrometestDir = "file:///" + chrometestDir.replace("\\", "/")
+      manifestFile.write("content mochitests %s contentaccessible=yes\n" % chrometestDir)
 
       if options.testingModulesDir is not None:
         manifestFile.write("resource testing-common file:///%s\n" %
           options.testingModulesDir)
 
     # Call installChromeJar().
     if not os.path.isdir(os.path.join(SCRIPT_DIR, self.jarDir)):
       log.testFail("invalid setup: missing mochikit extension")
--- a/testing/mochitest/runtestsremote.py
+++ b/testing/mochitest/runtestsremote.py
@@ -342,20 +342,16 @@ class MochiRemote(Mochitest):
 
         # we do not need this for robotium based tests, lets save a LOT of time
         if options.robocopIni:
             shutil.rmtree(os.path.join(options.profilePath, 'webapps'))
             shutil.rmtree(os.path.join(options.profilePath, 'extensions', 'staged', 'mochikit@mozilla.org'))
             shutil.rmtree(os.path.join(options.profilePath, 'extensions', 'staged', 'worker-test@mozilla.org'))
             shutil.rmtree(os.path.join(options.profilePath, 'extensions', 'staged', 'workerbootstrap-test@mozilla.org'))
             os.remove(os.path.join(options.profilePath, 'userChrome.css'))
-            if os.path.exists(os.path.join(options.profilePath, 'tests.jar')):
-                os.remove(os.path.join(options.profilePath, 'tests.jar'))
-            if os.path.exists(os.path.join(options.profilePath, 'tests.manifest')):
-                os.remove(os.path.join(options.profilePath, 'tests.manifest'))
 
         try:
             self._dm.pushDir(options.profilePath, self.remoteProfile)
         except devicemanager.DMError:
             log.error("Automation Error: Unable to copy profile to device.")
             raise
 
         options.profilePath = self.remoteProfile
--- a/testing/testsuite-targets.mk
+++ b/testing/testsuite-targets.mk
@@ -412,19 +412,16 @@ else
 # This staging area has been built for us by universal/flight.mk
 PKG_STAGE = $(DIST)/universal/test-package-stage
 endif
 
 package-tests:
 	@rm -f "$(DIST)/$(PKG_PATH)$(TEST_PACKAGE)"
 ifndef UNIVERSAL_BINARY
 	$(NSINSTALL) -D $(DIST)/$(PKG_PATH)
-else
-	#building tests.jar (bug 543800) fails on unify, so we build tests.jar after unify is run
-	$(MAKE) -C $(DEPTH)/testing/mochitest stage-chromejar PKG_STAGE=$(DIST)/universal
 endif
 	find $(PKG_STAGE) -name "*.pyc" -exec rm {} \;
 	cd $(PKG_STAGE) && \
 	  zip -rq9D "$(abspath $(DIST))/$(PKG_PATH)$(TEST_PACKAGE)" \
 	  * -x \*/.mkdir.done
 
 ifeq ($(MOZ_WIDGET_TOOLKIT),android)
 package-tests: stage-android