Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use the conda forge implementation on the vnu-validator #17

Merged
merged 6 commits into from
Dec 10, 2023

Conversation

tonyfast
Copy link
Member

@tonyfast tonyfast commented Dec 8, 2023

@bollwyvl created a feedstock for the w3c vnu validator. this pull request integrates that effort instead of the hand rolled installation we use now.

lets have this PR only focus on CI and i'll make another PR that creates a pytest fixture for the validator assuming vnu-validator is installed with conda.

ref: conda-forge/staged-recipes#24509

Copy link

github-actions bot commented Dec 8, 2023

A preview fo the exported examples will be rendered at
https://deathbeds.github.io/nbconvert-a11y/branch/vnu-validator/exports/html/lorenz-executed-a11y.html

tests/test_w3c.py Outdated Show resolved Hide resolved
@bollwyvl
Copy link

bollwyvl commented Dec 9, 2023

Meanwhile, and unfortunately not supported particularly well with the custom vnu(.cmd) wrapper from conda-forge is running the vnu HTTP server so there is exactly one java process during a pytest session. Basically, as there is no well-known way to configure this thing via env vars or a config file, and some CLI arguments are needed for java and some to the jar it uses, I didn't want to make something up and Be Wrong On The Internet.

There's the beginning of this in the feedstock test suite, though it is incomplete:

  • it uses a new java server process every time
    • because i couldn't figure out the scope
  • it uses a new java client process
    • because I didn't spend the time to figure out the API (REST, SOAP, who knows?)

I think the goal would be a some pytest-xdist-compatible way to:

  • a fixture that starts exactly one java server process
    • even if multiple pytest-xdist runners are running
    • blocks until it answers a request
    • yields the http connection info
  • wrap that in another fixture
    • which presents a well-typed API for the VNU data model
    • optionally with async via e.g. tornado or httpx
TVnuRequestFactory = Callable[[dict], dict]

def test_use_vnu(vnu_api: TVnuRequestFactory):
    vnu_res = make_a_vnu_request({"file": some_html_file.read_text()})
    assert vnu_res["violations"]

@tonyfast
Copy link
Member Author

so is the short term to ship the inefficient solution and work on the tests themselves then handle the server in another go?

@bollwyvl
Copy link

I think on an infrastructure PR, it might be worth going the extra mile to get that per-test time down. I'll take a look.

@tonyfast
Copy link
Member Author

thanks bro. i think one of the features of the vnu validator is that it just needs to be run as one shot. where axe and others depend on the page state, vnu can check in a single pass. so likely that will reduce the number of web servers required for these specific checks

@bollwyvl bollwyvl mentioned this pull request Dec 10, 2023
12 tasks
@bollwyvl
Copy link

Recommend running/pushing ruff here, then looking at:

https://github.com/deathbeds/nbconvert-a11y/pull/19/files

@bollwyvl
Copy link

bollwyvl commented Dec 10, 2023

Also, noted from #19:

  • it would be nice if the actions that can't succeed from forks were gated so that contributors aren't guaranteed to see 🔴
  • the names of the workflows are too long to really read what is failing

@tonyfast tonyfast merged commit b153cc1 into main Dec 10, 2023
4 checks passed
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.

2 participants