Tools/ChangeLog

 12020-01-14 Jonathan Bedard <jbedard@apple.com>
 2
 3 EWS: Run webkitpy tests with Python 2 and 3
 4 https://bugs.webkit.org/show_bug.cgi?id=206113
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 * BuildSlaveSupport/ews-build/factories.py:
 9 (WebKitPyFactory.__init__): Run webkitpy tests in Python 2 and Python 3.
 10 * BuildSlaveSupport/ews-build/factories_unittest.py:
 11 (TestTestsFactory.test_webkitpy_factory):
 12 * BuildSlaveSupport/ews-build/steps.py:
 13 (WebKitPyTest): Renamed from RunWebKitPyTests.
 14 (RunWebKitPyPython2Tests):
 15 (RunWebKitPyPython3Tests):
 16 (RunWebKitPyTests): Renamed to WebKitPyTest.
 17 * BuildSlaveSupport/ews-build/steps_unittest.py:
 18 (TestWebKitPyPython2Tests): Moved from TestWebKitPyTests.
 19 (TestWebKitPyTests): Moved to TestWebKitPyPython2Tests.
 20 (TestWebKitPyPython3Tests): Copied from TestWebKitPyPython2Tests.
 21
1222020-01-10 Jiewen Tan <jiewen_tan@apple.com>
223
324 [WebAuthn] Implement SPI to tell UI clients to select assertion responses
254533

Tools/BuildSlaveSupport/ews-build/factories.py

@@from steps import (ApplyPatch, ApplyWatc
2929 DownloadBuiltProduct, ExtractBuiltProduct, InstallGtkDependencies, InstallWpeDependencies, KillOldProcesses,
3030 PrintConfiguration, RunAPITests, RunBindingsTests, RunBuildWebKitOrgUnitTests, RunEWSBuildbotCheckConfig, RunEWSUnitTests,
3131 RunJavaScriptCoreTests, RunWebKit1Tests, RunWebKitPerlTests,
32  RunWebKitPyTests, RunWebKitTests, UpdateWorkingDirectory, ValidatePatch)
 32 RunWebKitPyPython2Tests, RunWebKitPyPython3Tests, RunWebKitTests, UpdateWorkingDirectory, ValidatePatch)
3333
3434
3535class Factory(factory.BuildFactory):

@@class WebKitPerlFactory(Factory):
8787class WebKitPyFactory(Factory):
8888 def __init__(self, platform, configuration=None, architectures=None, additionalArguments=None, **kwargs):
8989 Factory.__init__(self, platform=platform, configuration=configuration, architectures=architectures, buildOnly=False, additionalArgument=additionalArguments, checkRelevance=True)
90  self.addStep(RunWebKitPyTests())
 90 self.addStep(RunWebKitPyPython2Tests())
 91 self.addStep(RunWebKitPyPython3Tests())
9192
9293
9394class BuildFactory(Factory):
254533

Tools/BuildSlaveSupport/ews-build/factories_unittest.py

@@class TestTestsFactory(TestCase):
134134 _BuildStepFactory(steps.CheckOutSource),
135135 _BuildStepFactory(steps.CheckOutSpecificRevision),
136136 _BuildStepFactory(steps.ApplyPatch),
137  _BuildStepFactory(steps.RunWebKitPyTests),
 137 _BuildStepFactory(steps.RunWebKitPyPython2Tests),
 138 _BuildStepFactory(steps.RunWebKitPyPython3Tests),
138139 ])
139140
140141 def test_services_factory(self):
254533

Tools/BuildSlaveSupport/ews-build/steps.py

@@class RunEWSBuildbotCheckConfig(shell.Sh
693693 return {u'step': u'Failed buildbot checkconfig'}
694694
695695
696 class RunWebKitPyTests(shell.ShellCommand):
697  name = 'webkitpy-tests'
698  description = ['webkitpy-tests running']
699  descriptionDone = ['webkitpy-tests']
 696class WebKitPyTest(shell.ShellCommand):
 697 language = 'python'
700698 flunkOnFailure = True
701  jsonFileName = 'webkitpy_test_results.json'
702  logfiles = {'json': jsonFileName}
703  command = ['python', 'Tools/Scripts/test-webkitpy', '--json-output={0}'.format(jsonFileName)]
704699
705700 def __init__(self, **kwargs):
706  super(RunWebKitPyTests, self).__init__(timeout=2 * 60, logEnviron=False, **kwargs)
 701 super(WebKitPyTest, self).__init__(timeout=2 * 60, logEnviron=False, **kwargs)
707702
708703 def start(self):
709704 self.log_observer = logobserver.BufferLogObserver()

@@class RunWebKitPyTests(shell.ShellComman
712707
713708 def getResultSummary(self):
714709 if self.results == SUCCESS:
715  message = 'Passed webkitpy tests'
716  self.build.buildFinished([message], SUCCESS)
 710 message = 'Passed webkitpy {} tests'.format(self.language)
717711 return {u'step': unicode(message)}
718712
719713 logLines = self.log_observer.getStdout()

@@class RunWebKitPyTests(shell.ShellComman
722716 webkitpy_results = json.loads(json_text)
723717 except Exception as ex:
724718 self._addToLog('stderr', 'ERROR: unable to parse data, exception: {}'.format(ex))
725  return super(RunWebKitPyTests, self).getResultSummary()
 719 return super(WebKitPyTest, self).getResultSummary()
726720
727721 failures = webkitpy_results.get('failures') + webkitpy_results.get('errors')
728722 if not failures:
729  return super(RunWebKitPyTests, self).getResultSummary()
 723 return super(WebKitPyTest, self).getResultSummary()
730724 pluralSuffix = 's' if len(failures) > 1 else ''
731725 failures_string = ', '.join([failure.get('name').replace('webkitpy.', '') for failure in failures])
732726 message = 'Found {} WebKitPy test failure{}: {}'.format(len(failures), pluralSuffix, failures_string)
733  self.build.buildFinished([message], FAILURE)
734727 return {u'step': unicode(message)}
735728
736729 @defer.inlineCallbacks

@@class RunWebKitPyTests(shell.ShellComman
742735 log.addStdout(message)
743736
744737
 738class RunWebKitPyPython2Tests(WebKitPyTest):
 739 language = 'python2'
 740 name = 'webkitpy-tests-{}'.format(language)
 741 descriptionDone = ['webkitpy-tests']
 742 description = ['webkitpy-tests running ({})'.format(language)]
 743 jsonFileName = 'webkitpy_test_{}_results.json'.format(language)
 744 logfiles = {'json': jsonFileName}
 745 command = ['python', 'Tools/Scripts/test-webkitpy', '--json-output={0}'.format(jsonFileName)]
 746
 747
 748class RunWebKitPyPython3Tests(WebKitPyTest):
 749 language = 'python3'
 750 name = 'webkitpy-tests-{}'.format(language)
 751 descriptionDone = ['webkitpy-tests']
 752 description = ['webkitpy-tests running ({})'.format(language)]
 753 jsonFileName = 'webkitpy_test_{}_results.json'.format(language)
 754 logfiles = {'json': jsonFileName}
 755 command = ['python3', 'Tools/Scripts/test-webkitpy', '--json-output={0}'.format(jsonFileName)]
 756
 757
745758class InstallGtkDependencies(shell.ShellCommand):
746759 name = 'jhbuild'
747760 description = ['updating gtk dependencies']
254533

Tools/BuildSlaveSupport/ews-build/steps_unittest.py

@@from steps import (AnalyzeAPITestsResult
4040 DownloadBuiltProduct, DownloadBuiltProductFromMaster, ExtractBuiltProduct, ExtractTestResults, InstallGtkDependencies, InstallWpeDependencies, KillOldProcesses,
4141 PrintConfiguration, ReRunAPITests, ReRunJavaScriptCoreTests, ReRunWebKitPerlTests, ReRunWebKitTests, RunAPITests, RunAPITestsWithoutPatch,
4242 RunBindingsTests, RunBuildWebKitOrgUnitTests, RunEWSBuildbotCheckConfig, RunEWSUnitTests, RunJavaScriptCoreTests, RunJSCTestsWithoutPatch, RunWebKit1Tests,
43  RunWebKitPerlTests, RunWebKitPyTests, RunWebKitTests, RunWebKitTestsWithoutPatch, TestWithFailureCount, Trigger, TransferToS3, UnApplyPatchIfRequired,
 43 RunWebKitPerlTests, RunWebKitPyPython2Tests, RunWebKitPyPython3Tests, RunWebKitTests, RunWebKitTestsWithoutPatch, TestWithFailureCount, Trigger, TransferToS3, UnApplyPatchIfRequired,
4444 UpdateWorkingDirectory, UploadBuiltProduct, UploadTestResults, ValidatePatch)
4545
4646# Workaround for https://github.com/buildbot/buildbot/issues/4669

@@class TestReRunJavaScriptCoreTests(TestR
419419 self.setupStep(ReRunWebKitPerlTests())
420420
421421
422 class TestWebKitPyTests(BuildStepMixinAdditions, unittest.TestCase):
 422class TestWebKitPyPython2Tests(BuildStepMixinAdditions, unittest.TestCase):
423423 def setUp(self):
424424 self.longMessage = True
425  self.jsonFileName = 'webkitpy_test_results.json'
 425 self.jsonFileName = 'webkitpy_test_python2_results.json'
426426 return self.setUpBuildStep()
427427
428428 def tearDown(self):
429429 return self.tearDownBuildStep()
430430
431431 def test_success(self):
432  self.setupStep(RunWebKitPyTests())
 432 self.setupStep(RunWebKitPyPython2Tests())
433433 self.expectRemoteCommands(
434434 ExpectShell(workdir='wkdir',
435435 logEnviron=False,

@@class TestWebKitPyTests(BuildStepMixinAd
439439 )
440440 + 0,
441441 )
442  self.expectOutcome(result=SUCCESS, state_string='Passed webkitpy tests')
 442 self.expectOutcome(result=SUCCESS, state_string='Passed webkitpy python2 tests')
443443 return self.runStep()
444444
445445 def test_failure(self):
446  self.setupStep(RunWebKitPyTests())
 446 self.setupStep(RunWebKitPyPython2Tests())
447447 self.expectRemoteCommands(
448448 ExpectShell(workdir='wkdir',
449449 logEnviron=False,

@@FAILED (failures=1, errors=0)''')
459459 return self.runStep()
460460
461461
 462class TestWebKitPyPython3Tests(BuildStepMixinAdditions, unittest.TestCase):
 463 def setUp(self):
 464 self.longMessage = True
 465 self.jsonFileName = 'webkitpy_test_python3_results.json'
 466 return self.setUpBuildStep()
 467
 468 def tearDown(self):
 469 return self.tearDownBuildStep()
 470
 471 def test_success(self):
 472 self.setupStep(RunWebKitPyPython3Tests())
 473 self.expectRemoteCommands(
 474 ExpectShell(workdir='wkdir',
 475 logEnviron=False,
 476 command=['python3', 'Tools/Scripts/test-webkitpy', '--json-output={0}'.format(self.jsonFileName)],
 477 logfiles={'json': self.jsonFileName},
 478 timeout=120,
 479 )
 480 + 0,
 481 )
 482 self.expectOutcome(result=SUCCESS, state_string='Passed webkitpy python3 tests')
 483 return self.runStep()
 484
 485 def test_failure(self):
 486 self.setupStep(RunWebKitPyPython3Tests())
 487 self.expectRemoteCommands(
 488 ExpectShell(workdir='wkdir',
 489 logEnviron=False,
 490 command=['python3', 'Tools/Scripts/test-webkitpy', '--json-output={0}'.format(self.jsonFileName)],
 491 logfiles={'json': self.jsonFileName},
 492 timeout=120,
 493 )
 494 + ExpectShell.log('stdio', stdout='''Ran 1744 tests in 5.913s
 495FAILED (failures=1, errors=0)''')
 496 + 2,
 497 )
 498 self.expectOutcome(result=FAILURE, state_string='webkitpy-tests (failure)')
 499 return self.runStep()
 500
 501
462502class TestRunEWSBuildbotCheckConfig(BuildStepMixinAdditions, unittest.TestCase):
463503 def setUp(self):
464504 self.longMessage = True
254533