Skip to content

Commit 9280db6

Browse files
authored
Turn off lighthouse audits for stability (#3578)
* Turn off lighthouse audits for stability * Remove ecommerce chapter * reenable tap-target * Clean up * More cleanup * Remove webmentions from Lighthosue runs * Fix bug * Bug fix
1 parent 9acc49b commit 9280db6

2 files changed

Lines changed: 25 additions & 19 deletions

File tree

src/static/js/webmentions.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,9 @@ function handleShareButton() {
377377
button.classList.remove('hidden');
378378
}
379379

380-
handleShareButton();
381-
addTabListeners();
382-
const BASE_URL = "https://almanac.httparchive.org";
383-
processWebmentions(BASE_URL + window.location.pathname);
380+
if (!window.location.search.includes('nowebmentions')) {
381+
handleShareButton();
382+
addTabListeners();
383+
const BASE_URL = "https://almanac.httparchive.org";
384+
processWebmentions(BASE_URL + window.location.pathname);
385+
}

src/tools/scripts/set_lighthouse_urls.sh

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -38,25 +38,26 @@ LIGHTHOUSE_URLS=""
3838

3939
# Set some URLs that should always be checked on pull requests
4040
# to ensure basic coverage
41+
# We exclude webmentions to avoid Lighthouse issues
4142
BASE_URLS=$(cat <<-END
42-
http://127.0.0.1:8080/en/2019/
43-
http://127.0.0.1:8080/en/2019/javascript
44-
http://127.0.0.1:8080/en/2020/
45-
http://127.0.0.1:8080/en/2020/css
46-
http://127.0.0.1:8080/en/2021/
47-
http://127.0.0.1:8080/en/2021/third-parties
48-
http://127.0.0.1:8080/en/2022/
49-
http://127.0.0.1:8080/en/2022/javascript
43+
http://127.0.0.1:8080/en/2019/?nowebmentions
44+
http://127.0.0.1:8080/en/2019/javascript?nowebmentions
45+
http://127.0.0.1:8080/en/2020/?nowebmentions
46+
http://127.0.0.1:8080/en/2020/css?nowebmentions
47+
http://127.0.0.1:8080/en/2021/?nowebmentions
48+
http://127.0.0.1:8080/en/2021/third-parties?nowebmentions
49+
http://127.0.0.1:8080/en/2022/?nowebmentions
50+
http://127.0.0.1:8080/en/2022/javascript?nowebmentions
5051
END
5152
)
5253

5354
if [ "${production}" == "1" ]; then
5455

5556
# Get the production URLs from the production sitemap (except PDFs and Stories)
56-
LIGHTHOUSE_URLS=$(curl -s https://almanac.httparchive.org/sitemap.xml | grep "<loc" | grep -v "/static/" | grep -v stories | sed 's/ *<loc>//g' | sed 's/<\/loc>//g')
57+
LIGHTHOUSE_URLS=$(curl -s https://almanac.httparchive.org/sitemap.xml | grep "<loc" | grep -v "/static/" | grep -v stories | sed 's/ *<loc>//g' | sed 's/<\/loc>//g' | sed 's/$/?nowebmentions/g' )
5758

58-
# Temporarily remove English CDN file as failing in Lighthouse - TODO Try removing this on next Lighthouse upgrade
59-
LIGHTHOUSE_URLS=$(echo "${LIGHTHOUSE_URLS}" | grep -v "/en/2021/cdn")
59+
# Temporarily remove chapters failing in Lighthouse - TODO Try removing this on next Lighthouse upgrade
60+
#LIGHTHOUSE_URLS=$(echo "${LIGHTHOUSE_URLS}" | grep -v "/en/2021/cdn" | grep -v '/2021/ecommerce')
6061

6162
# Switch to the Production Config file
6263
LIGHTHOUSE_CONFIG_FILE="${LIGHTHOUSE_PROD_CONFIG_FILE}"
@@ -74,18 +75,21 @@ elif [ "${RUN_TYPE}" == "pull_request" ] && [ "${COMMIT_SHA}" != "" ]; then
7475
git checkout --progress --force "${COMMIT_SHA}"
7576

7677
# Transform the files to http://127.0.0.1:8080 URLs
77-
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' )
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' )
79+
80+
# Temporarily remove chapters failing in Lighthouse - TODO Try removing this on next Lighthouse upgrade
81+
# LIGHTHOUSE_URLS=$(echo "${LIGHTHOUSE_URLS}" | grep -v "/en/2021/cdn" | grep -v '/2021/ecommerce')
7882

7983
# Add base URLs and strip out newlines
8084
LIGHTHOUSE_URLS=$(echo -e "${LIGHTHOUSE_URLS}\n${BASE_URLS}" | sort -u | sed '/^$/d')
8185

8286
else
8387

8488
# Else test every URL (except PDFs and Stories) in the sitemap
85-
LIGHTHOUSE_URLS=$(grep loc templates/sitemap.xml | grep -v "/static/" | grep -v stories | sed 's/ *<loc>//g' | sed 's/<\/loc>//g' | sed 's/https:\/\/almanac.httparchive.org/http:\/\/127.0.0.1:8080/g')
89+
LIGHTHOUSE_URLS=$(grep loc templates/sitemap.xml | grep -v "/static/" | grep -v stories | sed 's/ *<loc>//g' | sed 's/<\/loc>//g' | sed 's/https:\/\/almanac.httparchive.org/http:\/\/127.0.0.1:8080/g' | sed 's/$/?nowebmentions/g' )
8690

87-
# Temporarily remove English CDN file as failing in Lighthouse - TODO Try removing this on next Lighthouse upgrade
88-
LIGHTHOUSE_URLS=$(echo "${LIGHTHOUSE_URLS}" | grep -v "/en/2021/cdn")
91+
# Temporarily remove chapters failing in Lighthouse - TODO Try removing this on next Lighthouse upgrade
92+
#LIGHTHOUSE_URLS=$(echo "${LIGHTHOUSE_URLS}" | grep -v "/en/2021/cdn" | grep -v '/2021/ecommerce')
8993
fi
9094

9195
echo "URLS to check:"

0 commit comments

Comments
 (0)