Skip to content

Improvements to autotest (run towards jar, other server, print outcome to console...)#486

Open
tenzap wants to merge 4 commits intow3c:mainfrom
tenzap:autotest
Open

Improvements to autotest (run towards jar, other server, print outcome to console...)#486
tenzap wants to merge 4 commits intow3c:mainfrom
tenzap:autotest

Conversation

@tenzap
Copy link
Contributor

@tenzap tenzap commented Mar 7, 2026

Permit to build autotest without running the tests. This add a 2nd argument to the AutoTest.main which is the engine to use for tests. It can be either 'servlet' (URL to css-validator servlet at jigsaw.w3.org) or 'jar' (the presently built css-validator.jar) or 'cli' (a command line wrapper script called css-validator'

May be useful for debian package so that we can run the tests towards our build instead of official css-validator

This changes slighly the output

     [java] testsuite/properties/inherit/error/table.css...  Success
     [java] testsuite/properties/inherit/error/generated-content.css...  Success
     [java] testsuite/properties/inherit/error/ui.css...  Success
     [java] testsuite/properties/too-many-values/font.css...  Success
     [java] testsuite/properties/too-many-values/color-background.css...  Failure
     [java]     testsuite/properties/too-many-values/color-background.css
     [java]     Expected:       V:false E:25    W:0
     [java]     Result:         V:false E:24    W:0
     [java] testsuite/properties/too-many-values/text.css...  Failure

Only the errors will be written to stderr. Each item and its result is written to stdout.

By the way, some tests in testsuite/ (latest master commit of that repo) are actually failing...

@tenzap
Copy link
Contributor Author

tenzap commented Mar 7, 2026

In this log, search for "Tests outcome:"

https://debusine.debian.net/debian/developers/artifact/3376800/raw/log

The test suite is run against:

  • command line interface
  • jetty9
  • jetty12
  • tomcat10
  • tomcat11

As you can see, outcome is not consistent between the different servers and also differs wrt to cli for some tests.

EDIT: I'm pleased to announce that is MR is ready since tests all pass in debian when invoked through CLI, or as a servlet in jetty 9, 12, tomcat 10 & 11. However:

  • In debian we skip all tests that require network access, so any test querying w3.org to get the test case is skipped
  • The test http://domain.example.invalid is skipped as well, because it would lead to an exception since that host doesn't exist.
  • all tests cases which files are bigger than 6kB are skipped because when served as a servlet the server returns "URI Too Long".
  • These tests are skipped because they cause problems when served as "file input"
    • testsuite/bugs/4469.css see issue with test testsuite/bugs/4469.css #487
    • "Imported style sheets are not checked in direct input and file upload modes"
      • testsuite/bugs/697_media.html
      • testsuite/general/loops/loop1.css
      • testsuite/general/loops/loop2.css
      • testsuite/general/at-rule/valid.css
  • These are also failing at https://jigsaw.w3.org/css-validator/autotest/client/sample.html. See Failing tests at https://jigsaw.w3.org/css-validator/autotest/client/sample.html #488
    • testsuite/properties/positive/overflow-wrap/css3/001.css
    • testsuite/properties/positive/text-decoration/css3/001.css
    • testsuite/properties/positive/text-justify/css3/001.css
    • testsuite/properties/positive/text-underline-position/css3/001.css
    • testsuite/properties/positive/transform-origin/css3/001.css
    • testsuite/properties/positive/vertical-align/css3/001.css
    • testsuite/properties/positive/word-spacing/css3/001.css
    • testsuite/properties/positive/line-height/css3/001.css

Sample of test log for the debian package can be viewed https://debusine.debian.net/debian/developers/artifact/3380734/#autopkgtest. See tests having name ending with "testsuite".

@tenzap tenzap force-pushed the autotest branch 3 times, most recently from 7759df9 to 3070d71 Compare March 8, 2026 18:12
@tenzap tenzap changed the title allow running autotest towards jar instead of web service Improvements to test suite (run towards jar, other server, print outcome to console...) Mar 8, 2026
@tenzap tenzap changed the title Improvements to test suite (run towards jar, other server, print outcome to console...) Improvements to autotest (run towards jar, other server, print outcome to console...) Mar 8, 2026
Permit to build autotest without running the tests.
This add a 2nd argument to the AutoTest.main which is the engine to use for tests.
It can be either 'servlet' (URL to css-validator servlet at jigsaw.w3.org)
or 'jar' (the presently built css-validator.jar) or 'cli' (a command line wrapper script called css-validator'
tenzap added 3 commits March 10, 2026 08:13
Properly manage when the CLI errors out (instead of test failure)

Write also the outcome of CLI tests to result.html file

Display more information in the console, esp. the errors.
Compared to how parameters are passed to the servlet and their default values,
there is a difference with CLI which was causing different results when
running the test suite.

This will consider the warning argument properly, so that the count of warning
is correct depending on the value of the parameter

This will also pass the 'medium' argument properly as well, because it should
not be considered for CSS1 (like the servlet does)
Same default value as the javascript test processor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant