Changeset 252446 in webkit


Ignore:
Timestamp:
Nov 13, 2019 7:07:35 PM (4 years ago)
Author:
aakash_jain@apple.com
Message:

[ews] Add build step to Analyze JSC Tests Results
https://bugs.webkit.org/show_bug.cgi?id=204174

Reviewed by Jonathan Bedard.

  • BuildSlaveSupport/ews-build/steps.py:

(ReRunJavaScriptCoreTests.evaluateCommand): invoke AnalyzeJSCTestsResults step.
(AnalyzeJSCTestsResults): Build step to analyze layout-test results.

  • BuildSlaveSupport/ews-build/steps_unittest.py:

(TestAnalyzeJSCTestsResults):
(TestAnalyzeJSCTestsResults.test_single_new_stress_failure): Added unit-test.
(TestAnalyzeJSCTestsResults.test_single_new_binary_failure): Ditto.
(TestAnalyzeJSCTestsResults.test_multiple_new_stress_failure): Ditto.
(TestAnalyzeJSCTestsResults.test_multiple_new_binary_failure): Ditto.
(TestAnalyzeJSCTestsResults.test_new_stress_and_binary_failure): Ditto.
(TestAnalyzeJSCTestsResults.test_stress_failure_on_clean_tree): Ditto.
(TestAnalyzeJSCTestsResults.test_binary_failure_on_clean_tree): Ditto.
(TestAnalyzeJSCTestsResults.test_stress_and_binary_failure_on_clean_tree): Ditto.
(TestAnalyzeJSCTestsResults.test_flaky_stress_and_binary_failures): Ditto.
(TestAnalyzeJSCTestsResults.test_flaky_and_consistent_stress_failures): Ditto.
(TestAnalyzeJSCTestsResults.test_flaky_and_consistent_failures_with_clean_tree_failures): Ditto.

Location:
trunk/Tools
Files:
3 edited

Legend:

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

    r252430 r252446  
    10471047        else:
    10481048            self.setProperty('patchFailedTests', True)
    1049             self.build.addStepsAfterCurrentStep([UnApplyPatchIfRequired(), CompileJSCToT(), RunJSCTestsWithoutPatch()])
     1049            self.build.addStepsAfterCurrentStep([UnApplyPatchIfRequired(), CompileJSCToT(), RunJSCTestsWithoutPatch(), AnalyzeJSCTestsResults()])
    10501050        return rc
    10511051
     
    10571057    def evaluateCommand(self, cmd):
    10581058        return shell.Test.evaluateCommand(self, cmd)
     1059
     1060
     1061class AnalyzeJSCTestsResults(buildstep.BuildStep):
     1062    name = 'analyze-jsc-tests-results'
     1063    description = ['analyze-jsc-test-results']
     1064    descriptionDone = ['analyze-jsc-tests-results']
     1065    NUM_FAILURES_TO_DISPLAY = 10
     1066
     1067    def start(self):
     1068        first_run_stress_failures = set(self.getProperty('jsc_stress_test_failures', []))
     1069        first_run_binary_failures = set(self.getProperty('jsc_binary_failures', []))
     1070        second_run_stress_failures = set(self.getProperty('jsc_rerun_stress_test_failures', []))
     1071        second_run_binary_failures = set(self.getProperty('jsc_rerun_binary_failures', []))
     1072        clean_tree_stress_failures = set(self.getProperty('jsc_clean_tree_stress_test_failures', []))
     1073        clean_tree_binary_failures = set(self.getProperty('jsc_clean_tree_binary_failures', []))
     1074        clean_tree_failures = list(clean_tree_binary_failures) + list(clean_tree_stress_failures)
     1075        clean_tree_failures_string = ', '.join(clean_tree_failures)
     1076
     1077        stress_failures_with_patch = first_run_stress_failures.intersection(second_run_stress_failures)
     1078        binary_failures_with_patch = first_run_binary_failures.intersection(second_run_binary_failures)
     1079
     1080        flaky_stress_failures = first_run_stress_failures.union(second_run_stress_failures) - first_run_stress_failures.intersection(second_run_stress_failures)
     1081        flaky_binary_failures = first_run_binary_failures.union(second_run_binary_failures) - first_run_binary_failures.intersection(second_run_binary_failures)
     1082        flaky_failures = list(flaky_binary_failures) + list(flaky_stress_failures)
     1083        flaky_failures_string = ', '.join(flaky_failures)
     1084
     1085        new_stress_failures = stress_failures_with_patch - clean_tree_stress_failures
     1086        new_binary_failures = binary_failures_with_patch - clean_tree_binary_failures
     1087        new_stress_failures_to_display = ', '.join(list(new_stress_failures)[:self.NUM_FAILURES_TO_DISPLAY])
     1088        new_binary_failures_to_display = ', '.join(list(new_binary_failures)[:self.NUM_FAILURES_TO_DISPLAY])
     1089
     1090        self._addToLog('stderr', '\nFailures in first run: {}'.format(list(first_run_binary_failures) + list(first_run_stress_failures)))
     1091        self._addToLog('stderr', '\nFailures in second run: {}'.format(list(second_run_binary_failures) + list(second_run_stress_failures)))
     1092        self._addToLog('stderr', '\nFlaky Tests: {}'.format(flaky_failures_string))
     1093        self._addToLog('stderr', '\nFailures on clean tree: {}'.format(list(clean_tree_stress_failures) + list(clean_tree_binary_failures)))
     1094
     1095        if new_stress_failures or new_binary_failures:
     1096            self._addToLog('stderr', '\nNew failures: {}\n'.format(list(new_binary_failures) + list(new_stress_failures)))
     1097            self.finished(FAILURE)
     1098            self.build.results = FAILURE
     1099            message = ''
     1100            if new_binary_failures:
     1101                pluralSuffix = 's' if len(new_binary_failures) > 1 else ''
     1102                message = 'Found {} new JSC binary failure{}: {}'.format(len(new_binary_failures), pluralSuffix, new_binary_failures_to_display)
     1103            if new_stress_failures:
     1104                if message:
     1105                    message += ', '
     1106                pluralSuffix = 's' if len(new_stress_failures) > 1 else ''
     1107                message += 'Found {} new JSC stress test failure{}: {}'.format(len(new_stress_failures), pluralSuffix, new_stress_failures_to_display)
     1108                if len(new_stress_failures) > self.NUM_FAILURES_TO_DISPLAY:
     1109                    message += ' ...'
     1110            self.descriptionDone = message
     1111            self.build.buildFinished([message], FAILURE)
     1112        else:
     1113            self._addToLog('stderr', '\nNo new failures\n')
     1114            self.finished(SUCCESS)
     1115            self.build.results = SUCCESS
     1116            self.descriptionDone = 'Passed JSC tests'
     1117            pluralSuffix = 's' if len(clean_tree_failures) > 1 else ''
     1118            message = ''
     1119            if clean_tree_failures:
     1120                message = 'Found {} pre-existing JSC test failure{}: {}'.format(len(clean_tree_failures), pluralSuffix, clean_tree_failures_string)
     1121            if len(clean_tree_failures) > self.NUM_FAILURES_TO_DISPLAY:
     1122                message += ' ...'
     1123            if flaky_failures:
     1124                message += ' Found flaky tests: {}'.format(flaky_failures_string)
     1125            self.build.buildFinished([message], SUCCESS)
     1126        return defer.succeed(None)
     1127
     1128    @defer.inlineCallbacks
     1129    def _addToLog(self, logName, message):
     1130        try:
     1131            log = self.getLog(logName)
     1132        except KeyError:
     1133            log = yield self.addLog(logName)
     1134        log.addStdout(message)
    10591135
    10601136
  • trunk/Tools/BuildSlaveSupport/ews-build/steps_unittest.py

    r252430 r252446  
    3535from twisted.trial import unittest
    3636
    37 from steps import (AnalyzeAPITestsResults, AnalyzeCompileWebKitResults, AnalyzeLayoutTestsResults, ApplyPatch, ApplyWatchList, ArchiveBuiltProduct, ArchiveTestResults,
     37from steps import (AnalyzeAPITestsResults, AnalyzeCompileWebKitResults, AnalyzeJSCTestsResults, AnalyzeLayoutTestsResults, ApplyPatch, ApplyWatchList, ArchiveBuiltProduct, ArchiveTestResults,
    3838                   CheckOutSource, CheckOutSpecificRevision, CheckPatchRelevance, CheckStyle, CleanBuild, CleanUpGitIndexLock, CleanWorkingDirectory,
    3939                   CompileJSC, CompileJSCToT, CompileWebKit, CompileWebKitToT, ConfigureBuild,
     
    11971197        )
    11981198        self.expectOutcome(result=FAILURE, state_string='jscore-tests (failure)')
     1199        return self.runStep()
     1200
     1201
     1202class TestAnalyzeJSCTestsResults(BuildStepMixinAdditions, unittest.TestCase):
     1203    def setUp(self):
     1204        self.longMessage = True
     1205        return self.setUpBuildStep()
     1206
     1207    def tearDown(self):
     1208        return self.tearDownBuildStep()
     1209
     1210    def configureStep(self):
     1211        self.setupStep(AnalyzeJSCTestsResults())
     1212        self.setProperty('jsc_stress_test_failures', [])
     1213        self.setProperty('jsc_binary_failures', [])
     1214        self.setProperty('jsc_rerun_stress_test_failures', [])
     1215        self.setProperty('jsc_rerun_binary_failures', [])
     1216        self.setProperty('jsc_clean_tree_stress_test_failures', [])
     1217        self.setProperty('jsc_clean_tree_binary_failures', [])
     1218
     1219    def test_single_new_stress_failure(self):
     1220        self.configureStep()
     1221        self.setProperty('jsc_stress_test_failures', ['stress/force-error.js.bytecode-cache'])
     1222        self.setProperty('jsc_rerun_stress_test_failures', ['stress/force-error.js.bytecode-cache'])
     1223        self.expectOutcome(result=FAILURE, state_string='Found 1 new JSC stress test failure: stress/force-error.js.bytecode-cache (failure)')
     1224        return self.runStep()
     1225
     1226    def test_single_new_binary_failure(self):
     1227        self.configureStep()
     1228        self.setProperty('jsc_binary_failures', ['testmasm'])
     1229        self.setProperty('jsc_rerun_binary_failures', ['testmasm'])
     1230        self.expectOutcome(result=FAILURE, state_string='Found 1 new JSC binary failure: testmasm (failure)')
     1231        return self.runStep()
     1232
     1233    def test_multiple_new_stress_failure(self):
     1234        self.configureStep()
     1235        self.setProperty('jsc_stress_test_failures', ['test{}'.format(i) for i in range(0, 30)])
     1236        self.setProperty('jsc_rerun_stress_test_failures', ['test{}'.format(i) for i in range(0, 30)])
     1237        self.expectOutcome(result=FAILURE, state_string='Found 30 new JSC stress test failures: test1, test0, test3, test2, test5, test4, test7, test6, test9, test8 ... (failure)')
     1238        return self.runStep()
     1239
     1240    def test_multiple_new_binary_failure(self):
     1241        self.configureStep()
     1242        self.setProperty('jsc_binary_failures', ['testmasm', 'testair', 'testb3', 'testdfg', 'testapi'])
     1243        self.setProperty('jsc_rerun_binary_failures', ['testmasm', 'testair', 'testb3', 'testdfg', 'testapi'])
     1244        self.expectOutcome(result=FAILURE, state_string='Found 5 new JSC binary failures: testb3, testmasm, testapi, testdfg, testair (failure)')
     1245        return self.runStep()
     1246
     1247    def test_new_stress_and_binary_failure(self):
     1248        self.configureStep()
     1249        self.setProperty('jsc_stress_test_failures', ['es6.yaml/es6/Set_iterator_closing.js.default'])
     1250        self.setProperty('jsc_binary_failures', ['testmasm'])
     1251        self.setProperty('jsc_rerun_stress_test_failures', ['es6.yaml/es6/Set_iterator_closing.js.default'])
     1252        self.setProperty('jsc_rerun_binary_failures', ['testmasm'])
     1253        self.expectOutcome(result=FAILURE, state_string='Found 1 new JSC binary failure: testmasm, Found 1 new JSC stress test failure: es6.yaml/es6/Set_iterator_closing.js.default (failure)')
     1254        return self.runStep()
     1255
     1256    def test_stress_failure_on_clean_tree(self):
     1257        self.configureStep()
     1258        self.setProperty('jsc_stress_test_failures', ['stress/force-error.js.default'])
     1259        self.setProperty('jsc_rerun_stress_test_failures', ['stress/force-error.js.default'])
     1260        self.setProperty('jsc_clean_tree_stress_test_failures', ['stress/force-error.js.default'])
     1261        self.expectOutcome(result=SUCCESS, state_string='Passed JSC tests')
     1262        return self.runStep()
     1263
     1264    def test_binary_failure_on_clean_tree(self):
     1265        self.configureStep()
     1266        self.setProperty('jsc_binary_failures', ['testdfg'])
     1267        self.setProperty('jsc_rerun_binary_failures', ['testdfg'])
     1268        self.setProperty('jsc_clean_tree_binary_failures', ['testdfg'])
     1269        self.expectOutcome(result=SUCCESS, state_string='Passed JSC tests')
     1270        return self.runStep()
     1271
     1272    def test_stress_and_binary_failure_on_clean_tree(self):
     1273        self.configureStep()
     1274        self.setProperty('jsc_stress_test_failures', ['es6.yaml/es6/Set_iterator_closing.js.default'])
     1275        self.setProperty('jsc_binary_failures', ['testair'])
     1276        self.setProperty('jsc_rerun_stress_test_failures', ['es6.yaml/es6/Set_iterator_closing.js.default'])
     1277        self.setProperty('jsc_rerun_binary_failures', ['testair'])
     1278        self.setProperty('jsc_clean_tree_stress_test_failures', ['es6.yaml/es6/Set_iterator_closing.js.default'])
     1279        self.setProperty('jsc_clean_tree_binary_failures', ['testair'])
     1280        self.expectOutcome(result=SUCCESS, state_string='Passed JSC tests')
     1281        return self.runStep()
     1282
     1283    def test_flaky_stress_and_binary_failures(self):
     1284        self.configureStep()
     1285        self.setProperty('jsc_stress_test_failures', ['stress/force-error.js.default'])
     1286        self.setProperty('jsc_binary_failures', ['testapi'])
     1287        self.expectOutcome(result=SUCCESS, state_string='Passed JSC tests')
     1288        return self.runStep()
     1289
     1290    def test_flaky_and_consistent_stress_failures(self):
     1291        self.configureStep()
     1292        self.setProperty('jsc_stress_test_failures', ['test1', 'test2'])
     1293        self.setProperty('jsc_rerun_stress_test_failures', ['test2'])
     1294        self.expectOutcome(result=FAILURE, state_string='Found 1 new JSC stress test failure: test2 (failure)')
     1295        return self.runStep()
     1296
     1297    def test_flaky_and_consistent_failures_with_clean_tree_failures(self):
     1298        self.configureStep()
     1299        self.setProperty('jsc_stress_test_failures', ['test1', 'test2'])
     1300        self.setProperty('jsc_rerun_stress_test_failures', ['test1'])
     1301        self.setProperty('jsc_clean_tree_stress_test_failures', ['test1', 'test2'])
     1302        self.expectOutcome(result=SUCCESS, state_string='Passed JSC tests')
    11991303        return self.runStep()
    12001304
  • trunk/Tools/ChangeLog

    r252443 r252446  
     12019-11-13  Aakash Jain  <aakash_jain@apple.com>
     2
     3        [ews] Add build step to Analyze JSC Tests Results
     4        https://bugs.webkit.org/show_bug.cgi?id=204174
     5
     6        Reviewed by Jonathan Bedard.
     7
     8        * BuildSlaveSupport/ews-build/steps.py:
     9        (ReRunJavaScriptCoreTests.evaluateCommand): invoke AnalyzeJSCTestsResults step.
     10        (AnalyzeJSCTestsResults): Build step to analyze layout-test results.
     11        * BuildSlaveSupport/ews-build/steps_unittest.py:
     12        (TestAnalyzeJSCTestsResults):
     13        (TestAnalyzeJSCTestsResults.test_single_new_stress_failure): Added unit-test.
     14        (TestAnalyzeJSCTestsResults.test_single_new_binary_failure): Ditto.
     15        (TestAnalyzeJSCTestsResults.test_multiple_new_stress_failure): Ditto.
     16        (TestAnalyzeJSCTestsResults.test_multiple_new_binary_failure): Ditto.
     17        (TestAnalyzeJSCTestsResults.test_new_stress_and_binary_failure): Ditto.
     18        (TestAnalyzeJSCTestsResults.test_stress_failure_on_clean_tree): Ditto.
     19        (TestAnalyzeJSCTestsResults.test_binary_failure_on_clean_tree): Ditto.
     20        (TestAnalyzeJSCTestsResults.test_stress_and_binary_failure_on_clean_tree): Ditto.
     21        (TestAnalyzeJSCTestsResults.test_flaky_stress_and_binary_failures): Ditto.
     22        (TestAnalyzeJSCTestsResults.test_flaky_and_consistent_stress_failures): Ditto.
     23        (TestAnalyzeJSCTestsResults.test_flaky_and_consistent_failures_with_clean_tree_failures): Ditto.
     24
    1252019-11-13  Jonathan Bedard  <jbedard@apple.com>
    226
Note: See TracChangeset for help on using the changeset viewer.