Commit 804478e1 authored by eric@webkit.org's avatar eric@webkit.org
Browse files

2009-12-02 Eric Seidel <eric@webkit.org>

        Reviewed by Adam Barth.

        trim commands/*.py includes now that commands are unit tested
        https://bugs.webkit.org/show_bug.cgi?id=32056

        In the course of ensuring that the unit tests still
        passed after this change, I had to actually make them
        pass in the first place.

        * Scripts/modules/bugzilla.py:
         - Fix _parse_attachment_ids_request_query to return ints instead of strings.
        * Scripts/modules/commands/download.py: Remove unneeded imports.
        * Scripts/modules/commands/queries.py: Ditto.
        * Scripts/modules/commands/queues.py: Ditto.
        * Scripts/modules/commands/upload.py: Ditto.
        * Scripts/modules/scm_unittest.py:
         - Fix to expect the \n after the path since echo adds an \n.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@51590 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 35d8c016
2009-12-02 Eric Seidel <eric@webkit.org>
Reviewed by Adam Barth.
trim commands/*.py includes now that commands are unit tested
https://bugs.webkit.org/show_bug.cgi?id=32056
In the course of ensuring that the unit tests still
passed after this change, I had to actually make them
pass in the first place.
* Scripts/modules/bugzilla.py:
- Fix _parse_attachment_ids_request_query to return ints instead of strings.
* Scripts/modules/commands/download.py: Remove unneeded imports.
* Scripts/modules/commands/queries.py: Ditto.
* Scripts/modules/commands/queues.py: Ditto.
* Scripts/modules/commands/upload.py: Ditto.
* Scripts/modules/scm_unittest.py:
- Fix to expect the \n after the path since echo adds an \n.
2009-12-01 Yaar Schnitman <yaar@chromium.org>
build-webkit: Remove flex,bison,gperf check for chromium
......
......@@ -32,12 +32,16 @@
import os
from modules.bugzilla import Bugzilla
from modules.buildbot import BuildBot
from modules.buildsteps import BuildSteps
from modules.commands.download import *
from modules.commands.queries import *
from modules.commands.queues import *
from modules.commands.upload import *
from modules.logging import log
from modules.multicommandtool import MultiCommandTool
from modules.scm import detect_scm_system
class BugzillaTool(MultiCommandTool):
def __init__(self):
......
......@@ -313,7 +313,7 @@ class Bugzilla:
digits = re.compile("\d+")
attachment_href = re.compile("attachment.cgi\?id=\d+&action=review")
attachment_links = SoupStrainer("a", href=attachment_href)
return [digits.search(tag["href"]).group(0) for tag in BeautifulSoup(page, parseOnlyThese=attachment_links)]
return [int(digits.search(tag["href"]).group(0)) for tag in BeautifulSoup(page, parseOnlyThese=attachment_links)]
def _fetch_attachment_ids_request_query(self, query):
return self._parse_attachment_ids_request_query(urllib2.urlopen(query))
......
......@@ -28,31 +28,19 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# FIXME: Trim down this import list once we have unit tests.
import os
import re
import StringIO
import subprocess
import sys
import time
from datetime import datetime, timedelta
from optparse import make_option
from modules.bugzilla import Bugzilla, parse_bug_id
from modules.buildbot import BuildBot
from modules.bugzilla import parse_bug_id
from modules.buildsteps import BuildSteps
from modules.changelogs import ChangeLog
from modules.comments import bug_comment_from_commit_text
from modules.grammar import pluralize
from modules.landingsequence import LandingSequence, ConditionalLandingSequence
from modules.logging import error, log, tee
from modules.multicommandtool import MultiCommandTool, Command
from modules.patchcollection import PatchCollection
from modules.scm import CommitMessage, detect_scm_system, ScriptError, CheckoutNeedsUpdate
from modules.statusbot import StatusBot
from modules.webkitport import WebKitPort
from modules.workqueue import WorkQueue, WorkQueueDelegate
from modules.logging import error, log
from modules.multicommandtool import Command
from modules.scm import ScriptError
class BuildSequence(ConditionalLandingSequence):
......
......@@ -28,30 +28,12 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# FIXME: Trim down this import list once we have unit tests.
import os
import re
import StringIO
import subprocess
import sys
import time
from datetime import datetime, timedelta
from optparse import make_option
from modules.bugzilla import Bugzilla, parse_bug_id
from modules.buildbot import BuildBot
from modules.changelogs import ChangeLog
from modules.comments import bug_comment_from_commit_text
from modules.grammar import pluralize
from modules.landingsequence import LandingSequence, ConditionalLandingSequence
from modules.logging import error, log, tee
from modules.multicommandtool import MultiCommandTool, Command
from modules.patchcollection import PatchCollection
from modules.scm import CommitMessage, detect_scm_system, ScriptError, CheckoutNeedsUpdate
from modules.statusbot import StatusBot
from modules.webkitport import WebKitPort
from modules.workqueue import WorkQueue, WorkQueueDelegate
from modules.logging import log
from modules.multicommandtool import Command
class BugsToCommit(Command):
name = "bugs-to-commit"
......
......@@ -28,28 +28,18 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# FIXME: Trim down this import list once we have unit tests.
import os
import re
import StringIO
import subprocess
import sys
import time
from datetime import datetime, timedelta
from datetime import datetime
from optparse import make_option
from modules.bugzilla import Bugzilla, parse_bug_id
from modules.buildbot import BuildBot
from modules.changelogs import ChangeLog
from modules.comments import bug_comment_from_commit_text
from modules.grammar import pluralize
from modules.landingsequence import LandingSequence, ConditionalLandingSequence, LandingSequenceErrorHandler
from modules.logging import error, log, tee
from modules.multicommandtool import MultiCommandTool, Command
from modules.logging import error, log
from modules.multicommandtool import Command
from modules.patchcollection import PatchCollection, PersistentPatchCollection, PersistentPatchCollectionDelegate
from modules.processutils import run_and_throw_if_fail
from modules.scm import CommitMessage, detect_scm_system, ScriptError, CheckoutNeedsUpdate
from modules.scm import ScriptError
from modules.statusbot import StatusBot
from modules.webkitport import WebKitPort
from modules.workqueue import WorkQueue, WorkQueueDelegate
......
......@@ -28,30 +28,16 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# FIXME: Trim down this import list once we have unit tests.
import os
import re
import StringIO
import subprocess
import sys
import time
from datetime import datetime, timedelta
from optparse import make_option
from modules.bugzilla import Bugzilla, parse_bug_id
from modules.buildbot import BuildBot
from modules.changelogs import ChangeLog
from modules.comments import bug_comment_from_commit_text
from modules.bugzilla import parse_bug_id
from modules.grammar import pluralize
from modules.landingsequence import LandingSequence, ConditionalLandingSequence
from modules.logging import error, log, tee
from modules.multicommandtool import MultiCommandTool, Command
from modules.patchcollection import PatchCollection
from modules.scm import CommitMessage, detect_scm_system, ScriptError, CheckoutNeedsUpdate
from modules.statusbot import StatusBot
from modules.webkitport import WebKitPort
from modules.workqueue import WorkQueue, WorkQueueDelegate
from modules.logging import error, log
from modules.multicommandtool import Command
# FIXME: Requires unit test.
class CommitMessageForCurrentDiff(Command):
......
......@@ -403,7 +403,7 @@ class SVNTest(SCMTest):
scripts_path = os.path.join(self.svn_checkout_path, 'WebKitTools', 'Scripts')
os.makedirs(scripts_path)
create_patch_path = os.path.join(scripts_path, 'svn-create-patch')
write_into_file_at_path(create_patch_path, '#!/bin/sh\necho $PWD')
write_into_file_at_path(create_patch_path, '#!/bin/sh\necho $PWD') # We could pass -n to prevent the \n, but not all echo accept -n.
os.chmod(create_patch_path, stat.S_IXUSR | stat.S_IRUSR)
# Change into our test directory and run the create_patch command.
......@@ -412,7 +412,7 @@ class SVNTest(SCMTest):
self.assertEqual(scm.checkout_root, self.svn_checkout_path) # Sanity check that detection worked right.
patch_contents = scm.create_patch()
# Our fake 'svn-create-patch' returns $PWD instead of a patch, check that it was executed from the root of the repo.
self.assertEqual(os.path.realpath(scm.checkout_root), patch_contents)
self.assertEqual("%s\n" % os.path.realpath(scm.checkout_root), patch_contents) # Add a \n because echo adds a \n.
def test_detection(self):
scm = detect_scm_system(self.svn_checkout_path)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment