Changeset 244102 in webkit


Ignore:
Timestamp:
Apr 9, 2019 6:06:42 PM (5 years ago)
Author:
aakash_jain@apple.com
Message:

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

Reviewed by Dewei Zhu.

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

Legend:

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

    r243342 r244102  
    12491249
    12501250
     1251class TestPrintConfiguration(BuildStepMixinAdditions, unittest.TestCase):
     1252    def setUp(self):
     1253        self.longMessage = True
     1254        return self.setUpBuildStep()
     1255
     1256    def tearDown(self):
     1257        return self.tearDownBuildStep()
     1258
     1259    def test_success(self):
     1260        self.setupStep(PrintConfiguration())
     1261        self.setProperty('buildername', 'macOS-Sierra-Release-WK2-Tests-EWS')
     1262        self.setProperty('platform', 'mac')
     1263
     1264        self.expectRemoteCommands(
     1265            ExpectShell(command=['hostname'], workdir='wkdir', timeout=60, logEnviron=False) + 0
     1266            + ExpectShell.log('stdio', stdout='ews150.apple.com'),
     1267            ExpectShell(command=['df', '-hl'], workdir='wkdir', timeout=60, logEnviron=False) + 0
     1268            + ExpectShell.log('stdio', stdout='''Filesystem     Size   Used  Avail Capacity iused  ifree %iused  Mounted on
     1269/dev/disk1s1  119Gi   95Gi   23Gi    81%  937959 9223372036853837848    0%   /
     1270/dev/disk1s4  119Gi   20Ki   23Gi     1%       0 9223372036854775807    0%   /private/var/vm
     1271/dev/disk0s3  119Gi   22Gi   97Gi    19%  337595          4294629684    0%   /Volumes/Data'''),
     1272            ExpectShell(command=['date'], workdir='wkdir', timeout=60, logEnviron=False) + 0
     1273            + ExpectShell.log('stdio', stdout='Tue Apr  9 15:30:52 PDT 2019'),
     1274            ExpectShell(command=['sw_vers'], workdir='wkdir', timeout=60, logEnviron=False) + 0
     1275            + ExpectShell.log('stdio', stdout='''ProductName:   Mac OS X
     1276ProductVersion: 10.13.4
     1277BuildVersion:   17E199'''),
     1278            ExpectShell(command=['xcodebuild', '-sdk', '-version'], workdir='wkdir', timeout=60, logEnviron=False)
     1279            + ExpectShell.log('stdio', stdout='''MacOSX10.13.sdk - macOS 10.13 (macosx10.13)
     1280SDKVersion: 10.13
     1281Path: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk
     1282PlatformVersion: 1.1
     1283PlatformPath: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform
     1284ProductBuildVersion: 17E189
     1285ProductCopyright: 1983-2018 Apple Inc.
     1286ProductName: Mac OS X
     1287ProductUserVisibleVersion: 10.13.4
     1288ProductVersion: 10.13.4
     1289
     1290Xcode 9.4.1
     1291Build version 9F2000''')
     1292            + 0,
     1293        )
     1294        self.expectOutcome(result=SUCCESS, state_string='OS: High Sierra (10.13.4), Xcode: 10.13')
     1295        return self.runStep()
     1296
     1297    def test_failure(self):
     1298        self.setupStep(PrintConfiguration())
     1299        self.setProperty('platform', 'mac')
     1300        self.expectRemoteCommands(
     1301            ExpectShell(command=['hostname'], workdir='wkdir', timeout=60, logEnviron=False) + 0,
     1302            ExpectShell(command=['df', '-hl'], workdir='wkdir', timeout=60, logEnviron=False) + 0,
     1303            ExpectShell(command=['date'], workdir='wkdir', timeout=60, logEnviron=False) + 0,
     1304            ExpectShell(command=['sw_vers'], workdir='wkdir', timeout=60, logEnviron=False) + 1
     1305            + ExpectShell.log('stdio', stdout='''Upon execvpe sw_vers ['sw_vers'] in environment id 7696545650400
     1306:Traceback (most recent call last):
     1307  File "/usr/lib/python2.7/site-packages/twisted/internet/process.py", line 445, in _fork
     1308    environment)
     1309  File "/usr/lib/python2.7/site-packages/twisted/internet/process.py", line 523, in _execChild
     1310    os.execvpe(executable, args, environment)
     1311  File "/usr/lib/python2.7/os.py", line 355, in execvpe
     1312    _execvpe(file, args, env)
     1313  File "/usr/lib/python2.7/os.py", line 382, in _execvpe
     1314    func(fullname, *argrest)
     1315OSError: [Errno 2] No such file or directory'''),
     1316            ExpectShell(command=['xcodebuild', '-sdk', '-version'], workdir='wkdir', timeout=60, logEnviron=False)
     1317            + ExpectShell.log('stdio', stdout='''Upon execvpe xcodebuild ['xcodebuild', '-sdk', '-version'] in environment id 7696545612416
     1318:Traceback (most recent call last):
     1319  File "/usr/lib/python2.7/site-packages/twisted/internet/process.py", line 445, in _fork
     1320    environment)
     1321  File "/usr/lib/python2.7/site-packages/twisted/internet/process.py", line 523, in _execChild
     1322    os.execvpe(executable, args, environment)
     1323  File "/usr/lib/python2.7/os.py", line 355, in execvpe
     1324    _execvpe(file, args, env)
     1325  File "/usr/lib/python2.7/os.py", line 382, in _execvpe
     1326    func(fullname, *argrest)
     1327OSError: [Errno 2] No such file or directory''')
     1328            + 1,
     1329        )
     1330        self.expectOutcome(result=FAILURE, state_string='Failed to print configuration')
     1331        return self.runStep()
     1332
     1333
    12511334if __name__ == '__main__':
    12521335    unittest.main()
  • trunk/Tools/ChangeLog

    r244100 r244102  
     12019-04-09  Aakash Jain  <aakash_jain@apple.com>
     2
     3        [ews-build] Add unit tests for PrintConfiguration
     4        https://bugs.webkit.org/show_bug.cgi?id=196752
     5
     6        Reviewed by Dewei Zhu.
     7
     8        * BuildSlaveSupport/ews-build/steps_unittest.py: Added unit-tests.
     9
    1102019-04-09  Keith Rollin  <krollin@apple.com>
    211
Note: See TracChangeset for help on using the changeset viewer.