Changeset 63 for mergebot


Ignore:
Timestamp:
Feb 23, 2010 10:31:16 PM (15 years ago)
Author:
retracile
Message:

Mergebot: add testcases to cover property related delete/modify conflicts

File:
1 edited

Legend:

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

    r62 r63  
    256256        self.assertEqual(retval, 0, "svn prposet failed with error %s" % (retval))
    257257       
     258    def propdel(self, propname, filename):
     259        retval = call(['svn', 'propdel', propname, filename],
     260            cwd=self.get_workdir(),
     261            stdout=logfile, stderr=logfile)
     262        self.assertEqual(retval, 0, "svn prposet failed with error %s" % (retval))
    258263
    259264
     
    397402
    398403
     404class MergeBotTestMergeWithPropertyBranchDeleteConflict(FunctionalSvnTestCaseSetup):
     405    def runTest(self):
     406        """Verify that the 'merge' button detects property deleted on branch and modified on trunk"""
     407        ticket_id = self._tester.create_ticket(summary=self.__class__.__name__,
     408            info={'component':'stuff', 'version':'trunk'})
     409        basename = self.__class__.__name__
     410
     411        self.checkout()
     412        self.propset('svn:ignore', basename, '.')
     413        self.commit('set property on trunk')
     414
     415        # create the branch
     416        self._tester.branch(ticket_id, 'stuff')
     417
     418        # modify the property on trunk
     419        self.propset('svn:ignore', basename + '\ntrunk', '.')
     420        self.commit('Modify the property on trunk')
     421
     422        # delete the property on the branch
     423        self.switch(ticket_id)
     424        self.propdel('svn:ignore', '.')
     425        self.commit('Delete the property on branch')
     426
     427        # merge, make sure it shows a conflict
     428        self._tester.merge_conflict(ticket_id, 'stuff')
     429
     430
     431class MergeBotTestMergeWithPropertyTrunkDeleteConflict(FunctionalSvnTestCaseSetup):
     432    def runTest(self):
     433        """Verify that the 'merge' button detects property deleted on trunk and modified on branch"""
     434        ticket_id = self._tester.create_ticket(summary=self.__class__.__name__,
     435            info={'component':'stuff', 'version':'trunk'})
     436        basename = self.__class__.__name__
     437
     438        self.checkout()
     439        self.propset('svn:ignore', basename, '.')
     440        self.commit('set property on trunk')
     441
     442        # create the branch
     443        self._tester.branch(ticket_id, 'stuff')
     444
     445        # delete the property on trunk
     446        self.propdel('svn:ignore', '.')
     447        self.commit('Delete the property on trunk')
     448
     449        # delete the property on the branch
     450        self.switch(ticket_id)
     451        self.propset('svn:ignore', basename + '\nbranch', '.')
     452        self.commit('Modify the property on branch')
     453
     454        # merge, make sure it shows a conflict
     455        self._tester.merge_conflict(ticket_id, 'stuff')
     456
     457
    399458class MergeBotTestMergeWithBranchRenameConflict(FunctionalSvnTestCaseSetup):
    400459    def runTest(self):
     
    544603
    545604        # modify the property on the branch
     605        self.switch(ticket_id)
     606        self.propset('svn:ignore', basename + '\nbranch', '.')
     607        self.commit('Modify the property on branch')
     608
     609        # rebranch, make sure it shows a conflict
     610        self._tester.rebranch_conflict(ticket_id, 'stuff')
     611
     612
     613class MergeBotTestRebranchWithPropertyBranchDeleteConflict(FunctionalSvnTestCaseSetup):
     614    def runTest(self):
     615        """Verify that the 'rebranch' button detects property deleted on branch and modified on trunk"""
     616        ticket_id = self._tester.create_ticket(summary=self.__class__.__name__,
     617            info={'component':'stuff', 'version':'trunk'})
     618        basename = self.__class__.__name__
     619
     620        self.checkout()
     621        self.propset('svn:ignore', basename, '.')
     622        self.commit('set property on trunk')
     623
     624        # create the branch
     625        self._tester.branch(ticket_id, 'stuff')
     626
     627        # modify the property on trunk
     628        self.propset('svn:ignore', basename + '\ntrunk', '.')
     629        self.commit('Modify the property on trunk')
     630
     631        # delete the property on the branch
     632        self.switch(ticket_id)
     633        self.propdel('svn:ignore', '.')
     634        self.commit('Delete the property on branch')
     635
     636        # rebranch, make sure it shows a conflict
     637        self._tester.rebranch_conflict(ticket_id, 'stuff')
     638
     639
     640class MergeBotTestRebranchWithPropertyTrunkDeleteConflict(FunctionalSvnTestCaseSetup):
     641    def runTest(self):
     642        """Verify that the 'rebranch' button detects property deleted on trunk and modified on branch"""
     643        ticket_id = self._tester.create_ticket(summary=self.__class__.__name__,
     644            info={'component':'stuff', 'version':'trunk'})
     645        basename = self.__class__.__name__
     646
     647        self.checkout()
     648        self.propset('svn:ignore', basename, '.')
     649        self.commit('set property on trunk')
     650
     651        # create the branch
     652        self._tester.branch(ticket_id, 'stuff')
     653
     654        # delete the property on trunk
     655        self.propdel('svn:ignore', '.')
     656        self.commit('Delete the property on trunk')
     657
     658        # delete the property on the branch
    546659        self.switch(ticket_id)
    547660        self.propset('svn:ignore', basename + '\nbranch', '.')
     
    651764    suite.addTest(MergeBotTestRebranchWithBranchRenameConflict())
    652765    suite.addTest(MergeBotTestRebranchWithTrunkRenameConflict())
     766    suite.addTest(MergeBotTestRebranchWithPropertyBranchDeleteConflict())
     767    suite.addTest(MergeBotTestRebranchWithPropertyTrunkDeleteConflict())
    653768    suite.addTest(MergeBotTestMergeWithChange())
    654769    suite.addTest(MergeBotTestMergeWithChangeAndTrunkChange())
     
    657772    suite.addTest(MergeBotTestMergeWithBranchRenameConflict())
    658773    suite.addTest(MergeBotTestMergeWithTrunkRenameConflict())
     774    suite.addTest(MergeBotTestMergeWithPropertyBranchDeleteConflict())
     775    suite.addTest(MergeBotTestMergeWithPropertyTrunkDeleteConflict())
    659776    suite.addTest(MergeBotTestSingleUseCase())
    660777    return suite
Note: See TracChangeset for help on using the changeset viewer.