-
Notifications
You must be signed in to change notification settings - Fork 62
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
Support choice of runner(s) #105
base: main
Are you sure you want to change the base?
Conversation
# Conflicts: # package.json
…t-adding-axe-caps
noticed this approach passes unit tests, works with config file array passing, but trying to start with command line args, i.e. RUNNERS=['axe,'htmlcs'] or any other format. Will close and try and work out how to get this to work |
This is a great start. But yes, To get it working with the appraoch you've gone for I'd suggess simply accepting a CSV list of runners.
|
I think there will be additional work to display this on the dashboard correctly. |
Yup! There's also a bigger discussion to be had regarding how do we expose this in the dashboard. When we added axe support to the CLI we decided to make it use only one runner per call, this was to keep the code clean and simple. However, there's argument to be made for using both runners in the dashboard in order to capture as many issues as possible, so we definitely need to discuss if/how that could happen. |
Added suggestion of a string to array function. |
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.
Looking good. We can't (IMO) default to using both htmlcs
and axe
as that would be a "breaking" change for people who upgrade. Their dashboards will potentially start reporting errors that weren't there previously for them.
if (Array.isArray(value)) { | ||
return value; | ||
} else if (typeof value === 'string') { | ||
return value.split(',').forEach(item => item.trim()); |
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.
You need to use map
to project the values from the split
array.
return value.split(',').forEach(item => item.trim()); | |
return value.split(',').map(item => item.trim()); |
@@ -32,6 +33,7 @@ if (fs.existsSync(jsonPath)) { | |||
database: env('DATABASE', 'mongodb://localhost/pa11y-webservice'), | |||
host: env('HOST', '0.0.0.0'), | |||
port: Number(env('PORT', '3000')), | |||
runners: env('RUNNERS', ['htmlcs', 'axe']), |
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.
Would this not need to use possibleCsvListToArray
? Additionally we should not default to using both htmlcs
and axe
as this will break peoples dashboards who upgrade but don't add this configuration.
runners: env('RUNNERS', ['htmlcs', 'axe']), | |
runners: possibleCsvListToArray(env('RUNNERS', 'htmlcs')), |
@jsa34 status of requested changes? |
Hey there! I just wanted to know if I can be of any help to address the remaining comments and leave this PR ready. |
Hi! I was wondering if there has been any movement on this PR? Being able to use |
Hi all, will revisit this during edit: a third related PR, which has since been closed: |
Just giving a stab at adding caps for axe runners as a config - feedback welcome!