Skip to content

Commit 9658c66

Browse files
authored
Fix lighthouse testing (#3798)
* Fix Lighthouse testing * Add debugging
1 parent 5fb78e7 commit 9658c66

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/tools/scripts/set_lighthouse_urls.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,14 @@ elif [ "${RUN_TYPE}" == "pull_request" ] && [ "${COMMIT_SHA}" != "" ]; then
7171
git checkout main
7272
# Then get the changes
7373
CHANGED_FILES=$(git diff --name-only "main...${COMMIT_SHA}" --diff-filter=d content templates | grep -v base.html | grep -v ejs | grep -v base_ | grep -v sitemap | grep -v error.html | grep -v stories | grep -v embed.html | grep -v "/embeds/" )
74+
echo "Changed files: ${CHANGED_FILES}"
75+
7476
# Then back to the pull request changes
7577
git checkout --progress --force "${COMMIT_SHA}"
7678

7779
# Transform the files to http://127.0.0.1:8080 URLs
78-
LIGHTHOUSE_URLS=$(echo "${CHANGED_FILES}" | sed 's/src\/content/http:\/\/127.0.0.1:8080/g' | sed 's/\.md//g' | sed 's/\/base\//\/en\/2019\//g' | sed 's/src\/templates/http:\/\/127.0.0.1:8080/g' | sed 's/index\.html//g' | sed 's/\.html//g' | sed 's/_/-/g' | sed 's/\/2019\/accessibility-statement/\/accessibility-statement/g' | sed 's/\/2019\/search/\/search/g' | sed 's/(http://.*)$/\1?nowebmentions/g' )
80+
LIGHTHOUSE_URLS=$(echo "${CHANGED_FILES}" | sed 's/src\/content/http:\/\/127.0.0.1:8080/g' | sed 's/\.md//g' | sed 's/\/base\//\/en\/2019\//g' | sed 's/src\/templates/http:\/\/127.0.0.1:8080/g' | sed 's/index\.html//g' | sed 's/\.html//g' | sed 's/_/-/g' | sed 's/\/2019\/accessibility-statement/\/accessibility-statement/g' | sed 's/\/2019\/search/\/search/g' | sed -E 's/(http:\/\/.*)$/\1?nowebmentions/g' )
81+
echo "URLs to test: ${LIGHTHOUSE_URLS}"
7982

8083
# Temporarily remove chapters failing in Lighthouse - TODO Try removing this on next Lighthouse upgrade
8184
# LIGHTHOUSE_URLS=$(echo "${LIGHTHOUSE_URLS}" | grep -v "/en/2021/cdn" | grep -v '/2021/ecommerce')

0 commit comments

Comments
 (0)