Bug 479352 - Hide mochitest results table if MOZ_HIDE_RESULTS_TABLE=1 is set. (v3) r=jmaher
☠☠ backed out by da362a07a5ee ☠ ☠
authorCameron McCormack <cam@mcc.id.au>
Sat, 16 Jul 2011 14:43:53 +1200
changeset 73679 48dcb60519ace3548452ae848fd45e42bd09d9d5
parent 73678 0e09d21e28d06f62b03624ea6830e72b05bace64
child 73680 b670d14900b7594eb0b5da9440ff208c937544f2
child 111083 d098fdd21ac5b8800d09488f19d9f255ce26f45f
push id235
push userbzbarsky@mozilla.com
push dateTue, 27 Sep 2011 17:13:04 +0000
treeherdermozilla-beta@2d1e082d176a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjmaher
bugs479352
milestone8.0a1
first release with
nightly linux32
48dcb60519ac / 8.0a1 / 20110716030739 / files
nightly linux64
48dcb60519ac / 8.0a1 / 20110716030739 / files
nightly mac
48dcb60519ac / 8.0a1 / 20110716030739 / files
nightly win32
48dcb60519ac / 8.0a1 / 20110716030739 / files
nightly win64
48dcb60519ac / 8.0a1 / 20110716030739 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 479352 - Hide mochitest results table if MOZ_HIDE_RESULTS_TABLE=1 is set. (v3) r=jmaher
build/mobile/remoteautomation.py
testing/mochitest/runtests.py
testing/mochitest/runtestsremote.py
testing/mochitest/static/harness.css
testing/mochitest/tests/SimpleTest/setup.js
testing/testsuite-targets.mk
--- a/build/mobile/remoteautomation.py
+++ b/build/mobile/remoteautomation.py
@@ -74,16 +74,22 @@ class RemoteAutomation(Automation):
 
     # Set up what we need for the remote environment
     def environment(self, env = None, xrePath = None, crashreporter = True):
         # Because we are running remote, we don't want to mimic the local env
         # so no copying of os.environ
         if env is None:
             env = {}
 
+        # Except for the mochitest results table hiding option, which isn't
+        # passed to runtestsremote.py as an actual option, but through the
+        # MOZ_CRASHREPORTER_DISABLE environment variable.
+        if 'MOZ_HIDE_RESULTS_TABLE' in os.environ:
+            env['MOZ_HIDE_RESULTS_TABLE'] = os.environ['MOZ_HIDE_RESULTS_TABLE']
+
         if crashreporter:
             env['MOZ_CRASHREPORTER_NO_REPORT'] = '1'
             env['MOZ_CRASHREPORTER'] = '1'
         else:
             env['MOZ_CRASHREPORTER_DISABLE'] = '1'
 
         return env
 
--- a/testing/mochitest/runtests.py
+++ b/testing/mochitest/runtests.py
@@ -531,23 +531,24 @@ class Mochitest(object):
 
     browserEnv["XPCOM_MEM_BLOAT_LOG"] = self.leak_report_file
 
     if options.fatalAssertions:
       browserEnv["XPCOM_DEBUG_BREAK"] = "stack-and-abort"
 
     return browserEnv
 
-  def buildURLOptions(self, options):
+  def buildURLOptions(self, options, env):
     """ Add test control options from the command line to the url 
 
         URL parameters to test URL:
 
         autorun -- kick off tests automatically
         closeWhenDone -- runs quit.js after tests
+        hideResultsTable -- hides the table of individual test results
         logFile -- logs test run to an absolute path
         totalChunks -- how many chunks to split tests into
         thisChunk -- which chunk to run
         timeout -- per-test timeout in seconds
         loops -- How many times to run the test
     """
   
     # allow relative paths for logFile
@@ -573,16 +574,18 @@ class Mochitest(object):
       if options.chunkByDir:
         self.urlOpts.append("chunkByDir=%d" % options.chunkByDir)
       if options.shuffle:
         self.urlOpts.append("shuffle=1")
       if options.loops:
         self.urlOpts.append("loops=%d" % options.loops)
       if os.path.isfile(self.oldcwd + self.TEST_PATH + options.testPath) and options.loops > 0:
         self.urlOpts.append("testname=%s" % (self.TEST_PATH + options.testPath))
+      if "MOZ_HIDE_RESULTS_TABLE" in env and env["MOZ_HIDE_RESULTS_TABLE"] == "1":
+        self.urlOpts.append("hideResultsTable=1")
 
   def cleanup(self, manifest, options):
     """ remove temporary files and profile """
     os.remove(manifest)
     shutil.rmtree(options.profilePath)
 
   def startVMwareRecording(self, options):
     """ starts recording inside VMware VM using the recording helper dll """
@@ -628,17 +631,17 @@ class Mochitest(object):
     manifest = self.buildProfile(options)
     if manifest is None:
       return 1
 
     self.startWebServer(options)
     self.startWebSocketServer(options, debuggerInfo)
 
     testURL = self.buildTestPath(options)
-    self.buildURLOptions(options)
+    self.buildURLOptions(options, browserEnv)
     if len(self.urlOpts) > 0:
       testURL += "?" + "&".join(self.urlOpts)
 
     # Remove the leak detection file so it can't "leak" to the tests run.
     # The file is not there if leak logging was not enabled in the application build.
     if os.path.exists(self.leak_report_file):
       os.remove(self.leak_report_file)
 
@@ -711,16 +714,19 @@ class Mochitest(object):
     options.logFile = options.logFile.replace("\\", "\\\\")
     options.testPath = options.testPath.replace("\\", "\\\\")
     testRoot = 'chrome'
     if (options.browserChrome):
       testRoot = 'browser'
     elif (options.a11y):
       testRoot = 'a11y'
  
+    if "MOZ_HIDE_RESULTS_TABLE" in os.environ and os.environ["MOZ_HIDE_RESULTS_TABLE"] == "1":
+      options.hideResultsTable = True
+
     #TODO: when we upgrade to python 2.6, just use json.dumps(options.__dict__)
     content = "{"
     content += '"testRoot": "%s", ' % (testRoot) 
     first = True
     for opt in options.__dict__.keys():
       val = options.__dict__[opt]
       if first:
         first = False
--- a/testing/mochitest/runtestsremote.py
+++ b/testing/mochitest/runtestsremote.py
@@ -274,21 +274,21 @@ class MochiRemote(Mochitest):
         manifest = Mochitest.buildProfile(self, options)
         self.localProfile = options.profilePath
         if self._dm.pushDir(options.profilePath, self.remoteProfile) == None:
             raise devicemanager.FileError("Unable to copy profile to device.")
 
         options.profilePath = self.remoteProfile
         return manifest
     
-    def buildURLOptions(self, options):
+    def buildURLOptions(self, options, env):
         self.localLog = options.logFile
         options.logFile = self.remoteLog
         options.profilePath = self.localProfile
-        retVal = Mochitest.buildURLOptions(self, options)
+        retVal = Mochitest.buildURLOptions(self, options, env)
         #we really need testConfig.js (for browser chrome)
         if self._dm.pushDir(options.profilePath, self.remoteProfile) == None:
             raise devicemanager.FileError("Unable to copy profile to device.")
 
         options.profilePath = self.remoteProfile
         options.logFile = self.localLog
         return retVal
 
--- a/testing/mochitest/static/harness.css
+++ b/testing/mochitest/static/harness.css
@@ -44,16 +44,20 @@ ul.top {
 }
 
 table#test-table {
   background: #f6f6f6;
   margin-left: 1em;
   padding: 0;
 }
 
+.hide-results-table #test-table {
+  display: none;
+}
+
 div.container {
   margin: 1em;
 }
 
 a#runtests, a {
   color: #3333cc;
 }
 
--- a/testing/mochitest/tests/SimpleTest/setup.js
+++ b/testing/mochitest/tests/SimpleTest/setup.js
@@ -74,16 +74,21 @@ if (params.loops) {
   TestRunner.loops = params.loops;
 } 
 
 // closeWhenDone tells us to call quit.js when complete
 if (params.closeWhenDone) {
   TestRunner.onComplete = goQuitApplication;
 }
 
+// hide the test results table if MOZ_HIDE_RESULTS_TABLE=1 was used
+if (params.hideResultsTable) {
+  document.documentElement.classList.add("hide-results-table");
+}
+
 // logFile to write our results
 if (params.logFile) {
   MozillaFileLogger.init(params.logFile);
   TestRunner.logger.addListener("mozLogger", fileLevel + "", MozillaFileLogger.getLogCallback());
 }
 
 // if we get a quiet param, don't log to the console
 if (!params.quiet) {
--- a/testing/testsuite-targets.mk
+++ b/testing/testsuite-targets.mk
@@ -77,20 +77,20 @@ define CHECK_TEST_ERROR
 	  exit 1; \
   else \
 	  echo "$@ passed"; \
   fi
 endef
 endif
 
 mochitest-remote:
-	if test -f ${MOZ_HOST_BIN}/xpcshell && [ "${TEST_DEVICE}" != "" ]; \
+	@if test -f ${MOZ_HOST_BIN}/xpcshell && [ "${TEST_DEVICE}" != "" ]; \
           then $(RUN_MOCHITEST_REMOTE); \
         else \
-          @echo "please prepare your host with environment variables for TEST_DEVICE and MOZ_HOST_BIN"; \
+          echo "please prepare your host with environment variables for TEST_DEVICE and MOZ_HOST_BIN"; \
         fi
 
 mochitest-plain:
 	$(RUN_MOCHITEST)
 	$(CHECK_TEST_ERROR)
 
 # Allow mochitest-1 ... mochitest-5 for developer ease
 mochitest-1 mochitest-2 mochitest-3 mochitest-4 mochitest-5: mochitest-%: