Skip to content

Commit

Permalink
Build ACT earlResult into engine archives (#772)
Browse files Browse the repository at this point in the history
* Flatten rule folder

* Generate the rule index

* Fix dependency that's not for aria_semantics rules

* Publish ACT results with engine

* Test update

Co-authored-by: eirckr <[email protected]>
  • Loading branch information
tombrunet and ErickRenteria authored Mar 29, 2022
1 parent dd87398 commit d4e60b3
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 15 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@ jobs:
working-directory: rule-server
- run: npm run build
working-directory: rule-server
- run: node main.js &
working-directory: rule-server/dist
- run: sleep 10
working-directory: rule-server/dist
- run: npm install
working-directory: accessibility-checker
- run: npm test
working-directory: accessibility-checker/test-act
- run: gitactions/publish/achecker-engine.sh
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ export let Rpt_Aria_ValidRole: Rule = {
"en-US": {
"group": `Rpt_Aria_ValidRole.html`,
"Pass_0": `Rpt_Aria_ValidRole.html`,
"Fail_1": `Rpt_Aria_ValidRole.html`,
"Fail_2": `Rpt_Aria_ValidRole.html`
"Fail_2": `Rpt_Aria_ValidRole.html`,
"Potential_1": `Rpt_Aria_ValidRole.html`
}
},
messages: {
"en-US": {
"group": "Elements must have a valid 'role' per ARIA specification",
"Pass_0": "Rule Passed",
"Fail_2": "The role '{0}' defined on the element is not valid per ARIA specification",
"Fail_1": "Some of the roles, '{0}', defined on the element are not valid per ARIA specification"
"Potential_1": "Some of the roles, '{0}', defined on the element are not valid per ARIA specification"
}
},
rulesets: [{
Expand Down Expand Up @@ -65,7 +65,7 @@ export let Rpt_Aria_ValidRole: Rule = {
if (invalidRoles.length === roles.length) {
return RuleFail("Fail_2", [invalidRoles.join(",")]);
} else if (invalidRoles.length > 0) {
return RulePotential("Fail_1", [invalidRoles.join(",")]);
return RulePotential("Potential_1", [invalidRoles.join(",")]);
} else {
return RulePass("Pass_0");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ <h1 id="contents1">Button 1 Label</h1>
"dom": "/html[1]/body[1]",
"aria": "/status[1]/separator[1]"
},
"reasonId": "Fail_1",
"reasonId": "Potential_1",
"message": "Some of the roles, 'test', defined on the element are not valid per ARIA specification",
"messageArgs": [
"test"
Expand Down
20 changes: 10 additions & 10 deletions accessibility-checker/test-act/earlResult.json
Original file line number Diff line number Diff line change
Expand Up @@ -5168,7 +5168,7 @@
{
"@type": "Assertion",
"test": {
"title": "Rpt_Aria_ValidRole:Pass_0,Fail_1,Fail_2"
"title": "Rpt_Aria_ValidRole:Pass_0,Fail_2,Fail_1"
},
"result": {
"outcome": "earl:passed"
Expand All @@ -5183,7 +5183,7 @@
{
"@type": "Assertion",
"test": {
"title": "Rpt_Aria_ValidRole:Pass_0,Fail_1,Fail_2"
"title": "Rpt_Aria_ValidRole:Pass_0,Fail_2,Fail_1"
},
"result": {
"outcome": "earl:passed"
Expand All @@ -5198,7 +5198,7 @@
{
"@type": "Assertion",
"test": {
"title": "Rpt_Aria_ValidRole:Pass_0,Fail_1,Fail_2"
"title": "Rpt_Aria_ValidRole:Pass_0,Fail_2,Fail_1"
},
"result": {
"outcome": "earl:cantTell"
Expand All @@ -5213,7 +5213,7 @@
{
"@type": "Assertion",
"test": {
"title": "Rpt_Aria_ValidRole:Pass_0,Fail_1,Fail_2"
"title": "Rpt_Aria_ValidRole:Pass_0,Fail_2,Fail_1"
},
"result": {
"outcome": "earl:failed"
Expand All @@ -5228,7 +5228,7 @@
{
"@type": "Assertion",
"test": {
"title": "Rpt_Aria_ValidRole:Pass_0,Fail_1,Fail_2"
"title": "Rpt_Aria_ValidRole:Pass_0,Fail_2,Fail_1"
},
"result": {
"outcome": "earl:failed"
Expand All @@ -5243,7 +5243,7 @@
{
"@type": "Assertion",
"test": {
"title": "Rpt_Aria_ValidRole:Pass_0,Fail_1,Fail_2"
"title": "Rpt_Aria_ValidRole:Pass_0,Fail_2,Fail_1"
},
"result": {
"outcome": "earl:inapplicable"
Expand All @@ -5258,7 +5258,7 @@
{
"@type": "Assertion",
"test": {
"title": "Rpt_Aria_ValidRole:Pass_0,Fail_1,Fail_2"
"title": "Rpt_Aria_ValidRole:Pass_0,Fail_2,Fail_1"
},
"result": {
"outcome": "earl:inapplicable"
Expand All @@ -5273,7 +5273,7 @@
{
"@type": "Assertion",
"test": {
"title": "Rpt_Aria_ValidRole:Pass_0,Fail_1,Fail_2"
"title": "Rpt_Aria_ValidRole:Pass_0,Fail_2,Fail_1"
},
"result": {
"outcome": "earl:inapplicable"
Expand All @@ -5288,7 +5288,7 @@
{
"@type": "Assertion",
"test": {
"title": "Rpt_Aria_ValidRole:Pass_0,Fail_1,Fail_2"
"title": "Rpt_Aria_ValidRole:Pass_0,Fail_2,Fail_1"
},
"result": {
"outcome": "earl:inapplicable"
Expand All @@ -5303,7 +5303,7 @@
{
"@type": "Assertion",
"test": {
"title": "Rpt_Aria_ValidRole:Pass_0,Fail_1,Fail_2"
"title": "Rpt_Aria_ValidRole:Pass_0,Fail_2,Fail_1"
},
"result": {
"outcome": "earl:inapplicable"
Expand Down
1 change: 1 addition & 0 deletions gitactions/publish/achecker-engine.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
if [ -n "${GITHUB_REF:10}" ]; then
cd ./accessibility-checker-engine/dist
cp ../../rule-server/dist/static/archives.json ./
cp ../../accessibility-checker/test-act/earlResult.json ./
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >.npmrc;
NPM_VERSION="${GITHUB_REF:10}";
echo "Deploy accessibility-checker-engine version ${NPM_VERSION}...";
Expand Down

0 comments on commit d4e60b3

Please sign in to comment.