⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 243177 in webkit


Ignore:
Timestamp:
Mar 19, 2019, 4:02:26 PM (7 years ago)
Author:
aakash_jain@apple.com
Message:

[ews-build] Improve summary for PrintConfiguration step
https://bugs.webkit.org/show_bug.cgi?id=195945

Reviewed by Lucas Forschler.

  • BuildSlaveSupport/ews-build/steps.py:

(PrintConfiguration.getResultSummary): Override getResultSummary.

Location:
trunk/Tools
Files:
2 edited

Legend:

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

    r243174 r243177  
    757757    name = 'configuration'
    758758    description = ['configuration']
    759     descriptionDone = ['configuration']
    760759    haltOnFailure = False
    761760    flunkOnFailure = False
    762761    warnOnFailure = False
     762    logEnviron = False
    763763    command_list = [['hostname'],
    764764                    ['df', '-hl'],
     
    770770        super(PrintConfiguration, self).__init__(timeout=60, **kwargs)
    771771        self.commands = []
     772        self.log_observer = logobserver.BufferLogObserver(wantStderr=True)
     773        self.addLogObserver('stdio', self.log_observer)
    772774        # FIXME: Check platform before running platform specific commands.
    773775        for command in self.command_list:
    774             self.commands.append(util.ShellArg(command=command, logfile=command[0]))
     776            self.commands.append(util.ShellArg(command=command, logfile='stdio'))
     777
     778    def convert_build_to_os_name(self, build):
     779        if not build:
     780            return 'Unknown'
     781
     782        build_to_name_mapping = {
     783            '10.14': 'Mojave',
     784            '10.13': 'High Sierra',
     785            '10.12': 'Sierra',
     786            '10.11': 'El Capitan',
     787            '10.10': 'Yosemite',
     788            '10.9': 'Maverick',
     789            '10.8': 'Mountain Lion',
     790            '10.7': 'Lion',
     791            '10.6': 'Snow Leopard',
     792            '10.5': 'Leopard',
     793        }
     794
     795        for key, value in build_to_name_mapping.iteritems():
     796            if build.startswith(key):
     797                return value
     798        return 'Unknown'
     799
     800    def getResultSummary(self):
     801        if self.results != SUCCESS:
     802            return {u'step': u'Failed to print configuration'}
     803        logText = self.log_observer.getStdout() + self.log_observer.getStderr()
     804        configuration = u''
     805        match = re.search('ProductVersion:[ \t]*(.+?)\n', logText)
     806        if match:
     807            os_version = match.group(1).strip()
     808            os_name = self.convert_build_to_os_name(os_version)
     809            configuration = u'OS: {} ({})'.format(os_name, os_version)
     810
     811        sdk_re = 'MacOSX[\s\S]*?SDKVersion:[ \t]*(.+?)\n'
     812        is_ios_builder = 'iOS' in self.getProperty('buildername', '')
     813        if is_ios_builder:
     814            sdk_re = 'iPhoneSimulator[\s\S]*?SDKVersion:[ \t]*(.+?)\n'
     815        match = re.search(sdk_re, logText)
     816        if match:
     817            xcode_version = match.group(1).strip()
     818            configuration += u', Xcode: {}'.format(xcode_version)
     819        return {u'step': configuration}
  • trunk/Tools/ChangeLog

    r243174 r243177  
     12019-03-19  Aakash Jain  <aakash_jain@apple.com>
     2
     3        [ews-build] Improve summary for PrintConfiguration step
     4        https://bugs.webkit.org/show_bug.cgi?id=195945
     5
     6        Reviewed by Lucas Forschler.
     7
     8        * BuildSlaveSupport/ews-build/steps.py:
     9        (PrintConfiguration.getResultSummary): Override getResultSummary.
     10
    1112019-03-19  Aakash Jain  <aakash_jain@apple.com>
    212
Note: See TracChangeset for help on using the changeset viewer.