There is a section regarding mochitest (running it for TB) in the
following URL.
https://developer.mozilla.org/en-US/docs/Mozilla/Projects/Mochitest
I *think* this is very much outdated. It starts with
--- begin quote ---
Currently (as of August 2013) you cannot use |mach| to run tests in
comm-central applications. You need to run the "old" |pymake| commands
inside the |obj-dir| (if you use one). See |pymake
<
https://developer.mozilla.org/en-US/docs/pymake>| for how to use
|pymake| on Windows. For example, to run only the test
test_CrossSiteXHR.html
<
https://dxr.mozilla.org/mozilla-central/source/content/base/test/test_CrossSiteXHR.html>
in the Mozilla source tree, you would run this command:
--- end quote
Anyone for updating this?
Oh well. I stumbled upon this description while I was trying to figure
out if there is a recent bug that kept developers from running mochitest
locally
under linux.
I get the following error until I figured out that the variable
|timeout| is undefined (|None| in Python). Somehow it is not defined or
passed from the caller.
Due to a few local changes, the following line 2351 is actually 2339 in
the original.
https://searchfox.org/mozilla-central/source/testing/mochitest/runtests.py#2339
File "/NREF-COMM-CENTRAL/mozilla/testing/mochitest/runtests.py", line
2351, in runApp
runner.start(debug_args=debug_args,
File
"/NEW-SSD/NREF-COMM-CENTRAL/mozilla/testing/mozbase/mozrunner/mozrunner/base/browser.py",
line 85, in start
BaseRunner.start(self, *args, **kwargs)
File
"/NEW-SSD/NREF-COMM-CENTRAL/mozilla/testing/mozbase/mozrunner/mozrunner/base/runner.py",
line 101, in start
if timeout < 1200. :
TypeError: '<' not supported between instances of 'NoneType' and 'float'
0:49.40 ERROR Automation Error: Received unexpected exception while
running application
Turns out that timeout in runner.py was undefined, i.e., |None| in Python.
I see in runtests.py that timeout is set to None if we are doing
debugging session?
# then again to actually run mochitest
if options.timeout:
timeout = options.timeout + 30
elif options.debugger or not options.autorun:
timeout = None <--- here
else:
# We generally want the JS harness or marionette to handle
But I have not touched my script as far as I am concerned for the last
few months, I think.
Now I am running mochitest locally after the following change.
diff --git a/testing/mozbase/mozrunner/mozrunner/base/runner.py
b/testing/mozbase/mozrunner/mozrunner/base/runner.py
--- a/testing/mozbase/mozrunner/mozrunner/base/runner.py
+++ b/testing/mozbase/mozrunner/mozrunner/base/runner.py
@@ -93,17 +93,26 @@ class BaseRunner(object):
:param debug_args: arguments for a debugger
:param interactive: uses subprocess.Popen directly
:param timeout: see process_handler.run()
:param outputTimeout: see process_handler.run()
:returns: the process id
:raises: RunnerNotStartedError
"""
- if timeout < 1200. :
+
+
+ # strange. Sometimes timeout is None, i.e., no longer specified
by caller
+ # or undefined value is passed by the caller.
+ # on October 16/17 time frame.
+ if timeout is None:
+ traceback.print_exc()
+ timeout = 120. # this is increased to 1200 immediately
below. Oh well.
+
+ if timeout < 1200. :
timeout = 1200.
self.timeout = timeout
self.output_timeout = outputTimeout
cmd = self.command
# ensure the runner is stopped
self.stop()
Anyway, I was searching bugzilla for recent busted local test cases "I
cannot run local test any more", and searched google when I found the
URL I mention above.
TIA
Chiaki