Changeset 244551 in webkit


Ignore:
Timestamp:
Apr 23, 2019 11:02:55 AM (5 years ago)
Author:
aakash_jain@apple.com
Message:

[ews-build] Add unit tests for UnApplyPatchIfRequired
https://bugs.webkit.org/show_bug.cgi?id=197197

Reviewed by Lucas Forschler.

  • BuildSlaveSupport/ews-build/steps_unittest.py:

(TestUnApplyPatchIfRequired):
(TestUnApplyPatchIfRequired.test_success):
(TestUnApplyPatchIfRequired.test_failure):
(TestUnApplyPatchIfRequired.test_skip):

Location:
trunk/Tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/BuildSlaveSupport/ews-build/steps_unittest.py

    r244550 r244551  
    864864        )
    865865        self.expectOutcome(result=FAILURE, state_string='Cleaned working directory (failure)')
     866        return self.runStep()
     867
     868
     869class TestUnApplyPatchIfRequired(BuildStepMixinAdditions, unittest.TestCase):
     870    def setUp(self):
     871        self.longMessage = True
     872        return self.setUpBuildStep()
     873
     874    def tearDown(self):
     875        return self.tearDownBuildStep()
     876
     877    def test_success(self):
     878        self.setupStep(UnApplyPatchIfRequired())
     879        self.setProperty('patchFailedToBuild', True)
     880        self.expectHidden(False)
     881        self.expectRemoteCommands(
     882            ExpectShell(workdir='wkdir',
     883                        command=['Tools/Scripts/clean-webkit'],
     884                        )
     885            + 0,
     886        )
     887        self.expectOutcome(result=SUCCESS, state_string='Unapplied patch')
     888        return self.runStep()
     889
     890    def test_failure(self):
     891        self.setupStep(UnApplyPatchIfRequired())
     892        self.setProperty('patchFailedToBuild', True)
     893        self.expectHidden(False)
     894        self.expectRemoteCommands(
     895            ExpectShell(workdir='wkdir',
     896                        command=['Tools/Scripts/clean-webkit'],
     897                        )
     898            + ExpectShell.log('stdio', stdout='Unexpected failure.')
     899            + 2,
     900        )
     901        self.expectOutcome(result=FAILURE, state_string='Unapplied patch (failure)')
     902        return self.runStep()
     903
     904    def test_skip(self):
     905        self.setupStep(UnApplyPatchIfRequired())
     906        self.expectHidden(True)
     907        self.expectOutcome(result=SKIPPED, state_string='Unapplied patch (skipped)')
    866908        return self.runStep()
    867909
  • trunk/Tools/ChangeLog

    r244550 r244551  
     12019-04-23  Aakash Jain  <aakash_jain@apple.com>
     2
     3        [ews-build] Add unit tests for UnApplyPatchIfRequired
     4        https://bugs.webkit.org/show_bug.cgi?id=197197
     5
     6        Reviewed by Lucas Forschler.
     7
     8        * BuildSlaveSupport/ews-build/steps_unittest.py:
     9        (TestUnApplyPatchIfRequired):
     10        (TestUnApplyPatchIfRequired.test_success):
     11        (TestUnApplyPatchIfRequired.test_failure):
     12        (TestUnApplyPatchIfRequired.test_skip):
     13
    1142019-04-23  Aakash Jain  <aakash_jain@apple.com>
    215
Note: See TracChangeset for help on using the changeset viewer.