Changeset 55970 in webkit
- Timestamp:
- Mar 13, 2010 2:36:30 PM (14 years ago)
- Location:
- trunk/WebKitTools
- Files:
-
- 3 added
- 3 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKitTools/ChangeLog
r55969 r55970 1 2010-03-13 Chris Jerdonek <cjerdonek@webkit.org> 2 3 Reviewed by Adam Barth. 4 5 The test-webkitpy script now warns the user if the script is 6 being run using a Python version different from the minimum 7 version the webkitpy package was meant to support. 8 9 https://bugs.webkit.org/show_bug.cgi?id=35788 10 11 Warning developers if their Python version is too low will help 12 them understand why test-webkitpy is failing. Secondly, warning 13 developers if their Python version is higher than the minimum will 14 help them understand that their changes may not be okay for the 15 minimum supported version, even if test-webkitpy is passing. 16 17 * Scripts/test-webkitpy: 18 - Moved the "from ..._unittest import *" lines to the new 19 file Scripts/webkitpy/unittests.py. This will allow the 20 version-check warning to be displayed even if an error occurs 21 while interpreting (i.e. importing) the unit test code. 22 - Added configure_logging() to configur logging for test-webkitpy. 23 - Added an init() method to configure logging and check the 24 current Python version. 25 26 * Scripts/webkitpy/init/unittests.py: Added. 27 - Added a file to import all unit test modules in the 28 webkitpy.init package. 29 30 * Scripts/webkitpy/init/versioning.py: Added. 31 - Added a _MINIMUM_SUPPORTED_PYTHON_VERSION variable and set 32 it equal to 2.5. 33 - Added a compare_version() method to compare the current Python 34 version against a target version. 35 - Added a check_version() method to check the current Python 36 version against the current minimum supported version, and to 37 log a warning message if the check fails. 38 39 * Scripts/webkitpy/init/versioning_unittest.py: Added. 40 - Added unit tests for the functions in versioning.py. 41 42 * Scripts/webkitpy/style/unittests.py: 43 - Fixed/updated a code comment. 44 45 * Scripts/webkitpy/unittests.py: Added. 46 - Moved the "from ..._unittest import *" lines from test-webkitpy. 47 1 48 2010-03-13 Chris Jerdonek <cjerdonek@webkit.org> 2 49 -
trunk/WebKitTools/Scripts/test-webkitpy
r54830 r55970 1 1 #!/usr/bin/env python 2 2 # Copyright (c) 2009 Google Inc. All rights reserved. 3 # Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org) 3 4 # 4 5 # Redistribution and use in source and binary forms, with or without … … 28 29 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 30 31 import logging 30 32 import sys 31 33 import unittest 32 34 33 from webkitpy.bugzilla_unittest import * 34 from webkitpy.buildbot_unittest import * 35 from webkitpy.changelogs_unittest import * 36 from webkitpy.commands.download_unittest import * 37 from webkitpy.commands.early_warning_system_unittest import * 38 from webkitpy.commands.openbugs_unittest import OpenBugsTest 39 from webkitpy.commands.upload_unittest import * 40 from webkitpy.commands.queries_unittest import * 41 from webkitpy.commands.queues_unittest import * 42 from webkitpy.committers_unittest import * 43 from webkitpy.credentials_unittest import * 44 from webkitpy.diff_parser_unittest import * 45 from webkitpy.executive_unittest import * 46 from webkitpy.grammar_unittest import * 47 from webkitpy.layout_tests.port.mac_unittest import * 48 from webkitpy.multicommandtool_unittest import * 49 from webkitpy.networktransaction_unittest import * 50 from webkitpy.patchcollection_unittest import * 51 from webkitpy.queueengine_unittest import * 52 from webkitpy.steps.steps_unittest import * 53 from webkitpy.steps.closebugforlanddiff_unittest import * 54 from webkitpy.steps.updatechangelogswithreview_unittests import * 55 from webkitpy.style.unittests import * # for check-webkit-style 56 from webkitpy.user_unittest import * 57 from webkitpy.webkit_logging_unittest import * 58 from webkitpy.webkitport_unittest import * 35 import webkitpy.init.versioning as versioning 36 37 _log = logging.getLogger("test-webkitpy") 38 39 40 def configure_logging(): 41 """Configure the root logger to log info messages and above.""" 42 handler = logging.StreamHandler(sys.stderr) 43 formatter = logging.Formatter("[%(levelname)s] %(name)s: %(message)s") 44 handler.setFormatter(formatter) 45 46 logger = logging.getLogger() 47 logger.setLevel(logging.INFO) 48 logger.addHandler(handler) 49 50 51 def init(): 52 """Execute code prior to importing from webkitpy.unittests.""" 53 configure_logging() 54 55 versioning.check_version() 56 57 (comparison, current_version, minimum_version) = \ 58 versioning.compare_version() 59 60 if comparison > 0: 61 # Then the current version is later than the minimum version. 62 message = ("You are testing webkitpy with a Python version (%s) " 63 "higher than the minimum version (%s) it was meant " 64 "to support." % (current_version, minimum_version)) 65 _log.warn(message) 66 59 67 60 68 if __name__ == "__main__": 61 # FIXME: This is a hack, but I'm tired of commenting out the test.62 # See https://bugs.webkit.org/show_bug.cgi?id=3181863 if len(sys.argv) > 1 and sys.argv[1] == "--all":64 sys.argv.remove("--all")65 from webkitpy.scm_unittest import *66 69 70 init() 71 72 # We import the unit test code after init() to ensure that any 73 # Python version warnings are displayed in case an error occurs 74 # while interpreting webkitpy.unittests. This also allows 75 # logging to be configured prior to importing -- for example to 76 # enable the display of autoinstall logging.log messages while 77 # running the unit tests. 78 from webkitpy.unittests import * 79 80 # Runs the unit tests. 67 81 unittest.main() -
trunk/WebKitTools/Scripts/webkitpy/style/unittests.py
r55361 r55970 31 31 """Runs style package unit tests.""" 32 32 33 # This module is imported by t est-webkitpy.33 # This module is imported by the module that imports all webkitpy unit tests. 34 34 35 35 import sys -
trunk/WebKitTools/Scripts/webkitpy/unittests.py
r55969 r55970 5 5 # modification, are permitted provided that the following conditions are 6 6 # met: 7 # 7 # 8 8 # * Redistributions of source code must retain the above copyright 9 9 # notice, this list of conditions and the following disclaimer. … … 15 15 # contributors may be used to endorse or promote products derived from 16 16 # this software without specific prior written permission. 17 # 17 # 18 18 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 19 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT … … 28 28 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 29 30 # This module is imported by Scripts/test-webkitpy. 31 30 32 import sys 31 import unittest32 33 33 34 from webkitpy.bugzilla_unittest import * … … 45 46 from webkitpy.executive_unittest import * 46 47 from webkitpy.grammar_unittest import * 48 from webkitpy.init.unittests import * # for the webkitpy.init package 47 49 from webkitpy.layout_tests.port.mac_unittest import * 48 50 from webkitpy.multicommandtool_unittest import * … … 53 55 from webkitpy.steps.closebugforlanddiff_unittest import * 54 56 from webkitpy.steps.updatechangelogswithreview_unittests import * 55 from webkitpy.style.unittests import * # for check-webkit-style57 from webkitpy.style.unittests import * # for the webkitpy.style package 56 58 from webkitpy.user_unittest import * 57 59 from webkitpy.webkit_logging_unittest import * 58 60 from webkitpy.webkitport_unittest import * 59 61 60 if __name__ == "__main__": 61 # FIXME: This is a hack, but I'm tired of commenting out the test. 62 # See https://bugs.webkit.org/show_bug.cgi?id=31818 63 if len(sys.argv) > 1 and sys.argv[1] == "--all": 64 sys.argv.remove("--all") 65 from webkitpy.scm_unittest import * 66 67 unittest.main() 62 # FIXME: This is a hack, but I'm tired of commenting out the test. 63 # See https://bugs.webkit.org/show_bug.cgi?id=31818 64 if len(sys.argv) > 1 and sys.argv[1] == "--all": 65 sys.argv.remove("--all") 66 from webkitpy.scm_unittest import *
Note: See TracChangeset
for help on using the changeset viewer.