-
Notifications
You must be signed in to change notification settings - Fork 677
fix: Bug 1459547, add pa11y for automated local a11y testing #4768
fix: Bug 1459547, add pa11y for automated local a11y testing #4768
Conversation
What sprint 2 work does this support? |
@jwhitlock Not a specific user story but, general improvement of the Kuma front-end. This is the first step in identifying a11y issues, the next would be to start fixing the problems it highlights. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I get an error when running this command:
$ npm run test:a11y-dev
> kuma@0.1.0 test:a11y-dev /Users/john/src/kuma
> node pa11y-test.js
(node:13963) UnhandledPromiseRejectionWarning: TimeoutError: Pa11y timed out (30000ms)
at Timeout.setTimeout [as _onTimeout] (/Users/john/src/kuma/node_modules/p-timeout/index.js:27:54)
at ontimeout (timers.js:427:11)
at tryOnTimeout (timers.js:289:5)
at listOnTimeout (timers.js:252:5)
at Timer.processTimers (timers.js:212:10)
(node:13963) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:13963) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Does the command work for you?
@jwhitlock It does indeed work for me. Did you first start up your local dev environment? |
Good idea @schalkneethling. Yes, the environment was running, but I was running an alternate configuration for debugging. In my .env file:
The I logged the web node with After running
The command then times out at 30 seconds:
Then at about 57 seconds, there are follow-on requests:
There are 7 more requests in rapid succession with similar errors. After turning off When trying to debug my issue running the command, I wiped out my I'm not sure if I have recommended changes yet, but it would be nice if |
@jwhitlock Thanks for the feedback. Interesting that having the debug toolbar on causes it to timeout. Are you also running on a different port other than 8000? I will remove my shrinkwrap and node_modules and test again. That version of |
@jwhitlock using node v9.10.1 and npm 5.6.0 |
Codecov Report
@@ Coverage Diff @@
## master #4768 +/- ##
=======================================
Coverage 95.82% 95.82%
=======================================
Files 270 270
Lines 24568 24568
Branches 1750 1750
=======================================
Hits 23542 23542
Misses 814 814
Partials 212 212 Continue to review full report at Codecov.
|
Updated. I removed node_modules, removed package-lock and npm-shrinkwrap. Ran |
I installed node v8, npm 5.6.0, and the install worked for me too. Snyk is showing me an issue, but I can't see it, it appears to be associated with your user, so I'll let you look into that. No, I'm running on port 8000. The debug toolbar does interesting things, such as keep connections open so that you can debug them. I have to disable it for other PRs as well. I can add some documentation about that in a different PR. Sorry that the node stuff is complicating this PR. I'm not 100% comfortable with our node.js story. We run node tools to compile static assets, so node v6 is in the docker images, used in TravisCI, etc. For local development, we're recommending node v6, to match the version used to build assets in the docker images, but I think this recommendation is out of date. It may be time to update that recommendation. Some candidates:
My preference from a few minutes of thinking about it is to update to node v8 in the deployment environments, and leave it up to you to pick the development version. My initial preference is for v8 for development as well (and standardize on
I don't know if there is a recommended npm version to go with each node version. The one I get with node v8 is 5.6.0, and the installation succeeds with 5.6.0. I haven't tried with the recommended node v6. I think the easiest thing would be to update the docs to the current recommendation, but please try w/ v6 if you don't want to open that bag of monkeys today. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Installation works for me with node v8 and npm 5.6.0. It may work with other configurations. I haven't tested with node v6, the current recommendation for front-end development. I'm hoping @schalkneethling will try it, or update the recommendation.
"svgo": "^1.0.5" | ||
}, | ||
"dependencies": { | ||
"npm": "6.0.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
npm 5.6.0 also works for me, and for whatever reason doesn't seem to install a new command-line npm package. Maybe "npm >= 5.6.0"? Or maybe it is for libraries? We're at the limits of my npm knowledge.
Snyk is highlighting a problem with lodash, and it is minor so, we could ignore that for now I reckon. It is also not directly in our control but used by one of the other packages. Looks to be related to I have also invited you to the Snyk dashboard. |
Thanks, I can see the Snyk report now. It looks like there is a possible solution, updating to lodash@4.17.5. |
@jwhitlock So, we do not have lodash as a direct dependency so, from the report, it seems like cli-table2 needs to update their dependency[https://github.com/jamestalmage/cli-table2/issues/48] and, then whichever dependency we have need to update their cli-table2 dependency ;) People are trying to get the maintainer to publish a new release: It seems that the latest version in master does not use lodash anymore. |
Closing this out, and will use the tools locally. Thx for the review @jwhitlock |
No description provided.