From 16f5deb1e255ae28de7bdeec2220bdc945e33dc8 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Tue, 22 Mar 2022 17:42:32 -0700 Subject: [PATCH] move XML validation tests into a separate CI job This parametrized test was checking the validity of checked in Graphviz HTML sources. There is no need to run this identical check in every single CI test job nor on end users machines where they may have differing versions of `xmllint` installed. Gitlab: closes #2216 --- .gitlab-ci.yml | 10 ++++++++++ rtest/test_regression.py | 24 ------------------------ 2 files changed, 10 insertions(+), 24 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6bdd32e69..2924059df 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1475,6 +1475,16 @@ lint_cmake_format: except: - tags +lint_html: + image: "$CI_REGISTRY_IMAGE/ubuntu-21.10:$CI_COMMIT_SHA" + stage: test + needs: + - docker_build_ubuntu-21.10 + script: + - git ls-files -z -- '**/*.html' | xargs -0 -- xmllint --nonet --noout --html --valid + except: + - tags + lint_pylint: image: "$CI_REGISTRY_IMAGE/ubuntu-21.10:$CI_COMMIT_SHA" stage: test diff --git a/rtest/test_regression.py b/rtest/test_regression.py index 50a390acb..7c692cf09 100644 --- a/rtest/test_regression.py +++ b/rtest/test_regression.py @@ -820,30 +820,6 @@ def test_1902(): # root directory of this checkout ROOT = Path(__file__).parent.parent.resolve() -# find all HTML files -html = set() -for (prefix, _, files) in os.walk(ROOT): - for name in files: - if Path(name).suffix.lower() in (".htm", ".html"): - html.add(Path(prefix) / name) - -@pytest.mark.parametrize("src", html) -@pytest.mark.skipif(shutil.which("xmllint") is None, reason="xmllint not found") -def test_html(src: Path): - """ - check that HTML files are valid and conforming - """ - - # validate the file - with subprocess.Popen(["xmllint", "--nonet", "--noout", "--html", "--valid", - src], stderr=subprocess.PIPE, - universal_newlines=True) as p: - _, stderr = p.communicate() - - # expect it to succeed - assert p.returncode == 0 - assert stderr == "" - def test_1855(): """ SVGs should have a scale with sufficient precision -- 2.40.0