Commit fd7a462e authored by ossy@webkit.org's avatar ossy@webkit.org

Make build.webkit.org report the number of failing run-fast-jsc tests

https://bugs.webkit.org/show_bug.cgi?id=120766

Reviewed by Filip Pizlo.

* BuildSlaveSupport/build.webkit.org-config/master.cfg:
(RunJavaScriptCoreTests.commandComplete):
(RunJavaScriptCoreTests.getText2):
* BuildSlaveSupport/build.webkit.org-config/mastercfg_unittest.py:
(RunJavaScriptCoreTestsTest): Added.
(RunJavaScriptCoreTestsTest.assertResults):
(RunJavaScriptCoreTestsTest.test_no_regressions_old_output):
(RunJavaScriptCoreTestsTest.test_mozilla_failure_old_output):
(RunJavaScriptCoreTestsTest.test_mozilla_failure_new_output):
(RunJavaScriptCoreTestsTest.test_fast_js_failure_new_output):
(RunJavaScriptCoreTestsTest.test_fast_js_crash_new_output):
(RunJavaScriptCoreTestsTest.test_mozilla_and_fast_js_failure_new_output):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155124 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 54ff1396
......@@ -257,13 +257,33 @@ class RunJavaScriptCoreTests(shell.Test):
def commandComplete(self, cmd):
shell.Test.commandComplete(self, cmd)
logText = cmd.logs['stdio'].getText()
statusLines = [line for line in logText.splitlines() if line.find('regression') >= 0 and line.find(' found.') >= 0]
if statusLines and statusLines[0].split()[0] != '0':
self.regressionLine = statusLines[0]
else:
self.regressionLine = None
expressions = [
('failing Mozilla test', re.compile(r'(\d+) regression')),
('failing fast/js test', re.compile(r'(\d+) failure')),
('crashing fast/js test', re.compile(r'(\d+) crash')),
]
resultLines = {}
for line in logText.splitlines():
for name, expression in expressions:
match = expression.search(line)
if match:
resultLines[name] = int(match.group(1))
break
self.regressionLine = []
for name in resultLines:
failures = resultLines[name]
if not failures:
continue
if failures == 1:
pluralSuffix = ''
else:
pluralSuffix = 's'
self.regressionLine.append("%d %s%s " % (failures, name, pluralSuffix))
if 'actual.html (source)' in cmd.logs:
self.addHTMLLog('actual.html', cmd.logs['actual.html (source)'].getText())
......@@ -281,11 +301,9 @@ class RunJavaScriptCoreTests(shell.Test):
return self.getText2(cmd, results)
def getText2(self, cmd, results):
if results != SUCCESS and self.regressionLine:
return [self.name, self.regressionLine]
return [self.name]
result = [self.name]
result.extend(self.regressionLine)
return result
class RunWebKitTests(shell.Test):
name = "layout-test"
......
......@@ -101,6 +101,68 @@ class StubRemoteCommand(object):
self.logs = {'stdio': StubStdio(stdio)}
class RunJavaScriptCoreTestsTest(unittest.TestCase):
def assertResults(self, expected_result, expected_text, rc, stdio):
cmd = StubRemoteCommand(rc, stdio)
step = RunJavaScriptCoreTests()
step.commandComplete(cmd)
actual_results = step.evaluateCommand(cmd)
actual_text = step.getText2(cmd, actual_results)
self.assertEqual(expected_result, actual_results)
self.assertEqual(actual_text, expected_text)
def test_no_regressions_old_output(self):
self.assertResults(SUCCESS, ["jscore-test"], 0, """Results for Mozilla tests:
0 regressions found.
0 tests fixed.
OK.""")
def test_mozilla_failure_old_output(self):
self.assertResults(FAILURE, ["jscore-test", '1 failing Mozilla test '], 1, """Results for Mozilla tests:
1 regression found.
0 tests fixed.""")
def test_mozilla_failure_new_output(self):
self.assertResults(FAILURE, ["jscore-test", '1 failing Mozilla test '], 1, """Results for Mozilla tests:
1 regression found.
0 tests fixed.
Results for fast/js tests:
0 failures found.
0 crashes found.
OK.""")
def test_fast_js_failure_new_output(self):
self.assertResults(FAILURE, ["jscore-test", '469 failing fast/js tests '], 1, """Results for Mozilla tests:
0 regressions found.
0 tests fixed.
OK.
Results for fast/js tests:
469 failures found.
0 crashes found.""")
def test_fast_js_crash_new_output(self):
self.assertResults(FAILURE, ["jscore-test", '1 crashing fast/js test '], 1, """Results for Mozilla tests:
0 regressions found.
0 tests fixed.
OK.
Results for fast/js tests:
0 failures found.
1 crashes found.""")
def test_mozilla_and_fast_js_failure_new_output(self):
self.assertResults(FAILURE, ["jscore-test", '1 failing Mozilla test ', '469 failing fast/js tests '], 1, """Results for Mozilla tests:
1 regression found.
0 tests fixed.
Results for fast/js tests:
469 failures found.
0 crashes found.""")
class RunQtAPITestsTest(unittest.TestCase):
def assertResults(self, expected_result, expected_text, stdio):
rc = 0
......
2013-09-05 Csaba Osztrogonác <ossy@webkit.org>
Make build.webkit.org report the number of failing run-fast-jsc tests
https://bugs.webkit.org/show_bug.cgi?id=120766
Reviewed by Filip Pizlo.
* BuildSlaveSupport/build.webkit.org-config/master.cfg:
(RunJavaScriptCoreTests.commandComplete):
(RunJavaScriptCoreTests.getText2):
* BuildSlaveSupport/build.webkit.org-config/mastercfg_unittest.py:
(RunJavaScriptCoreTestsTest): Added.
(RunJavaScriptCoreTestsTest.assertResults):
(RunJavaScriptCoreTestsTest.test_no_regressions_old_output):
(RunJavaScriptCoreTestsTest.test_mozilla_failure_old_output):
(RunJavaScriptCoreTestsTest.test_mozilla_failure_new_output):
(RunJavaScriptCoreTestsTest.test_fast_js_failure_new_output):
(RunJavaScriptCoreTestsTest.test_fast_js_crash_new_output):
(RunJavaScriptCoreTestsTest.test_mozilla_and_fast_js_failure_new_output):
2013-09-05 Csaba Osztrogonác <ossy@webkit.org>
Make run-fast-jsc script bash, dash and Darwin's /bin/sh friendly
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment