-
Notifications
You must be signed in to change notification settings - Fork 6
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
Update sitemap a11y scan #463
Merged
Merged
Changes from 86 commits
Commits
Show all changes
90 commits
Select commit
Hold shift + click to select a range
810cb29
update sitemap a11y scan
tjheffner 6e4b3ec
Add comment
tjheffner d980b50
adding sample workflow for a11y testing
alexfinnarn 16f6e82
update test run and GH workflow
alexfinnarn b63002d
debug local package linking
alexfinnarn 2d0784f
more debugging on linking local packages
alexfinnarn b3dc48d
try debugging linking local packages again
alexfinnarn ba639c9
move sitemap functions into a11y test for now
alexfinnarn afc9019
try splitting tests out at higher level
alexfinnarn b298c5a
try using shard index for page segments
alexfinnarn 0adc7a8
try removing shard option
alexfinnarn d429c1c
try building proxy-fetcher
alexfinnarn 10e6658
debug downloading reportS
alexfinnarn 282996e
debug uploading merged reports
alexfinnarn b20481a
try scanning all pages with 32 runners
alexfinnarn b7c8e6d
change batch size variables
alexfinnarn 9b4bdad
add more segments, write to json instead of txt
alexfinnarn 51a1bc6
adjust logic for splitting pages into segments
alexfinnarn d80b51b
try testing all pages now
alexfinnarn dce10d7
debug last segment on GHA
alexfinnarn e2b00b2
next-build content release workflow (#424)
tjheffner ffe2c83
swap public image for ecr image (#471)
tjheffner cd17448
add preview auth secrets to the preview ci check (#474)
tjheffner 1f024ec
Revert "Bump next from 13.5.6 to 14.1.3" (#472)
tjheffner 33ed303
bubble up errors from env handler child process (#475)
tjheffner e9f3109
add more shards to see if last segment is still acting weird
alexfinnarn 63b09cc
fix off by one shard index error
alexfinnarn 5fd120f
Merge branch 'main' into VACMS-16117-playwright-a11y-tests
alexfinnarn 785e094
actually test all pages
alexfinnarn 07d618e
debug picking random env var values
alexfinnarn 767ce64
debug picking random env vars
alexfinnarn bdc23cd
do not use dynamic env vars
alexfinnarn cd31bc9
test new code with few pages
alexfinnarn 2c66a16
add back 64 runners
alexfinnarn cae55ed
try with moving config to a11y project
alexfinnarn 267d060
try removing root JSON array a different way before saving data
alexfinnarn b5cf314
combine JSON debug
alexfinnarn 6f27ca7
get it right, man
alexfinnarn 62565e6
add comma at the end of JSON output for better merging
alexfinnarn ace6e57
sed to the rescue?
alexfinnarn fe7ecb4
release the hounds
alexfinnarn a79372e
try one less runner to see if the last one still causes issues
alexfinnarn 62e0ad9
try exiting last runner early; try different matrix syntax
alexfinnarn 9fedea6
revert matrix syntax
alexfinnarn 3874466
try exiting the last run a different way
alexfinnarn 8fcf11e
try no retries to see if last run passes
alexfinnarn d8365dd
weird GH workflow syntax error
alexfinnarn 0090c21
try removing shardTotal from matrix since only one value
alexfinnarn 0a3a3df
remove total segments env var from test run command
alexfinnarn db870ce
test with expect
tjheffner 9f09d14
import expect for this test
tjheffner 25d4650
simple expects
tjheffner b7da389
find body instead of url, sure
tjheffner 45b5fa1
add some docs
alexfinnarn 630b83f
try waiting at the end, cause waiting is the hardest part
alexfinnarn 0c4087c
try smaller number of pages
alexfinnarn 74ef94c
add more runners
alexfinnarn cf1384b
try reversing the sitemap
alexfinnarn 08a08d6
add exclude list for certain URLs that are redirects
alexfinnarn 73942e9
add exclude list for certain URLs that are redirects
alexfinnarn 2dde577
add more exclude
alexfinnarn acf48ad
add more exclude
alexfinnarn 21ca894
try not swapping https to http
alexfinnarn f147409
revert https change, add more exclude urls
alexfinnarn 7734253
try all pages in scan
alexfinnarn 43c2380
add another exclude
alexfinnarn 3cb43b1
rearrage spec test to be more readable code flow
alexfinnarn 6b94f68
try fewer runners with assumption shared resources are causing load i…
alexfinnarn 3b0c80e
try try/catch to see if that can skip can faliures instead of totally…
alexfinnarn bb627b6
use right array of pages after refactor
alexfinnarn b890aac
try run again with try/catch and writing failed pages to a file
alexfinnarn 9ad7870
try 128 runners again
alexfinnarn c0c4c15
try scan without list of excluded pages
alexfinnarn d6173d4
try once more with catching error message
alexfinnarn 2aeb139
final test?
alexfinnarn 5d3dd27
Merge branch 'main' into VACMS-16117-playwright-a11y-tests
alexfinnarn 55d483e
deal with when no errors are found
alexfinnarn 0e171e1
add back excluded pages
alexfinnarn 7b40ef6
exit 0 not exit 1
alexfinnarn 25f4ffd
Merge branch 'main' into VACMS-16117-playwright-a11y-tests
alexfinnarn 522b1fa
code review suggestions
alexfinnarn cec1a0c
updates from code review; try makeAxeBuilder
alexfinnarn c5a62f1
add two more exclude pages, try run again
alexfinnarn f02a401
try to ignore when no files found to upload and supress warning
alexfinnarn 6fc449e
add another ignore when no files found to upload
alexfinnarn d68b937
Merge branch 'main' into VACMS-16117-playwright-a11y-tests
alexfinnarn 4f7d041
Merge branch 'main' into VACMS-16117-playwright-a11y-tests
alexfinnarn 84cebca
set scan to run on a schedule and also manual trigger
alexfinnarn ad3242d
bump for tugboat error
alexfinnarn c01c99b
try quoting cron schedule string
alexfinnarn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,152 @@ | ||
name: A11y Tests | ||
on: | ||
pull_request: | ||
branches: [ main ] | ||
jobs: | ||
playwright-tests: | ||
timeout-minutes: 60 | ||
runs-on: ubuntu-latest | ||
env: | ||
BASE_URL: 'https://va.gov' | ||
USE_PROXY: false | ||
PW_BROWSER: '["chromium", "firefox", "webkit"]' | ||
PW_WIDTH: '[320, 768, 1024, 1280, 1920]' | ||
PW_HEIGHT: '[720, 1080, 1440]' | ||
TOTAL_SEGMENTS: 128 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
shardIndex: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18 | ||
|
||
- name: Install jq | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y jq | ||
|
||
- name: Run command with random values from arrays | ||
run: | | ||
arrays=('${{ env.PW_BROWSER }}' '${{ env.PW_HEIGHT }}' '${{ env.PW_WIDTH }}') | ||
array_names=('PW_BROWSER' 'PW_HEIGHT' 'PW_WIDTH') | ||
|
||
for i in "${!arrays[@]}"; do | ||
json_string="${arrays[$i]}" | ||
array_name="${array_names[$i]}" | ||
|
||
array=$(echo "$json_string" | jq -c '.') | ||
random_index=$((RANDOM % $(echo "$array" | jq 'length'))) | ||
random_value=$(echo "$array" | jq -r ".[$random_index]") | ||
echo "Selected random value from $array_name: $random_value" | ||
echo "${array_name}_VALUE=$random_value" >> $GITHUB_ENV | ||
done | ||
|
||
- name: Ensure random values are set | ||
run: | | ||
echo "Using random values: $PW_BROWSER_VALUE, $PW_WIDTH_VALUE, $PW_HEIGHT_VALUE" | ||
|
||
- name: Install dependencies | ||
run: yarn install | ||
|
||
- name: Install Playwright browsers | ||
run: npx playwright install --with-deps | ||
|
||
# This is necessary in order for fetch to work. | ||
# Finally, made fetch happen... | ||
- name: Build proxy-fetcher dist | ||
run: | | ||
yarn tsc -b ./packages/proxy-fetcher/tsconfig.json | ||
|
||
- name: Run Playwright tests | ||
run: | | ||
SEGMENT_INDEX=${{ matrix.shardIndex }} yarn playwright test --project=a11y | ||
|
||
- name: Upload scan report to GitHub Actions Artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: segment-${{ matrix.shardIndex }}.json | ||
path: segment-${{ matrix.shardIndex }}.json | ||
retention-days: 7 | ||
if-no-files-found: ignore | ||
|
||
- name: Upload failed pages report to GitHub Actions Artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: failed-pages-segment-${{ matrix.shardIndex }}.json | ||
path: failed-pages-segment-${{ matrix.shardIndex }}.json | ||
retention-days: 7 | ||
if-no-files-found: ignore | ||
|
||
merge-scan-reports: | ||
if: always() | ||
needs: [playwright-tests] | ||
|
||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18 | ||
- name: Install dependencies | ||
run: yarn install | ||
|
||
- name: Download blob reports from GitHub Actions Artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
pattern: segment-* | ||
merge-multiple: true | ||
|
||
- name: Merge reports in valid JSON format | ||
run: | | ||
if [ ! -f segment-*.json ]; then | ||
tjheffner marked this conversation as resolved.
Show resolved
Hide resolved
|
||
echo "No segment-*.json files found." | ||
exit 0 | ||
fi | ||
jq -s '.' segment-*.json | jq 'flatten' > all-segments.json | ||
|
||
- name: Upload report | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: a11y-scan-${{ github.run_attempt }} | ||
path: all-segments.json | ||
retention-days: 14 | ||
if-no-files-found: ignore | ||
|
||
merge-failed-pages-reports: | ||
if: always() | ||
needs: [playwright-tests] | ||
|
||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18 | ||
- name: Install dependencies | ||
run: yarn install | ||
|
||
- name: Download blob reports from GitHub Actions Artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
pattern: failed-pages-segment-* | ||
merge-multiple: true | ||
|
||
- name: Merge reports in valid JSON format | ||
run: | | ||
if [ ! -f failed-pages-segment-*.json ]; then | ||
tjheffner marked this conversation as resolved.
Show resolved
Hide resolved
|
||
echo "No failed-pages-segment-*.json files found." | ||
exit 0 | ||
fi | ||
jq -s '.' failed-pages-segment-*.json | jq 'flatten' > all-failed-pages.json | ||
|
||
- name: Upload report | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: a11y-scan-failed-pages-${{ github.run_attempt }} | ||
path: all-failed-pages.json | ||
retention-days: 14 | ||
if-no-files-found: ignore | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
once we have all the kinks worked out, let's update this to run on a schedule like the
broken-links-check.yml
workflowSomething like:
(I've adjusted the hours from the broken link schedule to offset load on the runners)
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.
@alexfinnarn everything LGTM, let's bump this to be scheduled and we can merge