master.cfg should handle special return codes of run-perf-tests
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 18 Aug 2014 09:52:33 +0000 (09:52 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 18 Aug 2014 09:52:33 +0000 (09:52 +0000)
https://bugs.webkit.org/show_bug.cgi?id=135974

Patch by Renato Nagy <nagy.renato@stud.u-szeged.hu> on 2014-08-18
Reviewed by Ryosuke Niwa.

* BuildSlaveSupport/build.webkit.org-config/master.cfg:
(RunAndUploadPerfTests.getText2):
* BuildSlaveSupport/build.webkit.org-config/mastercfg_unittest.py:
(RunAndUploadPerfTestsTest):
(RunAndUploadPerfTestsTest.assertResults):
(RunAndUploadPerfTestsTest.test_tests_failed):
(RunAndUploadPerfTestsTest.test_build_bad_build):
(RunAndUploadPerfTestsTest.test_build_bad_source_json):
(RunAndUploadPerfTestsTest.test_build_bad_marge):
(RunAndUploadPerfTestsTest.test_build_bad_failed_uploading):
(RunAndUploadPerfTestsTest.test_build_bad_preparation):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@172701 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/BuildSlaveSupport/build.webkit.org-config/master.cfg
Tools/BuildSlaveSupport/build.webkit.org-config/mastercfg_unittest.py
Tools/ChangeLog

index 76c4fe7..15ab1c9 100644 (file)
@@ -726,7 +726,18 @@ class RunAndUploadPerfTests(shell.Test):
 
     def getText2(self, cmd, results):
         if results != SUCCESS:
-            return ["%d perf tests failed" % cmd.rc]
+            if cmd.rc == -1 & 0xff:
+                return ["build not up to date"]
+            elif cmd.rc == -2 & 0xff:
+                return ["slave config JSON error"]
+            elif cmd.rc == -3 & 0xff:
+                return ["output JSON merge error"]
+            elif cmd.rc == -4 & 0xff:
+                return ["upload error"]
+            elif cmd.rc == -5 & 0xff:
+                return ["system dependency error"]
+            else:
+                return ["%d perf tests failed" % cmd.rc]
 
         return [self.name]
 
index 51b1e82..cfbce38 100755 (executable)
@@ -426,6 +426,36 @@ New API detected in GObject DOM bindings
         self.assertResults(expected_missing=False, expected_new=False, stdio="")
 
 
+class RunAndUploadPerfTestsTest(unittest.TestCase):
+    def assertResults(self, rc, expected_text):
+        cmd = StubRemoteCommand(rc, expected_text)
+        step = RunAndUploadPerfTests()
+        step.commandComplete(cmd)
+        actual_results = step.evaluateCommand(cmd)
+        actual_text = str(step.getText2(cmd, actual_results)[0])
+        self.assertEqual(expected_text, actual_text)
+
+    def test_success(self):
+        self.assertResults(0, "perf-test")
+
+    def test_tests_failed(self):
+        self.assertResults(5, "5 perf tests failed")
+
+    def test_build_bad_build(self):
+        self.assertResults(255, "build not up to date")
+
+    def test_build_bad_source_json(self):
+        self.assertResults(254, "slave config JSON error")
+
+    def test_build_bad_marge(self):
+        self.assertResults(253, "output JSON merge error")
+
+    def test_build_bad_failed_uploading(self):
+        self.assertResults(252, "upload error")
+
+    def test_build_bad_preparation(self):
+        self.assertResults(251, "system dependency error")
+
 # FIXME: We should run this file as part of test-webkitpy.
 # Unfortunately test-webkitpy currently requires that unittests
 # be located in a directory with a valid module name.
index b93c86b..3ef612a 100644 (file)
@@ -1,3 +1,22 @@
+2014-08-18  Renato Nagy  <nagy.renato@stud.u-szeged.hu>
+
+        master.cfg should handle special return codes of run-perf-tests
+        https://bugs.webkit.org/show_bug.cgi?id=135974
+
+        Reviewed by Ryosuke Niwa.
+
+        * BuildSlaveSupport/build.webkit.org-config/master.cfg:
+        (RunAndUploadPerfTests.getText2):
+        * BuildSlaveSupport/build.webkit.org-config/mastercfg_unittest.py:
+        (RunAndUploadPerfTestsTest):
+        (RunAndUploadPerfTestsTest.assertResults):
+        (RunAndUploadPerfTestsTest.test_tests_failed):
+        (RunAndUploadPerfTestsTest.test_build_bad_build):
+        (RunAndUploadPerfTestsTest.test_build_bad_source_json):
+        (RunAndUploadPerfTestsTest.test_build_bad_marge):
+        (RunAndUploadPerfTestsTest.test_build_bad_failed_uploading):
+        (RunAndUploadPerfTestsTest.test_build_bad_preparation):
+
 2014-08-17  Brent Fulgham  <bfulgham@apple.com>
 
         [Win] Unreviewed change to force rebuild