-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[RFC][Development workflow] Pa11y performance bump #3280
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
Conversation
|
🟢 No significant changes to |
|
I experimented with puppeteer and performance and the previous implementation with parallel browsers is excellent. Moving to pages instead of browsers I could reduce the tests by a few minutes but it adds a risk that a single page can crash the browser with multiple pages. The biggest fixable bottleneck I can see is the number of pages tested. If this solution causes problems, the other idea I have is using I am not the biggest fan of the ids having the be unique in every example. I feel like users and developers won't care as long as the pages and examples work. The trade-off here feels good. |
|
Thanks for this, I'm so surprised this went up to such a high build time! I have a few thoughts and context.
My gut feeling tells me we'd be getting speed improvements and more value by running tests on "All examples" pages for each component, rather than having a single huge test. Have you considered this approach?
I'd say yes, in order to catch silly mistakes, and as long as it only takes a few minutes.
+1 to GitHub actions if it makes it any faster. Do you expect it to be the case? (I believe Buildkite would be opaque to open-source contributors)
Some tests might need to run separately: polaris-react/.storybook/polaris-readme-loader.js Lines 27 to 37 in 84cdcaa
Yes to using Axe! Given that can run axe with Pa11y, using this configuration: {
runners: [
'axe',
]
}Source: https://github.com/pa11y/pa11y#runners-array Is there anything else we'd get from switching to axe-puppeteer? |
|
I'd be interested to know the root-cause for this speed regression? Was it Travis changing their images/resource allocation or the result of some PR we merged?
As Kaelig alluded to buildkite is private-only so not suited for open source stuff. If the problem here is "the performance of Travis runners dropped through the floor" then I'd be interested to see if the performance of GH actions is better. Do we know the root cause of when this became drastically slower? IIRC the a11y tests took about 10mins before GH Actions is supported so it is certainly an option, and I think it would also help solve some of our other "should this test run when people make a fork" issues.
Bunging everything in one page (even the "per component all-examples pages") doesn't always work, because some components have overlay effects that would interfere with other component demos. For example the "modal" and "sheet" end up overlaying everything and so they don't appear on the All examples pages. Same goes for AppProvider and Frame and others in that One test per story feels like overkill but it does enforce encapsulation so we know the examples don't interact and means that folks won't need to worry about "is this id used by any other test"
That sounds like a great approach. If one of our stories does something jank enough to enough to crash a google chrome tab then we've got bigger problems than with incomplete CI tests :D I'd prefer using tabs rather than multiple browsers (possibly in combo with "move to GH Actions") over the "test one giant page" approach. |
Note that stability with pages was a big issue when Andre and I worked on testing performance a couple of years ago. Things were really brittle as builds kept breaking with timeouts or loading issues. I'd expect dependencies such as puppeteer to have gotten a lot better since then, so it's worth a shot. |
|
Been mucking about with this in #3284 too. Baselines: Current runtime ~45mins. Pre-regression runtime: ~13mins
My error reporting output could do with some love but the raw data is there. As a bonus using axe means the errors reported are the same as what the a11y panel in storybook reports, e.g. https://polaris-react.herokuapp.com/?path=/story/all-components-top-bar--top-bar-with-all-of-its-elements contains one of the now failing contrast tests To go further we could set the isSkippedStory logic to be |
|
Thanks @BPScott this seems like a much safer approach. Lets keep moving forward with your pull request. |
WHY are these changes introduced?
Pa11y tests are taking ~45 minutes to complete on travis. This is due to the 600+ pages we currently test. This PR removes the need to test 600+ pages and run pa11y only on the kitchen sink page which puts all the components in one place. This reduces run time to ~5minutes.
The current set up leads to people skipping the tests or waiting for a long time to do a release. Neither are acceptable. This is a request for comments to start to solve this issue.
Some questions to start conversation:
WHAT is this pull request doing?
How to 🎩
🎩 checklist
README.mdwith documentation changes