Changeset 44 for mergebot/trunk


Ignore:
Timestamp:
Feb 23, 2010 3:30:08 PM (15 years ago)
Author:
retracile
Message:

Mergebot: working on the tests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • mergebot/trunk/utils/test.py

    r41 r44  
    5252    # FIXME: the tc.find( <various actions> ) checks are bogus: any ticket can
    5353    # satisfy them, not just the one we're working on.
    54     def __init__(self, *args, **kwargs):
    55         FunctionalTester.__init__(self, *args, **kwargs)
     54    def __init__(self, trac_url, repo_url):
     55        FunctionalTester.__init__(self, trac_url)
     56        self.repo_url = repo_url
    5657        self.mergeboturl = self.url + '/mergebot'
    5758
     
    8889        tc.formvalue('ops-%s' % ticket_id, 'ticket', ticket_id) # Essentially a noop to select the right form
    8990        tc.submit('Branch')
    90         self.wait_until_notfind('Doing branch', timeout)
     91        self.wait_until_find('Nothing in the queue', timeout)
    9192        tc.find('Rebranch')
    9293        tc.find('Merge')
     
    99100            raise Exception('svn ls failed with exit code %s' % retval)
    100101
    101     def rebranch(self, ticket_id, component, timeout=5):
    102         """timeout is in seconds."""
    103         self.go_to_mergebot()
    104         tc.formvalue('ops-%s' % ticket_id, 'ticket', ticket_id) # Essentially a noop to select the right form
     102    def rebranch(self, ticket_id, component, timeout=15):
     103        """timeout is in seconds."""
     104        self.go_to_mergebot()
     105        tc.formvalue('ops-%s' % ticket_id, 'ticket', ticket_id) # Essentially a noop to select the right form
     106        print "submitting rebranch request for %s" % (ticket_id)
    105107        tc.submit('Rebranch')
    106         self.wait_until_notfind('Doing rebranch', timeout)
     108        self.wait_until_find('Nothing in the queue', timeout)
    107109        tc.find('Rebranch')
    108110        tc.find('Merge')
     
    120122        tc.formvalue('ops-%s' % ticket_id, 'ticket', ticket_id) # Essentially a noop to select the right form
    121123        tc.submit('Merge')
    122         self.wait_until_notfind('Doing merge', timeout)
     124        self.wait_until_find('Nothing in the queue', timeout)
    123125        tc.find('Branch')
    124126        self.go_to_ticket(ticket_id)
     
    135137        tc.formvalue('ops-%s' % ticket_id, 'ticket', ticket_id) # Essentially a noop to select the right form
    136138        tc.submit('CheckMerge')
    137         self.wait_until_notfind('Doing checkmerge', timeout)
     139        self.wait_until_find('Nothing in the queue', timeout)
    138140        tc.find('Rebranch')
    139141        tc.find('Merge')
     
    158160        env.config.set('components', 'mergebot.web_ui.mergebotmodule', 'enabled')
    159161        env.config.save()
     162        os.mkdir(os.path.join("testenv%s" % port, 'trac', 'mergebot'))
    160163        self._testenv._tracadmin('upgrade') # sets up the bulk of the mergebot config
    161164        env.config.parse_if_needed()
     
    166169
    167170        self._testenv.start()
    168         self._tester = MergeBotFunctionalTester(baseurl)
     171        self._tester = MergeBotFunctionalTester(baseurl, self._testenv.repo_url())
    169172        self.fixture = (self._testenv, self._tester)
    170173
     
    193196        tc.url(mergeboturl)
    194197        tc.notfind('No handler matched request to /mergebot')
    195 
    196 
    197 class MergeBotTestQueueList(FunctionalTwillTestCaseSetup):
    198     def runTest(self):
    199         tc.follow('MergeBot')
    200         for queue in 'branch', 'rebranch', 'checkmerge', 'merge':
    201             tc.find('%s Queue' % queue)
    202198
    203199
     
    281277    suite = MergeBotTestSuite()
    282278    suite.addTest(MergeBotTestEnabled())
    283     suite.addTest(MergeBotTestQueueList())
    284279    suite.addTest(MergeBotTestNoVersion())
    285280    suite.addTest(MergeBotTestBranch())
    286     suite.addTest(MergeBotTestRebranch())
    287     suite.addTest(MergeBotTestMerge())
     281    #suite.addTest(MergeBotTestRebranch())
    288282    suite.addTest(MergeBotTestCheckMerge())
    289283    suite.addTest(MergeBotTestSingleUseCase())
     284    suite.addTest(MergeBotTestMerge())
    290285    return suite
    291286
Note: See TracChangeset for help on using the changeset viewer.