diff --git a/Makefile.online b/Makefile.online index 2e81e94..bed37e8 100644 --- a/Makefile.online +++ b/Makefile.online @@ -11,13 +11,18 @@ CHROME_PATH = $(CHROME_DIR)/thorium CHROMEDRIVER_PATH = $(CHROME_DIR)/chromedriver CHROME_PROFILE ?= /tmp/chrome-lighthouse JS_FLAGS='' -CHROME_FLAGS += --headless --disable-extensions --no-default-browser-check --disable-client-side-phishing-detection --disable-component-update --disable-default-apps --disable-device-discovery-notifications --disable-domain-reliability --disable-background-timer-throttling --disable-breakpad --enable-blink-features=LayoutInstabilityAPI --no-first-run --disable-background-networking --user-data-dir=$(CHROME_PROFILE) --enable-quic --start-in-incognito --origin-to-force-quic-on=$(DOMAIN):443 +CHROME_FLAGS += --headless --disable-extensions --no-default-browser-check --disable-client-side-phishing-detection --disable-component-update --disable-default-apps --disable-device-discovery-notifications --disable-domain-reliability --disable-background-timer-throttling --disable-breakpad --enable-blink-features=LayoutInstabilityAPI --no-first-run --disable-background-networking --user-data-dir=$(CHROME_PROFILE) --enable-quic --start-in-incognito --origin-to-force-quic-on=seirdy.one:443 CHROME_FLAGS_COMMA = 'disable-extensions,no-default-browser-check,disable-client-side-phishing-detection,disable-component-update,disable-default-apps,disable-device-discovery-notifications,disable-domain-reliability,disable-background-timer-throttling,disable-breakpad,no-first-run,disable-background-networking,js-flags=--jitless' -CPU_SLOWDOWN=12.0 +# When quiet, my lappie's CPU power is benchmarked to be ~1320. The CPU throttling calculator recommends throttling by 3.1x. +# Multiply that by 4 cuz imo it's way too generous. It targets devices like the Moto G4; I target devices like the JioPhone 2. +CPU_SLOWDOWN=12.5 LIGHTHOUSE_ARGS += --budget-path linter-configs/budget.json --output html --output json --output-file lighthouse-results --throttling-method=devtools --throttling.cpuSlowdownMultiplier=$(CPU_SLOWDOWN) --chrome-flags="$(CHROME_FLAGS)" +# make some of these quiet bc they'll otherwise echo every URL + hint-online: - hint --config linter-configs/hintrc $(URLS) + @echo "Running webhint" + @hint --config linter-configs/hintrc $(URLS) lighthouse: mkdir -p $(CHROME_PROFILE) CHROME_PATH=$(CHROME_PATH) CHROME_PROFILE=$(CHROME_PROFILE) JS_FLAGS='' lighthouse $(URLS) $(LIGHTHOUSE_ARGS) @@ -27,8 +32,10 @@ redbot: .PHONY: hint-online lighthouse redbot axe: - axe $(URLS) --chrome-options $(CHROME_FLAGS_COMMA) --chromedriver-path=$(CHROMEDRIVER_PATH) --show-errors + @echo "Running axe" + @axe $(URLS) --chrome-options $(CHROME_FLAGS_COMMA) --chromedriver-path=$(CHROMEDRIVER_PATH) --show-errors axe-ff: + @echo "Running axe with Firefox" PATH=scripts/bin:$(PATH) axe $(URLS) -b firefox --show-errors .PHONY: axe axe-ff diff --git a/linter-configs/hintrc b/linter-configs/hintrc index e188e5d..c7b94dc 100644 --- a/linter-configs/hintrc +++ b/linter-configs/hintrc @@ -26,6 +26,7 @@ "axe/tables": "off", "axe/text-alternatives": "off", "axe/time-and-media": "off", + "axe/parsing": "off", "compat-api/css": [ "error", { @@ -93,7 +94,7 @@ "error", { "connectionType": "3GSlow", - "loadTime": 10 + "loadTime": 10.5 } ], "css-prefix-order": "error", diff --git a/scripts/bin/check-whole-site b/scripts/bin/check-whole-site index b547b4f..26da1c3 100755 --- a/scripts/bin/check-whole-site +++ b/scripts/bin/check-whole-site @@ -63,8 +63,8 @@ base_url="${1-http://localhost:8089}" make -j1 HUGO_FLAGS=-DF HUGO_BASEURL="$base_url" clean hugo xhtmlize validate-html make -j "$jobs" -f Makefile.online HUGO_BASEURL="$base_url" all-extra URLS="$(curl -sSL "$base_url/sitemap.xml" | htmlq loc -t | rg -v '/search/$' | tr '\n' ' ')" & make deploy-staging RSYNCFLAGS_EXTRA=-q -wait make -f Makefile.online hint-online URLS="$(curl -sSL --compressed https://staging.seirdy.one/sitemap.xml | htmlq loc -t | rg -v '/(?:search|wcag-is-a-starting-point)/$' | sort | tr '\n' ' ')" +wait # TODO: run lighthouse on every page in the sitemap. # vi:ft=sh