bug 487496: custom BuildStep's need to explicitly name arguments and call self.addFactoryArguments - followup to addFactoryArguments in MozillaCheck, fix MozillaMochitest bug. r=ccooper
authorBen Hearsum <bhearsum@mozilla.com>
Tue, 21 Apr 2009 13:42:41 -0400
changeset 257 9301fd18edfdeb0d31c7f198ec7d056d4c9b4669
parent 256 fe254d49f9525093fa29c2d5654ad191e32d826b
child 258 5efe9895551638e52921ba1558197adbe1fc3ae9
push id67
push userbhearsum@mozilla.com
push dateTue, 21 Apr 2009 17:44:30 +0000
reviewersccooper
bugs487496
bug 487496: custom BuildStep's need to explicitly name arguments and call self.addFactoryArguments - followup to addFactoryArguments in MozillaCheck, fix MozillaMochitest bug. r=ccooper
unittest/steps.py
--- a/unittest/steps.py
+++ b/unittest/steps.py
@@ -232,16 +232,17 @@ class MozillaCheck(ShellCommandReportTim
             self.command = ["make", "-k", test_name]
         else:
             # Target calling a python script.
             self.command = ["make", test_name]
         self.description = [test_name + " test"]
         self.descriptionDone = [self.description[0] + " complete"]
         self.super_class = ShellCommandReportTimeout
         ShellCommandReportTimeout.__init__(self, **kwargs)
+        self.addFactoryArguments(test_name=test_name)
    
     def createSummary(self, log):
         # Counts.
         passCount = 0
         failCount = 0
         leaked = False
 
         # Regular expression for crash and leak detections.
@@ -343,27 +344,31 @@ class MozillaReftest(ShellCommandReportT
                 re.search(r"^TEST-UNEXPECTED-", cmd.logs["stdio"].getText(), re.MULTILINE):
             return WARNINGS
 
         return SUCCESS
 
 class MozillaMochitest(ShellCommandReportTimeout):
     warnOnFailure = True
 
-    def __init__(self, test_name, leakThreshold=None, env={}, **kwargs):
-        ShellCommandReportTimeout.__init__(self, env=env, **kwargs)
-        self.super_class = ShellCommandReportTimeout
-        self.addFactoryArguments(test_name=test_name,
-                                 leakThreshold=leakThreshold)
+    def __init__(self, test_name, leakThreshold=None, **kwargs):
         self.name = test_name
         self.command = ["make", test_name]
         self.description = [test_name + " test"]
         self.descriptionDone = [self.description[0] + " complete"]
+        self.super_class = ShellCommandReportTimeout
+
         if leakThreshold:
-            self.env["EXTRA_TEST_ARGS"] = "--leak-threshold=%d" % leakThreshold
+            if not "env" in kwargs:
+                kwargs["env"] = {}
+            kwargs["env"]["EXTRA_TEST_ARGS"] = \
+              "--leak-threshold=%d" % leakThreshold
+        ShellCommandReportTimeout.__init__(self, **kwargs)
+        self.addFactoryArguments(test_name=test_name,
+                                 leakThreshold=leakThreshold)
     
     def createSummary(self, log):
         # Counts.
         passCount = 0
         failCount = 0
         todoCount = 0
         crashed = False
         leaked = False