Skip to content

test: automate determining non-en locales for broken-link-checker test to ignore 🌋#719

Merged
darcywong00 merged 5 commits intomasterfrom
test/node-blc-test
May 6, 2026
Merged

test: automate determining non-en locales for broken-link-checker test to ignore 🌋#719
darcywong00 merged 5 commits intomasterfrom
test/node-blc-test

Conversation

@darcywong00
Copy link
Copy Markdown
Contributor

@darcywong00 darcywong00 commented May 5, 2026

Addresses #712 (comment)

Excluding all locales except en will not scale well. I wonder if there is a better way -- can we build a scripted filter using the api published at broken-link-checker?

I'm applying to the base branch master so we can compare the CI link checker to existing runs
This passing run took 13m 23s after skipping /downloads/releases

The one for #979 took 26m 49s

This updates ci.yml and build.sh to determine the list of non-en locales to ignore (along with /downloads/releases) for the broken-link-checker CLI to run.

Test-bot: skip

@darcywong00 darcywong00 added this to the A19S28 milestone May 5, 2026
@darcywong00 darcywong00 requested a review from mcdurdin May 5, 2026 23:03
@github-actions github-actions Bot added the test label May 5, 2026
@github-project-automation github-project-automation Bot moved this to Todo in Keyman May 5, 2026
@keymanapp-test-bot
Copy link
Copy Markdown

User Test Results

Test specification and instructions

User tests are not required

@darcywong00 darcywong00 marked this pull request as ready for review May 6, 2026 01:51
Comment thread .github/workflows/ci.yml Outdated
set +e
set +o pipefail
npx broken-link-checker http://localhost:8053/_test --recursive --ordered ---host-requests 50 -e --filter-level 3 --exclude '*/donate' --exclude '*lang=*' | tee blc.log
node blc_test.mjs | tee ../blc.log
Copy link
Copy Markdown
Contributor Author

@darcywong00 darcywong00 May 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An alternative (less drastic) way may be to use BASH to generate the list of excludes

like

Suggested change
node blc_test.mjs | tee ../blc.log
# determine non-en locales to ignore
readarray -t ignoresArray <<< $(find ./_includes/locale/strings/keyboards/ -maxdepth 1 -name '*.php' ! -name "en.php" \
-execdir basename {} .php ';')
local baseURL="http://localhost:8053"
local ignoreStr=()
for locale in "${ignoresArray[@]}"; do
ignoreStr+=" --exclude ${baseURL}/$locale/*"
done
# echo "ignoreStr: ${ignoreStr[@]}"
npx broken-link-checker ${baseURL}/_test --recursive --ordered ---host-requests 50 -e --filter-level 3 ${ignoreStr} | tee blc.log

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, I reckon this would be easier for now but I think the .mjs would be more maintainable long-term. Not sure if we have bandwidth to complete the long-term approach.

(Another area we could exclude is the /downloads/releases for every single release)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

split the long-term suggestion to #721

* revert blc_test.mjs changes
* update build.sh and ci.yml to use bash for determining non-en locales and /downloads/releases to ignore
@darcywong00 darcywong00 changed the title test: port broken-link-checker test to blc.mjs 🌋 test: automate determining non-en locales for broken-link-checker test to ignore 🌋 May 6, 2026
Copy link
Copy Markdown
Member

@mcdurdin mcdurdin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@darcywong00 darcywong00 merged commit ff44944 into master May 6, 2026
5 checks passed
@darcywong00 darcywong00 deleted the test/node-blc-test branch May 6, 2026 08:48
@github-project-automation github-project-automation Bot moved this from Todo to Done in Keyman May 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants