Thank you for reviewing!

Den tors 25 juni 2026 kl 07:09 skrev Branko Čibej <[email protected]>:

> On 24. 6. 2026 21:58, [email protected] wrote:
>
> Author: dsahlberg
> Date: Wed Jun 24 19:58:27 2026
> New Revision: 1935625
>
> Log:
> On the xml-schema-validation-improvements branch:
>
> First draft describing how to run the test suite.
>
> [...]
>
> +  G.  Running the test suite
> +      ----------------------
> +
> +      The test suite can be run using any of the build systems above.
> +
> +      Each test may report PASS, XFAIL, FAIL or XPASS.
> +
> +      The first two statuses are expected and "normal":
> +      - PASS means a test completed with successful result.
> +      - XFAIL means a test failed, but this is a known issue.
> +
> +      The last two statuses are unexpected and indicate a failure:
> +      - FAIL means a test returned an unexpected result.
> +      - XPASS means a test which was expected to fail completed successfully.
> +
> +      Some tests depend on additional Python modules to do the full tests.
> +      - lxml
>
>
> ... and rnc2rng to convert the compact schema format that we have in our
> repo into the more verbose format that libxml understands.
>

That is a good catch. I was fooled by the fact that rnc2rng is not
explicitly imported, but as you say it fails during test run. Adjusted in
rXXXXX.


> +        For full XML schema validation.  If this module is not available, the
> +        test suite will fail with the error "XML: Module lxml.etree not 
> found".
> +        If you want to run the test suite without full XML schema validation
> +        you can use the --disable-xml-schema-validation option.
>
>
> I think this option is obsolete.
> [...]
>

Not at the moment (from subversion/tests/cmdline/svntest/verify.py, only
relevant parts copied):
[[[
 if svntest.main.is_xml_schema_validation_enabled():
    try:
      from lxml import etree #type:ignore
...
    except ImportError:
      logger.error("XML: Module lxml.etree not found")
      raise svntest.Failure
...
  else:
    # Use simple XML validation: just check that it parses.
    try:
      xml.etree.ElementTree.fromstring(source)
]]]

Basically: Check for the --disable-xml-schema-validation. If it is not set
(the true-branch), import lxml.etree and fail if it isn't available. If the
flag is set, instead use xml.etree.

I think this makes sense. By default try to do the full validation. If a
maintainer/packager/builder wants do do tests but really want to avoid
installing lxml, they can ask to avoid this, in which case we at least test
it parses. Assuming, of course, that xml.etree is built in to all Python
distributions.

The other option would be to try lxml and if it fails run xml.etree instead
(and removing the option completely). However there is a higher risk of
developers just "forgetting" to install lxml and the test suite succeed
when Subversion return valid xml that isn't schema compliant. I'm not fond
of that idea.

Cheers,
/Daniel

Reply via email to