Skip to content

Commit

Permalink
Fix #10875: run parsed lints for visual tests
Browse files Browse the repository at this point in the history
CSS tests, due to their metadata requirement, default to visual tests,
hence it's important we run all of these lints (to in this case catch
../testharness.js)
  • Loading branch information
gsnedders committed May 9, 2018
1 parent 42006d1 commit b54c11b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion tools/lint/lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ def check_parsed(repo_root, path, f):
return [("CONTENT-MANUAL", "Manual test whose filename doesn't end in '-manual'", path, None)]

if source_file.type == "visual" and not source_file.name_is_visual:
return [("CONTENT-VISUAL", "Visual test whose filename doesn't end in '-visual'", path, None)]
errors.append(("CONTENT-VISUAL", "Visual test whose filename doesn't end in '-visual'", path, None))

for reftest_node in source_file.reftest_nodes:
href = reftest_node.attrib.get("href", "").strip(space_chars)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<!doctype html>
<link rel=help href="https://www.w3.org/TR/CSS2/visufx.html#overflow-clipping">
<script src="../../../resources/testharness.js"></script>
<script src="../../../resources/testharnessreport.js"></script>
8 changes: 8 additions & 0 deletions tools/lint/tests/test_lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,14 @@ def test_ref_same_file_path(caplog):
assert "same_file_path.html" in caplog.text


def test_css_visual_path_testharness(caplog):
rv = lint(_dummy_repo, ["css/css-unique/relative-testharness.html"], "normal")
assert rv == 3
assert "CONTENT-VISUAL" in caplog.text
assert "TESTHARNESS-PATH" in caplog.text
assert "TESTHARNESSREPORT-PATH" in caplog.text


def test_lint_passing_and_failing(caplog):
with _mock_lint("check_path") as mocked_check_path:
with _mock_lint("check_file_contents") as mocked_check_file_contents:
Expand Down

0 comments on commit b54c11b

Please sign in to comment.