Changeset 246793 in webkit


Ignore:
Timestamp:
Jun 25, 2019 9:17:43 AM (5 years ago)
Author:
aakash_jain@apple.com
Message:

[ews-build] UploadTestResults and ExtractTestResults clobber results in case of multiple layout test runs in a build
https://bugs.webkit.org/show_bug.cgi?id=199178

Reviewed by Jonathan Bedard.

  • BuildSlaveSupport/ews-build/steps.py:

(UploadTestResults.init): Add an optional identifier and append the identifier to the file name.
(ExtractTestResults.init): Ditto.

  • BuildSlaveSupport/ews-build/steps_unittest.py: Added unit tests.
Location:
trunk/Tools
Files:
3 edited

Legend:

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

    r246737 r246793  
    10831083    descriptionDone = ['Uploaded test results']
    10841084    workersrc = 'layout-test-results.zip'
    1085     masterdest = Interpolate('public_html/results/%(prop:buildername)s/r%(prop:patch_id)s-%(prop:buildnumber)s.zip')
    10861085    haltOnFailure = True
    10871086
    1088     def __init__(self, **kwargs):
     1087    def __init__(self, identifier='', **kwargs):
     1088        if identifier and not identifier.startswith('-'):
     1089            identifier = '-{}'.format(identifier)
    10891090        kwargs['workersrc'] = self.workersrc
    1090         kwargs['masterdest'] = self.masterdest
     1091        kwargs['masterdest'] = Interpolate('public_html/results/%(prop:buildername)s/r%(prop:patch_id)s-%(prop:buildnumber)s{}.zip'.format(identifier))
    10911092        kwargs['mode'] = 0644
    10921093        kwargs['blocksize'] = 1024 * 256
     
    10961097class ExtractTestResults(master.MasterShellCommand):
    10971098    name = 'extract-test-results'
    1098     zipFile = Interpolate('public_html/results/%(prop:buildername)s/r%(prop:patch_id)s-%(prop:buildnumber)s.zip')
    1099     resultDirectory = Interpolate('public_html/results/%(prop:buildername)s/r%(prop:patch_id)s-%(prop:buildnumber)s')
    1100 
    11011099    descriptionDone = ['Extracted test results']
    1102     command = ['unzip', zipFile, '-d', resultDirectory]
    11031100    renderables = ['resultDirectory', 'zipFile']
    1104 
    1105     def __init__(self):
     1101    haltOnFailure = False
     1102    flunkOnFailure = False
     1103
     1104    def __init__(self, identifier=''):
     1105        if identifier and not identifier.startswith('-'):
     1106            identifier = '-{}'.format(identifier)
     1107
     1108        self.zipFile = Interpolate('public_html/results/%(prop:buildername)s/r%(prop:patch_id)s-%(prop:buildnumber)s{}.zip'.format(identifier))
     1109        self.resultDirectory = Interpolate('public_html/results/%(prop:buildername)s/r%(prop:patch_id)s-%(prop:buildnumber)s{}'.format(identifier))
     1110        self.command = ['unzip', self.zipFile, '-d', self.resultDirectory]
     1111
    11061112        super(ExtractTestResults, self).__init__(self.command)
    11071113
  • trunk/Tools/BuildSlaveSupport/ews-build/steps_unittest.py

    r246737 r246793  
    14701470        return self.runStep()
    14711471
     1472    def test_success_with_identifier(self):
     1473        self.setupStep(UploadTestResults(identifier='clean-tree'))
     1474        self.setProperty('configuration', 'release')
     1475        self.setProperty('architecture', 'x86_64')
     1476        self.setProperty('patch_id', '271211')
     1477        self.setProperty('buildername', 'iOS-12-Simulator-WK2-Tests-EWS')
     1478        self.setProperty('buildnumber', '120')
     1479        self.expectHidden(False)
     1480        self.expectRemoteCommands(
     1481            Expect('uploadFile', dict(
     1482                                        workersrc='layout-test-results.zip', workdir='wkdir',
     1483                                        blocksize=1024 * 256, maxsize=None, keepstamp=False,
     1484                                        writer=ExpectRemoteRef(remotetransfer.FileWriter),
     1485                                     ))
     1486            + Expect.behavior(uploadFileWithContentsOfString('Dummy zip file content.'))
     1487            + 0,
     1488        )
     1489        self.expectUploadedFile('public_html/results/iOS-12-Simulator-WK2-Tests-EWS/r271211-120-clean-tree.zip')
     1490
     1491        self.expectOutcome(result=SUCCESS, state_string='Uploaded test results')
     1492        return self.runStep()
     1493
    14721494
    14731495class TestExtractTestResults(BuildStepMixinAdditions, unittest.TestCase):
     
    14901512                                              '-d',
    14911513                                              'public_html/results/macOS-Sierra-Release-WK2-Tests-EWS/r1234-12',
     1514                                             ])
     1515            + 0,
     1516        )
     1517        self.expectOutcome(result=SUCCESS, state_string='Extracted test results')
     1518        self.expectAddedURLs([call('view layout test results', '/results/test/r2468_ab1a28b4feee0d42973c7c05335b35bca927e974 (1)/results.html')])
     1519        return self.runStep()
     1520
     1521    def test_success_with_identifier(self):
     1522        self.setupStep(ExtractTestResults(identifier='rerun'))
     1523        self.setProperty('configuration', 'release')
     1524        self.setProperty('patch_id', '1234')
     1525        self.setProperty('buildername', 'iOS-12-Simulator-WK2-Tests-EWS')
     1526        self.setProperty('buildnumber', '12')
     1527        self.expectLocalCommands(
     1528            ExpectMasterShellCommand(command=['unzip',
     1529                                              'public_html/results/iOS-12-Simulator-WK2-Tests-EWS/r1234-12-rerun.zip',
     1530                                              '-d',
     1531                                              'public_html/results/iOS-12-Simulator-WK2-Tests-EWS/r1234-12-rerun',
    14921532                                             ])
    14931533            + 0,
  • trunk/Tools/ChangeLog

    r246791 r246793  
     12019-06-25  Aakash Jain  <aakash_jain@apple.com>
     2
     3        [ews-build] UploadTestResults and ExtractTestResults clobber results in case of multiple layout test runs in a build
     4        https://bugs.webkit.org/show_bug.cgi?id=199178
     5
     6        Reviewed by Jonathan Bedard.
     7
     8        * BuildSlaveSupport/ews-build/steps.py:
     9        (UploadTestResults.__init__): Add an optional identifier and append the identifier to the file name.
     10        (ExtractTestResults.__init__): Ditto.
     11        * BuildSlaveSupport/ews-build/steps_unittest.py: Added unit tests.
     12
    1132019-06-25  Michael Catanzaro  <mcatanzaro@igalia.com>
    214
Note: See TracChangeset for help on using the changeset viewer.