diff options
author | Allan Sandfeld Jensen <allan.jensen@digia.com> | 2013-09-13 12:51:20 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-19 20:50:05 +0200 |
commit | d441d6f39bb846989d95bcf5caf387b42414718d (patch) | |
tree | e367e64a75991c554930278175d403c072de6bb8 /Tools/Scripts/webkitpy/common/net/layouttestresults.py | |
parent | 0060b2994c07842f4c59de64b5e3e430525c4b90 (diff) | |
download | qtwebkit-d441d6f39bb846989d95bcf5caf387b42414718d.tar.gz |
Import Qt5x2 branch of QtWebkit for Qt 5.2
Importing a new snapshot of webkit.
Change-Id: I2d01ad12cdc8af8cb015387641120a9d7ea5f10c
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
Diffstat (limited to 'Tools/Scripts/webkitpy/common/net/layouttestresults.py')
-rw-r--r-- | Tools/Scripts/webkitpy/common/net/layouttestresults.py | 91 |
1 files changed, 1 insertions, 90 deletions
diff --git a/Tools/Scripts/webkitpy/common/net/layouttestresults.py b/Tools/Scripts/webkitpy/common/net/layouttestresults.py index 74322c757..b8cb15769 100644 --- a/Tools/Scripts/webkitpy/common/net/layouttestresults.py +++ b/Tools/Scripts/webkitpy/common/net/layouttestresults.py @@ -25,9 +25,6 @@ # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -# A module for parsing results.html files generated by old-run-webkit-tests -# This class is one big hack and only needs to exist until we transition to new-run-webkit-tests. import logging @@ -45,88 +42,6 @@ def path_for_layout_test(test_name): return "LayoutTests/%s" % test_name -class ORWTResultsHTMLParser(object): - """This class knows how to parse old-run-webkit-tests results.html files.""" - - stderr_key = u'Tests that had stderr output:' - fail_key = u'Tests where results did not match expected results:' - timeout_key = u'Tests that timed out:' - # FIXME: This may need to be made aware of WebKitTestRunner results for WebKit2. - crash_key = u'Tests that caused the DumpRenderTree tool to crash:' - missing_key = u'Tests that had no expected results (probably new):' - webprocess_crash_key = u'Tests that caused the Web process to crash:' - - expected_keys = [ - stderr_key, - fail_key, - crash_key, - webprocess_crash_key, - timeout_key, - missing_key, - ] - - @classmethod - def _failures_from_fail_row(self, row): - # Look at all anchors in this row, and guess what type - # of new-run-webkit-test failures they equate to. - failures = set() - test_name = None - for anchor in row.findAll("a"): - anchor_text = unicode(anchor.string) - if not test_name: - test_name = anchor_text - continue - if anchor_text in ["expected image", "image diffs"] or '%' in anchor_text: - failures.add(test_failures.FailureImageHashMismatch()) - elif anchor_text in ["expected", "actual", "diff", "pretty diff"]: - failures.add(test_failures.FailureTextMismatch()) - else: - _log.warning("Unhandled link text in results.html parsing: %s. Please file a bug against webkitpy." % anchor_text) - # FIXME: Its possible the row contained no links due to ORWT brokeness. - # We should probably assume some type of failure anyway. - return failures - - @classmethod - def _failures_from_row(cls, row, table_title): - if table_title == cls.fail_key: - return cls._failures_from_fail_row(row) - if table_title == cls.crash_key: - return [test_failures.FailureCrash()] - if table_title == cls.webprocess_crash_key: - return [test_failures.FailureCrash(process_name="WebProcess")] - if table_title == cls.timeout_key: - return [test_failures.FailureTimeout()] - if table_title == cls.missing_key: - return [test_failures.FailureMissingResult(), test_failures.FailureMissingImageHash(), test_failures.FailureMissingImage()] - return None - - @classmethod - def _test_result_from_row(cls, row, table_title): - test_name = unicode(row.find("a").string) - failures = cls._failures_from_row(row, table_title) - # TestResult is a class designed to work with new-run-webkit-tests. - # old-run-webkit-tests does not save quite enough information in results.html for us to parse. - # FIXME: It's unclear if test_name should include LayoutTests or not. - return test_results.TestResult(test_name, failures) - - @classmethod - def _parse_results_table(cls, table): - table_title = unicode(table.findPreviousSibling("p").string) - if table_title not in cls.expected_keys: - # This Exception should only ever be hit if run-webkit-tests changes its results.html format. - raise Exception("Unhandled title: %s" % table_title) - # Ignore stderr failures. Everyone ignores them anyway. - if table_title == cls.stderr_key: - return [] - # FIXME: We might end with two TestResults object for the same test if it appears in more than one row. - return [cls._test_result_from_row(row, table_title) for row in table.findAll("tr")] - - @classmethod - def parse_results_html(cls, page): - tables = BeautifulSoup(page).findAll("table") - return sum([cls._parse_results_table(table) for table in tables], []) - - # FIXME: This should be unified with ResultsSummary or other NRWT layout tests code # in the layout_tests package. # This doesn't belong in common.net, but we don't have a better place for it yet. @@ -135,12 +50,8 @@ class LayoutTestResults(object): def results_from_string(cls, string): if not string: return None - # For now we try to parse first as json, then as results.html - # eventually we will remove the html fallback support. test_results = ResultsJSONParser.parse_results_json(string) if not test_results: - test_results = ORWTResultsHTMLParser.parse_results_html(string) - if not test_results: return None return cls(test_results) @@ -150,7 +61,7 @@ class LayoutTestResults(object): self._unit_test_failures = [] # FIXME: run-webkit-tests should store the --exit-after-N-failures value - # (or some indication of early exit) somewhere in the results.html/results.json + # (or some indication of early exit) somewhere in the results.json # file. Until it does, callers should set the limit to # --exit-after-N-failures value used in that run. Consumers of LayoutTestResults # may use that value to know if absence from the failure list means PASS. |