Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Changes to wrapper removal

  • Loading branch information...
commit 0afc1e41c8314bbaab7dd501fde27526b3c6fc6a 1 parent 1b5fd81
David Guo authored May 11, 2012
2  .hg/cache/tags
... ...
@@ -1,2 +1,2 @@
1  
-111 9aad9c039a2cec7bce3313dc56044e9769f88f78
  1
+112 a4e10c86684848e6210454fe0c82fe9279361f08
2 2
 
BIN  .hg/dirstate
Binary file not shown
BIN  .hg/store/00changelog.i
Binary file not shown
BIN  .hg/store/00manifest.i
Binary file not shown
BIN  .hg/store/data/libs/testrun.py.i
Binary file not shown
BIN  .hg/store/undo
Binary file not shown
5  .hg/undo.desc
... ...
@@ -1,3 +1,2 @@
1  
-0
2  
-pull
3  
-http://hg.mozilla.org/qa/mozmill-automation/
  1
+112
  2
+commit
BIN  .hg/undo.dirstate
Binary file not shown
271  libs/mozmill_wrapper.py
... ...
@@ -1,271 +0,0 @@
1  
-# ***** BEGIN LICENSE BLOCK *****
2  
-# Version: MPL 1.1/GPL 2.0/LGPL 2.1
3  
-#
4  
-# The contents of this file are subject to the Mozilla Public License Version
5  
-# 1.1 (the "License"); you may not use this file except in compliance with
6  
-# the License. You may obtain a copy of the License at
7  
-# http://www.mozilla.org/MPL/
8  
-#
9  
-# Software distributed under the License is distributed on an "AS IS" basis,
10  
-# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
11  
-# for the specific language governing rights and limitations under the
12  
-# License.
13  
-#
14  
-# The Original Code is MozMill automation code.
15  
-#
16  
-# The Initial Developer of the Original Code is the Mozilla Foundation.
17  
-# Portions created by the Initial Developer are Copyright (C) 2010
18  
-# the Initial Developer. All Rights Reserved.
19  
-#
20  
-# Contributor(s):
21  
-#   Henrik Skupin <hskupin@mozilla.com>
22  
-#
23  
-# Alternatively, the contents of this file may be used under the terms of
24  
-# either the GNU General Public License Version 2 or later (the "GPL"), or
25  
-# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
26  
-# in which case the provisions of the GPL or the LGPL are applicable instead
27  
-# of those above. If you wish to allow use of your version of this file only
28  
-# under the terms of either the GPL or the LGPL, and not to allow others to
29  
-# use your version of this file under the terms of the MPL, indicate your
30  
-# decision by deleting the provisions above and replace them with the notice
31  
-# and other provisions required by the GPL or the LGPL. If you do not delete
32  
-# the provisions above, a recipient may use your version of this file under
33  
-# the terms of any one of the MPL, the GPL or the LGPL.
34  
-#
35  
-# ***** END LICENSE BLOCK *****
36  
-
37  
-import copy
38  
-import mozmill
39  
-import mozrunner
40  
-
41  
-class MozmillWrapper(mozmill.MozMill):
42  
-    """ Wrapper class for the MozMill class. """
43  
-
44  
-    def __init__(self, *args, **kwargs):
45  
-        mozmill.MozMill.__init__(self, *args, **kwargs)
46  
-
47  
-        self.report_callback = None
48  
-
49  
-    def get_report(self, *args, **kwargs):
50  
-        """ Override method for customized reports. """
51  
-
52  
-        results = mozmill.MozMill.get_report(self, *args, **kwargs)
53  
-        if self.report_callback:
54  
-            results = self.report_callback(results)
55  
-
56  
-        return results
57  
-
58  
-
59  
-class MozmillRestartWrapper(mozmill.MozMillRestart, MozmillWrapper):
60  
-    """ Wrapper class for the MozMillRestart class. """
61  
-
62  
-    def __init__(self, *args, **kwargs):
63  
-        mozmill.MozMillRestart.__init__(self, *args, **kwargs)
64  
-        MozmillWrapper.__init__(self, *args, **kwargs)
65  
-
66  
-
67  
-class MozmillWrapperCLI(mozmill.CLI):
68  
-    """ Wrapper class for the Mozmill CLI class.
69  
-
70  
-    The following properties are set directly:
71  
-         addons:    List of add-ons to install
72  
-         tests:     List of folders/tests to execute
73  
-    """
74  
-
75  
-    mozmill_class = MozmillWrapper
76  
-
77  
-    # This is really bad but we have to declare all possible cli options.
78  
-    # Otherwise the mozmill.CLI parser is failing.
79  
-    # XXX: Can be removed once we do not have to depend on the CLI class anymore
80  
-    #      See bug 565733 for the refactoring work.
81  
-    parser_options = copy.copy(mozmill.CLI.parser_options)
82  
-    parser_options[("--application",)] = dict(dest="application")
83  
-    parser_options[("--channel",)] = dict(dest="channel")
84  
-    parser_options[("--delay",)] = dict(dest="delay")
85  
-    parser_options[("--entities",)] = dict(dest="entities")
86  
-    parser_options[("--iterations",)] = dict(dest="iterations")
87  
-    parser_options[("--junit",)] = dict(dest="junit_file")
88  
-    parser_options[("--no-fallback",)] = dict(dest="no_fallback")
89  
-    parser_options[("--no-restart",)] = dict(dest="no_restart")
90  
-    parser_options[("--repository",)] = dict(dest="repository")
91  
-    parser_options[("--reserved",)] = dict(dest="reserved")
92  
-    parser_options[("--screenshot-path",)] = dict(dest="screenshot_path")
93  
-    parser_options[("--tag",)] = dict(dest="tags")
94  
-    parser_options[("--target-addons",)] = dict(dest="target_addons")
95  
-    parser_options[("--target-buildid",)] = dict(dest="target_buildid")
96  
-    parser_options[("--with-untrusted",)] = dict(dest="with_untrusted")
97  
-
98  
-    def __init__(self, debug=False, *args, **kwargs):
99  
-        mozmill.CLI.__init__(self, *args, **kwargs)
100  
-
101  
-        self.options.debug = debug
102  
-        self.report_callback = None
103  
-
104  
-
105  
-    def _get_binary(self):
106  
-        """ Returns the binary to use for testing. """
107  
-        return self.options.binary
108  
-
109  
-    def _set_binary(self, value):
110  
-        """ Sets the binary to use for testing. """
111  
-        self.options.binary = value
112  
-
113  
-    binary = property(_get_binary, _set_binary, None)
114  
-
115  
-
116  
-    def _get_fails(self):
117  
-        """ Returns the failed tests. """
118  
-        return self.mozmill.fails
119  
-
120  
-    fails = property(_get_fails, None, None)
121  
-
122  
-
123  
-    def _get_logfile(self):
124  
-        """ Returns the path of the log file. """
125  
-        return self.options.logfile
126  
-
127  
-    def _set_logfile(self, value):
128  
-        """ Sets the path of the log file. """
129  
-        self.options.logfile = value
130  
-
131  
-    logfile = property(_get_logfile, _set_logfile, None)
132  
-
133  
-
134  
-    def _get_passes(self):
135  
-        """ Returns the passed tests. """
136  
-        return self.mozmill.passes
137  
-
138  
-    passes = property(_get_passes, None, None)
139  
-
140  
-
141  
-    def _get_persisted(self):
142  
-        """ Returns the persisted object. """
143  
-        return self.mozmill.persisted
144  
-
145  
-    def _set_persisted(self, value):
146  
-        """ Sets the persisted object. """
147  
-        self.mozmill.persisted = value
148  
-
149  
-    persisted = property(_get_persisted, _set_persisted, None)
150  
-
151  
-
152  
-    def _get_profile(self):
153  
-        """ Returns the path of the profile to use. """
154  
-        return self.options.profile
155  
-
156  
-    def _set_profile(self, value):
157  
-        """ Sets the path of the profile to use. """
158  
-        self.options.profile = value
159  
-
160  
-    profile = property(_get_profile, _set_profile, None)
161  
-
162  
-
163  
-    def _get_report(self):
164  
-        """ Returns the URL of the report server. """
165  
-        return self.options.report
166  
-
167  
-    def _set_report(self, value):
168  
-        """ Sets the URL of the report server. """
169  
-        self.options.report = value
170  
-
171  
-    report_url = property(_get_report, _set_report, None)
172  
-
173  
-
174  
-    def _get_shell(self):
175  
-        """ Returns if a Python shell has to be started. """
176  
-        return self.options.shell
177  
-
178  
-    def _set_shell(self, value):
179  
-        """ Sets if a Python shell has to be started. """
180  
-        self.options.shell = value
181  
-
182  
-    shell = property(_get_shell, _set_shell, None)
183  
-
184  
-
185  
-    def _get_showall(self):
186  
-        """ Returns if complete test output is wanted. """
187  
-        return self.options.showall
188  
-
189  
-    def _set_showall(self, value):
190  
-        """ Sets if complete test output is wanted. """
191  
-        self.options.showall = value
192  
-
193  
-    showall = property(_get_showall, _set_showall, None)
194  
-
195  
-
196  
-    def _get_showerrors(self):
197  
-        """ Returns if extended error output is wanted. """
198  
-        return self.options.showerrors
199  
-
200  
-    def _set_showerrors(self, value):
201  
-        """ Sets if extended error output is wanted. """
202  
-        self.options.showerrors = value
203  
-
204  
-    showerrors = property(_get_showerrors, _set_showerrors, None)
205  
-
206  
-
207  
-    def _get_skipped(self):
208  
-        """ Returns the skipped tests. """
209  
-        return self.mozmill.skipped
210  
-
211  
-    skipped = property(_get_skipped, None, None)
212  
-
213  
-
214  
-    def _get_jsbridge_port(self):
215  
-        """ Returns the global port value. """
216  
-        return self.mozmill.jsbridge_port
217  
-
218  
-    def _set_jsbridge_port(self, value):
219  
-        """ Sets if complete test output is wanted. """
220  
-        self.mozmill.jsbridge_port = value
221  
-
222  
-    jsbridge_port = property(_get_jsbridge_port, _set_jsbridge_port, None)
223  
-
224  
-
225  
-    def _get_jsbridge_timeout(self):
226  
-        """ Returns the global timeout value. """
227  
-        return self.mozmill.jsbridge_timeout
228  
-
229  
-    def _set_jsbridge_timeout(self, value):
230  
-        """ Sets if complete test output is wanted. """
231  
-        self.mozmill.jsbridge_timeout = value
232  
-
233  
-    jsbridge_timeout = property(_get_jsbridge_timeout, _set_jsbridge_timeout, None)
234  
-
235  
-
236  
-    def run(self, *args, **kwargs):
237  
-        """ Start the test-run. """
238  
-        self.mozmill.report_callback = self.report_callback
239  
-
240  
-        try:
241  
-            mozmill.CLI.run(self, *args, **kwargs)
242  
-        except SystemExit:
243  
-            # Mozmill itself calls sys.exit(1) but we do not want to exit
244  
-            pass
245  
-
246  
-
247  
-class MozmillWrapperRestartCLI(mozmill.RestartCLI, MozmillWrapperCLI):
248  
-    """ Wrapper class for the Mozmill RestartCLI class. """
249  
-
250  
-    mozmill_class = MozmillRestartWrapper
251  
-
252  
-    parser_options = copy.copy(MozmillWrapperCLI.parser_options)
253  
-
254  
-    def run(self, *args, **kwargs):
255  
-        """ Starts the test-run. """
256  
-        self.mozmill.report_callback = self.report_callback
257  
-
258  
-        try:
259  
-            mozmill.RestartCLI.run(self, *args, **kwargs)
260  
-        except SystemExit:
261  
-            # Mozmill itself calls sys.exit(1) but we do not want to exit
262  
-            pass
263  
-
264  
-
265  
-class ThunderbirdMozmillWrapperCLI(MozmillWrapperCLI):
266  
-    profile_class = mozrunner.ThunderbirdProfile
267  
-    runner_class = mozrunner.ThunderbirdRunner
268  
-
269  
-class ThunderbirdMozmillWrapperRestartCLI(MozmillWrapperRestartCLI):
270  
-    profile_class = mozrunner.ThunderbirdProfile
271  
-    runner_class = mozrunner.ThunderbirdRunner
22  libs/scraper.py
@@ -18,7 +18,7 @@
18 18
 # the Initial Developer. All Rights Reserved.
19 19
 #
20 20
 # Contributor(s):
21  
-# Henrik Skupin <hskupin@mozilla.com>
  21
+#   Henrik Skupin <hskupin@mozilla.com>
22 22
 #
23 23
 # Alternatively, the contents of this file may be used under the terms of
24 24
 # either the GNU General Public License Version 2 or later (the "GPL"), or
@@ -48,7 +48,7 @@
48 48
 
49 49
 
50 50
 # Base URL for the path to all builds
51  
-BASE_URL = 'http://stage.mozilla.org/pub/mozilla.org'
  51
+BASE_URL = 'https://ftp.mozilla.org/pub/mozilla.org'
52 52
 
53 53
 PLATFORM_FRAGMENTS = {'linux': 'linux-i686',
54 54
                       'linux64': 'linux-x86_64',
@@ -459,7 +459,7 @@ def get_build_info_for_version(self, version, build_index=None):
459 459
     @property
460 460
     def candidate_build_list_regex(self):
461 461
         """Return the regex for the folder which contains the builds of
462  
-a candidate build."""
  462
+           a candidate build."""
463 463
 
464 464
         # Regex for possible builds for the given date
465 465
         return r'nightly/%(VERSION)s-candidates/' % {
@@ -512,11 +512,11 @@ def download(self):
512 512
 class TinderboxScraper(MozillaScraper):
513 513
     """Class to download a tinderbox build from the Mozilla server.
514 514
 
515  
-There are two ways to specify a unique build:
516  
-1. If the date (%Y-%m-%d) is given and build_number is given where
517  
-the build_number is the index of the build on the date
518  
-2. If the build timestamp (UNIX) is given, and matches a specific build.
519  
-"""
  515
+    There are two ways to specify a unique build:
  516
+    1. If the date (%Y-%m-%d) is given and build_number is given where
  517
+       the build_number is the index of the build on the date
  518
+    2. If the build timestamp (UNIX) is given, and matches a specific build.
  519
+    """
520 520
 
521 521
     def __init__(self, branch='mozilla-central', build_number=None, date=None,
522 522
                  debug_build=False, *args, **kwargs):
@@ -682,8 +682,8 @@ def platform_regex(self):
682 682
 
683 683
 class PacificTimezone(tzinfo):
684 684
     """Class to set the timezone to PST/PDT and automatically adjusts
685  
-for daylight saving.
686  
-"""
  685
+    for daylight saving.
  686
+    """
687 687
 
688 688
     def utcoffset(self, dt):
689 689
         return timedelta(hours=-8) + self.dst(dt)
@@ -710,4 +710,4 @@ def first_sunday(self, year, month):
710 710
         date = datetime(year, month, 1, 0)
711 711
         days_until_sunday = 6 - date.weekday()
712 712
 
713  
-        return date + timedelta(days=days_until_sunday)
  713
+        return date + timedelta(days=days_until_sunday)
21  libs/testrun.py
@@ -18,9 +18,9 @@
18 18
 # the Initial Developer. All Rights Reserved.
19 19
 #
20 20
 # Contributor(s):
21  
-# Henrik Skupin <hskupin@mozilla.com>
22  
-# Dave Hunt <dhunt@mozilla.com>
23  
-# Aaron Train <atrain@mozilla.com>
  21
+#   Henrik Skupin <hskupin@mozilla.com>
  22
+#   Dave Hunt <dhunt@mozilla.com>
  23
+#   Aaron Train <atrain@mozilla.com>
24 24
 #
25 25
 # Alternatively, the contents of this file may be used under the terms of
26 26
 # either the GNU General Public License Version 2 or later (the "GPL"), or
@@ -160,8 +160,7 @@ def __init__(self, args=sys.argv[1:], debug=False, repository_path=None,
160 160
     def _generate_custom_report(self):
161 161
         if self.options.junit_file:
162 162
             filename = self._get_unique_filename(self.options.junit_file)
163  
-            custom_report = self.update_report(self._mozmill.mozmill.get_report())
164  
-            report.JUnitReport(custom_report, filename)
  163
+            report.JUnitReport(self._mozmill.mozmill.get_report(), filename)
165 164
 
166 165
     def _get_binaries(self):
167 166
         """ Returns the list of binaries to test. """
@@ -730,11 +729,11 @@ def run_tests(self):
730 729
 
731 730
         # Don't execute non-restart tests until we have tests available
732 731
         #try:
733  
-        # self.restart_tests = False
734  
-        # self.test_path = os.path.join('tests', 'remote')
735  
-        # TestRun.run_tests(self)
  732
+        #    self.restart_tests = False
  733
+        #    self.test_path = os.path.join('tests', 'remote')
  734
+        #    TestRun.run_tests(self)
736 735
         #except Exception, e:
737  
-        # print str(e)
  736
+        #    print str(e)
738 737
 
739 738
         try:
740 739
             self.restart_tests = True
@@ -777,7 +776,7 @@ def __init__(self, *args, **kwargs):
777 776
 
778 777
     def build_wiki_entry(self, result):
779 778
         """ Until we show results on the dashboard create a wiki like output
780  
-format for data from the first and last update performed """
  779
+            format for data from the first and last update performed """
781 780
 
782 781
         first_update = result["updates"][0]
783 782
         last_update = result["updates"][-1]
@@ -916,4 +915,4 @@ def update_report(self, report):
916 915
       TestRun.update_report(self, report)
917 916
       report['updates'] = self._mozmill.mozmill.persisted['updates']
918 917
 
919  
-      return report
  918
+      return report

0 notes on commit 0afc1e4

Please sign in to comment.
Something went wrong with that request. Please try again.