Changeset 278310 in webkit
- Timestamp:
- Jun 1, 2021, 9:28:23 AM (5 years ago)
- Location:
- trunk/Tools
- Files:
-
- 4 edited
-
CISupport/build-webkit-org/factories.py (modified) (1 diff)
-
CISupport/build-webkit-org/steps.py (modified) (2 diffs)
-
CISupport/build-webkit-org/steps_unittest.py (modified) (1 diff)
-
ChangeLog (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/CISupport/build-webkit-org/factories.py
r277043 r278310 31 31 factory.BuildFactory.__init__(self) 32 32 self.addStep(ConfigureBuild(platform=platform, configuration=configuration, architecture=" ".join(architectures), buildOnly=buildOnly, additionalArguments=additionalArguments, device_model=device_model)) 33 self.addStep(PrintConfiguration()) 33 34 self.addStep(CheckOutSource()) 34 35 self.addStep(ShowIdentifier()) -
trunk/Tools/CISupport/build-webkit-org/steps.py
r277853 r278310 21 21 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 22 22 23 from buildbot.plugins import steps, util 23 24 from buildbot.process import buildstep, factory, logobserver, properties 24 25 from buildbot.process.results import Results, SUCCESS, FAILURE, WARNINGS, SKIPPED, EXCEPTION, RETRY 25 26 from buildbot.steps import master, shell, transfer, trigger 26 27 from buildbot.steps.source.svn import SVN 27 28 28 from twisted.internet import defer 29 29 30 import json 30 31 import os 31 32 import re 32 33 import socket 33 34 import sys 34 import json35 35 import urllib 36 36 … … 1156 1156 1157 1157 1158 class PrintConfiguration(steps.ShellSequence): 1159 name = 'configuration' 1160 description = ['configuration'] 1161 haltOnFailure = False 1162 flunkOnFailure = False 1163 warnOnFailure = False 1164 logEnviron = False 1165 command_list_generic = [['hostname']] 1166 command_list_apple = [['df', '-hl'], ['date'], ['sw_vers'], ['xcodebuild', '-sdk', '-version'], ['uptime']] 1167 command_list_linux = [['df', '-hl'], ['date'], ['uname', '-a'], ['uptime']] 1168 command_list_win = [['df', '-hl']] 1169 1170 def __init__(self, **kwargs): 1171 super(PrintConfiguration, self).__init__(timeout=60, **kwargs) 1172 self.commands = [] 1173 self.log_observer = logobserver.BufferLogObserver(wantStderr=True) 1174 self.addLogObserver('stdio', self.log_observer) 1175 1176 def run(self): 1177 command_list = list(self.command_list_generic) 1178 platform = self.getProperty('platform', '*') 1179 if platform != 'jsc-only': 1180 platform = platform.split('-')[0] 1181 if platform in ('mac', 'ios', 'tvos', 'watchos', '*'): 1182 command_list.extend(self.command_list_apple) 1183 elif platform in ('gtk', 'wpe', 'jsc-only'): 1184 command_list.extend(self.command_list_linux) 1185 elif platform in ('win'): 1186 command_list.extend(self.command_list_win) 1187 1188 for command in command_list: 1189 self.commands.append(util.ShellArg(command=command, logname='stdio')) 1190 return super(PrintConfiguration, self).run() 1191 1192 def convert_build_to_os_name(self, build): 1193 if not build: 1194 return 'Unknown' 1195 1196 build_to_name_mapping = { 1197 '11': 'Big Sur', 1198 '10.15': 'Catalina', 1199 '10.14': 'Mojave', 1200 '10.13': 'High Sierra', 1201 '10.12': 'Sierra', 1202 '10.11': 'El Capitan', 1203 '10.10': 'Yosemite', 1204 '10.9': 'Maverick', 1205 '10.8': 'Mountain Lion', 1206 '10.7': 'Lion', 1207 '10.6': 'Snow Leopard', 1208 '10.5': 'Leopard', 1209 } 1210 1211 for key, value in build_to_name_mapping.items(): 1212 if build.startswith(key): 1213 return value 1214 return 'Unknown' 1215 1216 def getResultSummary(self): 1217 if self.results != SUCCESS: 1218 return {'step': 'Failed to print configuration'} 1219 logText = self.log_observer.getStdout() + self.log_observer.getStderr() 1220 configuration = 'Printed configuration' 1221 match = re.search('ProductVersion:[ \t]*(.+?)\n', logText) 1222 if match: 1223 os_version = match.group(1).strip() 1224 os_name = self.convert_build_to_os_name(os_version) 1225 configuration = 'OS: {} ({})'.format(os_name, os_version) 1226 1227 xcode_re = sdk_re = 'Xcode[ \t]+?([0-9.]+?)\n' 1228 match = re.search(xcode_re, logText) 1229 if match: 1230 xcode_version = match.group(1).strip() 1231 configuration += ', Xcode: {}'.format(xcode_version) 1232 return {'step': configuration} 1233 1234 1235 1158 1236 class SetPermissions(master.MasterShellCommand): 1159 1237 name = 'set-permissions' -
trunk/Tools/CISupport/build-webkit-org/steps_unittest.py
r277742 r278310 1028 1028 self.expectOutcome(result=FAILURE, state_string='Run svn cleanup (failure)') 1029 1029 return self.runStep() 1030 1031 1032 class TestPrintConfiguration(BuildStepMixinAdditions, unittest.TestCase): 1033 def setUp(self): 1034 self.longMessage = True 1035 return self.setUpBuildStep() 1036 1037 def tearDown(self): 1038 return self.tearDownBuildStep() 1039 1040 def test_success_mac(self): 1041 self.setupStep(PrintConfiguration()) 1042 self.setProperty('buildername', 'macOS-High-Sierra-Release-WK2-Tests-EWS') 1043 self.setProperty('platform', 'mac-highsierra') 1044 1045 self.expectRemoteCommands( 1046 ExpectShell(command=['hostname'], workdir='wkdir', timeout=60, logEnviron=False) + 0 1047 + ExpectShell.log('stdio', stdout='ews150.apple.com'), 1048 ExpectShell(command=['df', '-hl'], workdir='wkdir', timeout=60, logEnviron=False) + 0 1049 + ExpectShell.log('stdio', stdout='''Filesystem Size Used Avail Capacity iused ifree %iused Mounted on 1050 /dev/disk1s1 119Gi 95Gi 23Gi 81% 937959 9223372036853837848 0% / 1051 /dev/disk1s4 119Gi 20Ki 23Gi 1% 0 9223372036854775807 0% /private/var/vm 1052 /dev/disk0s3 119Gi 22Gi 97Gi 19% 337595 4294629684 0% /Volumes/Data'''), 1053 ExpectShell(command=['date'], workdir='wkdir', timeout=60, logEnviron=False) + 0 1054 + ExpectShell.log('stdio', stdout='Tue Apr 9 15:30:52 PDT 2019'), 1055 ExpectShell(command=['sw_vers'], workdir='wkdir', timeout=60, logEnviron=False) + 0 1056 + ExpectShell.log('stdio', stdout='''ProductName: Mac OS X 1057 ProductVersion: 10.13.4 1058 BuildVersion: 17E199'''), 1059 ExpectShell(command=['xcodebuild', '-sdk', '-version'], workdir='wkdir', timeout=60, logEnviron=False) 1060 + ExpectShell.log('stdio', stdout='''MacOSX10.13.sdk - macOS 10.13 (macosx10.13) 1061 SDKVersion: 10.13 1062 Path: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk 1063 PlatformVersion: 1.1 1064 PlatformPath: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform 1065 ProductBuildVersion: 17E189 1066 ProductCopyright: 1983-2018 Apple Inc. 1067 ProductName: Mac OS X 1068 ProductUserVisibleVersion: 10.13.4 1069 ProductVersion: 10.13.4 1070 1071 Xcode 9.4.1 1072 Build version 9F2000''') 1073 + 0, 1074 ExpectShell(command=['uptime'], workdir='wkdir', timeout=60, logEnviron=False) + 0 1075 + ExpectShell.log('stdio', stdout=' 6:31 up 1 day, 19:05, 24 users, load averages: 4.17 7.23 5.45'), 1076 ) 1077 self.expectOutcome(result=SUCCESS, state_string='OS: High Sierra (10.13.4), Xcode: 9.4.1') 1078 return self.runStep() 1079 1080 def test_success_ios_simulator(self): 1081 self.setupStep(PrintConfiguration()) 1082 self.setProperty('buildername', 'macOS-Sierra-Release-WK2-Tests-EWS') 1083 self.setProperty('platform', 'ios-simulator-12') 1084 1085 self.expectRemoteCommands( 1086 ExpectShell(command=['hostname'], workdir='wkdir', timeout=60, logEnviron=False) + 0 1087 + ExpectShell.log('stdio', stdout='ews152.apple.com'), 1088 ExpectShell(command=['df', '-hl'], workdir='wkdir', timeout=60, logEnviron=False) + 0 1089 + ExpectShell.log('stdio', stdout='''Filesystem Size Used Avail Capacity iused ifree %iused Mounted on 1090 /dev/disk1s1 119Gi 95Gi 23Gi 81% 937959 9223372036853837848 0% / 1091 /dev/disk1s4 119Gi 20Ki 23Gi 1% 0 9223372036854775807 0% /private/var/vm 1092 /dev/disk0s3 119Gi 22Gi 97Gi 19% 337595 4294629684 0% /Volumes/Data'''), 1093 ExpectShell(command=['date'], workdir='wkdir', timeout=60, logEnviron=False) + 0 1094 + ExpectShell.log('stdio', stdout='Tue Apr 9 15:30:52 PDT 2019'), 1095 ExpectShell(command=['sw_vers'], workdir='wkdir', timeout=60, logEnviron=False) + 0 1096 + ExpectShell.log('stdio', stdout='''ProductName: Mac OS X 1097 ProductVersion: 10.15.6 1098 BuildVersion: 19H2'''), 1099 ExpectShell(command=['xcodebuild', '-sdk', '-version'], workdir='wkdir', timeout=60, logEnviron=False) 1100 + ExpectShell.log('stdio', stdout='''iPhoneSimulator13.4.sdk - Simulator - iOS 13.4 (iphonesimulator13.4) 1101 SDKVersion: 13.4 1102 Path: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk 1103 PlatformVersion: 13.4 1104 PlatformPath: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform 1105 BuildID: BB4C82AE-5F8A-11EA-A1A5-838AD03DDE06 1106 ProductBuildVersion: 17E255 1107 ProductCopyright: 1983-2020 Apple Inc. 1108 ProductName: iPhone OS 1109 ProductVersion: 13.4 1110 1111 Xcode 11.7 1112 Build version 10E125''') 1113 + 0, 1114 ExpectShell(command=['uptime'], workdir='wkdir', timeout=60, logEnviron=False) + 0 1115 + ExpectShell.log('stdio', stdout=' 6:31 up 1 day, 19:05, 24 users, load averages: 4.17 7.23 5.45'), 1116 ) 1117 self.expectOutcome(result=SUCCESS, state_string='OS: Catalina (10.15.6), Xcode: 11.7') 1118 return self.runStep() 1119 1120 def test_success_webkitpy(self): 1121 self.setupStep(PrintConfiguration()) 1122 self.setProperty('platform', '*') 1123 1124 self.expectRemoteCommands( 1125 ExpectShell(command=['hostname'], workdir='wkdir', timeout=60, logEnviron=False) + 0, 1126 ExpectShell(command=['df', '-hl'], workdir='wkdir', timeout=60, logEnviron=False) + 0, 1127 ExpectShell(command=['date'], workdir='wkdir', timeout=60, logEnviron=False) + 0, 1128 ExpectShell(command=['sw_vers'], workdir='wkdir', timeout=60, logEnviron=False) + 0 1129 + ExpectShell.log('stdio', stdout='''ProductName: Mac OS X 1130 ProductVersion: 10.13.6 1131 BuildVersion: 17G7024'''), 1132 ExpectShell(command=['xcodebuild', '-sdk', '-version'], workdir='wkdir', timeout=60, logEnviron=False) + 0 1133 + ExpectShell.log('stdio', stdout='''Xcode 10.2\nBuild version 10E125'''), 1134 ExpectShell(command=['uptime'], workdir='wkdir', timeout=60, logEnviron=False) + 0 1135 + ExpectShell.log('stdio', stdout=' 6:31 up 22 seconds, 12:05, 2 users, load averages: 3.17 7.23 5.45'), 1136 ) 1137 self.expectOutcome(result=SUCCESS, state_string='OS: High Sierra (10.13.6), Xcode: 10.2') 1138 return self.runStep() 1139 1140 def test_success_linux_wpe(self): 1141 self.setupStep(PrintConfiguration()) 1142 self.setProperty('platform', 'wpe') 1143 1144 self.expectRemoteCommands( 1145 ExpectShell(command=['hostname'], workdir='wkdir', timeout=60, logEnviron=False) + 0 1146 + ExpectShell.log('stdio', stdout='ews190'), 1147 ExpectShell(command=['df', '-hl'], workdir='wkdir', timeout=60, logEnviron=False) + 0 1148 + ExpectShell.log('stdio', stdout='''Filesystem Size Used Avail Capacity iused ifree %iused Mounted on 1149 /dev/disk0s3 119Gi 22Gi 97Gi 19% 337595 4294629684 0% /'''), 1150 ExpectShell(command=['date'], workdir='wkdir', timeout=60, logEnviron=False) + 0 1151 + ExpectShell.log('stdio', stdout='Tue Apr 9 15:30:52 PDT 2019'), 1152 ExpectShell(command=['uname', '-a'], workdir='wkdir', timeout=60, logEnviron=False) + 0 1153 + ExpectShell.log('stdio', stdout='''Linux kodama-ews 5.0.4-arch1-1-ARCH #1 SMP PREEMPT Sat Mar 23 21:00:33 UTC 2019 x86_64 GNU/Linux'''), 1154 ExpectShell(command=['uptime'], workdir='wkdir', timeout=60, logEnviron=False) + 0 1155 + ExpectShell.log('stdio', stdout=' 6:31 up 22 seconds, 12:05, 2 users, load averages: 3.17 7.23 5.45'), 1156 ) 1157 self.expectOutcome(result=SUCCESS, state_string='Printed configuration') 1158 return self.runStep() 1159 1160 def test_success_linux_gtk(self): 1161 self.setupStep(PrintConfiguration()) 1162 self.setProperty('platform', 'gtk') 1163 1164 self.expectRemoteCommands( 1165 ExpectShell(command=['hostname'], workdir='wkdir', timeout=60, logEnviron=False) + 0, 1166 ExpectShell(command=['df', '-hl'], workdir='wkdir', timeout=60, logEnviron=False) + 0, 1167 ExpectShell(command=['date'], workdir='wkdir', timeout=60, logEnviron=False) + 0, 1168 ExpectShell(command=['uname', '-a'], workdir='wkdir', timeout=60, logEnviron=False) + 0, 1169 ExpectShell(command=['uptime'], workdir='wkdir', timeout=60, logEnviron=False) + 0, 1170 ) 1171 self.expectOutcome(result=SUCCESS, state_string='Printed configuration') 1172 return self.runStep() 1173 1174 def test_success_win(self): 1175 self.setupStep(PrintConfiguration()) 1176 self.setProperty('platform', 'win') 1177 1178 self.expectRemoteCommands( 1179 ExpectShell(command=['hostname'], workdir='wkdir', timeout=60, logEnviron=False) + 0, 1180 ExpectShell(command=['df', '-hl'], workdir='wkdir', timeout=60, logEnviron=False) + 0, 1181 ) 1182 self.expectOutcome(result=SUCCESS, state_string='Printed configuration') 1183 return self.runStep() 1184 1185 def test_failure(self): 1186 self.setupStep(PrintConfiguration()) 1187 self.setProperty('platform', 'ios-12') 1188 self.expectRemoteCommands( 1189 ExpectShell(command=['hostname'], workdir='wkdir', timeout=60, logEnviron=False) + 0, 1190 ExpectShell(command=['df', '-hl'], workdir='wkdir', timeout=60, logEnviron=False) + 0, 1191 ExpectShell(command=['date'], workdir='wkdir', timeout=60, logEnviron=False) + 0, 1192 ExpectShell(command=['sw_vers'], workdir='wkdir', timeout=60, logEnviron=False) + 1 1193 + ExpectShell.log('stdio', stdout='''Upon execvpe sw_vers ['sw_vers'] in environment id 7696545650400 1194 :Traceback (most recent call last): 1195 File "/usr/lib/python2.7/site-packages/twisted/internet/process.py", line 445, in _fork 1196 environment) 1197 File "/usr/lib/python2.7/site-packages/twisted/internet/process.py", line 523, in _execChild 1198 os.execvpe(executable, args, environment) 1199 File "/usr/lib/python2.7/os.py", line 355, in execvpe 1200 _execvpe(file, args, env) 1201 File "/usr/lib/python2.7/os.py", line 382, in _execvpe 1202 func(fullname, *argrest) 1203 OSError: [Errno 2] No such file or directory'''), 1204 ExpectShell(command=['xcodebuild', '-sdk', '-version'], workdir='wkdir', timeout=60, logEnviron=False) 1205 + ExpectShell.log('stdio', stdout='''Upon execvpe xcodebuild ['xcodebuild', '-sdk', '-version'] in environment id 7696545612416 1206 :Traceback (most recent call last): 1207 File "/usr/lib/python2.7/site-packages/twisted/internet/process.py", line 445, in _fork 1208 environment) 1209 File "/usr/lib/python2.7/site-packages/twisted/internet/process.py", line 523, in _execChild 1210 os.execvpe(executable, args, environment) 1211 File "/usr/lib/python2.7/os.py", line 355, in execvpe 1212 _execvpe(file, args, env) 1213 File "/usr/lib/python2.7/os.py", line 382, in _execvpe 1214 func(fullname, *argrest) 1215 OSError: [Errno 2] No such file or directory''') 1216 + 1, 1217 ExpectShell(command=['uptime'], workdir='wkdir', timeout=60, logEnviron=False) + 0, 1218 ) 1219 self.expectOutcome(result=FAILURE, state_string='Failed to print configuration') 1220 return self.runStep() -
trunk/Tools/ChangeLog
r278254 r278310 1 2021-06-01 Aakash Jain <aakash_jain@apple.com> 2 3 Print bot configuration in build.webkit.org builds 4 https://bugs.webkit.org/show_bug.cgi?id=226353 5 6 Reviewed by Jonathan Bedard. 7 8 * CISupport/build-webkit-org/factories.py: 9 (Factory.__init__): Added PrintConfiguration step. 10 * CISupport/build-webkit-org/steps.py: 11 (PrintConfiguration): Copied from ews code, step to print configuration. 12 (PrintConfiguration.__init__): 13 (PrintConfiguration.run): 14 (PrintConfiguration.convert_build_to_os_name): 15 (PrintConfiguration.getResultSummary): 16 * CISupport/build-webkit-org/steps_unittest.py: Added unit-tests. 17 1 18 2021-05-30 Wenson Hsieh <wenson_hsieh@apple.com> 2 19
Note:
See TracChangeset
for help on using the changeset viewer.