-
Notifications
You must be signed in to change notification settings - Fork 311
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
Pa11y runs are too slow #3752
Comments
Path forward for this ticket may be determined by outcome of TLC-crew #474 |
Working on an ADR to search for tools to address this |
Issue that blocks this work is here! |
Thanks @echappen! Can you link to the ADR as well? And then I think we decided we could move this one to done as the ticket names a specific solution. Let me know if you disagree or think the content of the ticket should be captured in the other ticket. |
To recap the story of TLC’s pa11y work that came out of this issue:
In the interest of keeping the underlying problem ("pa11y runs are too slow") top of mind, I'm going to remove this issue from Blocked, but replace it with the issue in no 3 (TLC Crew 501) in the Blocked column. |
Actually, I think the easiest thing would be to do what John suggested: keep this issue in Blocked, update the title to "Pa11y runs are too slow" and remove the proposed solution (or at least downgrade it as one option to explore, of many). @alexsoble as the original poster, can you make those changes? |
Tagged the wrong Alex—should be @alexsobledotgov |
Let's investigate these CI slowdowns and see if we have a quick fix here. I think we should put someone on this issue so we can at least figure out better paths forward since we are probably sticking with pa11y for the immediate future. We should probably timebox the investigation too. |
Per our discussion at TLC Planning on 12/11/23, let's try this:
|
For bullet point 3 above, as an example, Tock also runs a job on a daily schedule. Feel free to reuse the Tock configuration. As for notifications, we do an audit every week which lets us catch CI errors, but that probably won't work for TLC. |
validated concurrency problem: concurrency 1:
concurrency 2:
explored the
did some desk research at https://opensource.com/article/23/2/automated-accessibility-testing`
recommendations:
|
I'm coming to this thread after waiting 22 minutes for a pa11y scan. Changing a single boolean value (#3822) has now taken about an hour. Where did we leave off with this? With @echappen's last comment, it looks like the path forward had been decided — use pa11y-limited for PR CI runs, and schedule full runs to be daily, like Tock. Is there any compelling reason that someone shouldn't go ahead implement those changes? (I'm going to regret asking permission instead of forgiveness, aren't I?) |
@beechnut Tasks 1 and 2 should be straightforward. No. 3 gets fuzzy over who should be notified of job failures. TLC crew members are too transient for this. Maybe TLC leads could be notified of failures, and then they can assign whoever’s on the crew at that time to fix them. |
@caleywoods For limited runs, I was thinking about a Ruby script that:
|
@beechnut I agree, I was also thinking about For the complete/full scan I think that's easy enough to run on a schedule via GH actions similar to a cron just in the way that the provided Tock scheduled job is working. For the other point(s) I think we can tackle those after we take care of these first two. Edit: Example of wrapping multiple instances of pa11y with |
I have good news: on a local installation, $ pa11y-ci 404.html _site/500/index.html
Running Pa11y on 2 URLs:
> file:///Users/path/to/18f.gsa.gov/404.html - 0 errors
> file:///Users/path/to/18f.gsa.gov/_site/500/index.html - 0 errors
✔ 2/2 URLs passed So we may not even have to run the server to do the checks, if we're running the checks on the built It doesn't say so particularly clearly in the docs, but The problem I keep running into is that I'm averse to getting overly clever, but, here's what's on my mind as possible ways to get the changed files/URLs given this constraint.
|
I typically don't like stateful solutions but honestly I prefer 2 above -- if I read you right, we'd store a file of sha1 (or whatever) hashes of _site paths and commit that file and then only test these paths that don't match the hashes? Downside is that we'd have to update that file somehow but that can be done in a separate (automated?) step, maybe. The first option seems a bit too fiddly for me. 🤷🏻 |
One clarification: I don't see a need to hash anything — git diffing does everything we need. Otherwise, yes: we diff the source files to get new/changed source files, use Jekyll hooks on those new/changed source files to identify the resulting site files, and then run pa11y only on the new/changed site files. Agreed, the first is quite fiddly. The second feels fiddly to me as well, but hopefully manageably so. |
This work attempts to solve the problem of overly long CI runs, in which single PRs were taking 25+ minutes, because each PR scans every page with pa11y-ci. See #3752. This commit adds a Jekyll::Hook which keeps track of which destination files (built HTML files) should be checked with pa11y-ci for each PR. The files to check are based on which files changed in the last commit. The design of the code lets you swap out different "differs", which are the objects responsible for getting the list of files. This design makes the code easier to test, and makes it more adaptable. One problem I'm seeing so far is that we only check what files were changed *in the last commit*. This means that, if you're ever running CI locally, you'd have to commit your changes to have them picked up by the "differ". We should probably change this in a future commit, and have a "differ" for local development and a "differ" for CI. To summarize, the differs should differ. We also have yet to implement the case where a stylesheet or something site-wide changes.
@caleywoods I just pushed a draft branch with the hook. The commit message explains where I left off. |
@caleywoods I just added site-wide checking to the same branch. |
#3829 Satisfies this I believe. |
@caleywoods #3829 satisfies the first two points of the acceptance criteria, and we need #3832 to check off the last two. |
Thanks, I was coming back to adjust my comment and you beat me to it! |
Chatted with @caleywoods: The work is done 🎉 Associated wiki entry that covers everything in detail: https://github.com/18F/18f.gsa.gov/wiki/CircleCI-scheduled-nightly-pa11y-scan We have some refinements we could do, but these are likely lower priority:
Closing in favor of #4027 |
Problem
As of 4/12/24: There's been a lot of activity on this ticket! We're moving it forward with the following acceptance criteria:
Acceptance criteria
The text was updated successfully, but these errors were encountered: