Skip to content

Conversation

@HiDeoo
Copy link
Member

@HiDeoo HiDeoo commented Oct 30, 2025

Description

As we discussed, this PR tweaks the a11y e2e tests. At the moment, we process the sitemap after building the docs site, filter out some slugs, and run the a11y tests against the remaining URLs for 2 locales (English and Japanese).

We don't get a lot of value from testing all the same pages in both English and Japanese, even more so many of them. This PR refactors the test utils to be more i18n-aware:

  • For the default locale, we test all pages except for some excluded slugs.
  • For non-default locales, they are excluded by default and we can specify which slugs to include for testing for a specific locale (this would allow us to include more pages if we ever get an RTL locale, for example).

Here are a comparison of the test runs before and after this change:

Before After
Number of page tested 48 (24 English - 24 Japanase) 24 (22 English - 2 Japanase)
Hyperfine benchmark (min … max) (3 runs) 94.062 s … 96.962 s 64.291 s … 66.667 s
List of pages tested before the change
  • /
  • /components/asides/
  • /components/badges/
  • /components/card-grids/
  • /components/cards/
  • /components/code/
  • /components/file-tree/
  • /components/icons/
  • /components/link-buttons/
  • /components/link-cards/
  • /components/steps/
  • /components/tabs/
  • /environmental-impact/
  • /guides/authoring-content/
  • /guides/css-and-tailwind/
  • /guides/route-data/
  • /guides/sidebar/
  • /ja/
  • /ja/components/asides/
  • /ja/components/badges/
  • /ja/components/card-grids/
  • /ja/components/cards/
  • /ja/components/code/
  • /ja/components/file-tree/
  • /ja/components/icons/
  • /ja/components/link-buttons/
  • /ja/components/link-cards/
  • /ja/components/steps/
  • /ja/components/tabs/
  • /ja/environmental-impact/
  • /ja/guides/authoring-content/
  • /ja/guides/css-and-tailwind/
  • /ja/guides/route-data/
  • /ja/guides/sidebar/
  • /ja/reference/configuration/
  • /ja/reference/icons/
  • /ja/reference/route-data/
  • /ja/resources/community-content/
  • /ja/resources/plugins/
  • /ja/resources/showcase/
  • /ja/resources/themes/
  • /reference/configuration/
  • /reference/icons/
  • /reference/route-data/
  • /resources/community-content/
  • /resources/plugins/
  • /resources/showcase/
  • /resources/themes/
List of pages tested after the change
  • /
  • /components/asides/
  • /components/badges/
  • /components/card-grids/
  • /components/cards/
  • /components/code/
  • /components/file-tree/
  • /components/icons/
  • /components/link-buttons/
  • /components/link-cards/
  • /components/steps/
  • /components/tabs/
  • /environmental-impact/
  • /guides/authoring-content/
  • /guides/css-and-tailwind/
  • /guides/sidebar/
  • /ja/guides/route-data/
  • /ja/reference/frontmatter/
  • /reference/configuration/
  • /reference/icons/
  • /resources/community-content/
  • /resources/plugins/
  • /resources/showcase/
  • /resources/themes/

We can obviously tweak the included/excluded slugs further if we want as we should have more control now.

@changeset-bot
Copy link

changeset-bot bot commented Oct 30, 2025

⚠️ No Changeset found

Latest commit: 3f9adb2

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@netlify
Copy link

netlify bot commented Oct 30, 2025

Deploy Preview for astro-starlight ready!

Name Link
🔨 Latest commit 3f9adb2
🔍 Latest deploy log https://app.netlify.com/projects/astro-starlight/deploys/69087a4118ba9b0008c9feb4
😎 Deploy Preview https://deploy-preview-3507--astro-starlight.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 100 (no change from production)
Accessibility: 100 (no change from production)
Best Practices: 100 (no change from production)
SEO: 100 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Member Author

Choose a reason for hiding this comment

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

A leftover from when we removed Pa11y CI.

@github-actions github-actions bot added the 📚 docs Documentation website changes label Oct 30, 2025
@github-actions github-actions bot added the 🚨 action Changes to GitHub Action workflows label Oct 30, 2025
Comment on lines +121 to +129
# Uninstall man-db to prevent man page updates taking a long time after package installations
# on Ubuntu 24.04.
# https://github.com/actions/runner/issues/4030
# https://github.com/actions/runner-images/issues/10977
- name: Uninstall man-db
run: |
sudo apt-get update
sudo apt-get remove man-db
Copy link
Member Author

@HiDeoo HiDeoo Oct 30, 2025

Choose a reason for hiding this comment

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

This is something I discovered and investigated recently, but when Playwright installs browsers, on Ubuntu 24.04, it can randomly take a very long time to update the manual page index caches.

For example, in this run on this PR before this change, it took more than 1m30s (you need to scroll to the top, click on the settings icon, select Show timestamps and then go back to the Processing triggers for man-db line).

Considering we definitely don't need man pages, we uninstall the command ahead of the package installations.

If we agree to keep this workaround until this is fixed (I personally think we should), I'll backport it to our Linux e2e tests too that also installs some packages and can suffer from the same issue.

Copy link
Member

Choose a reason for hiding this comment

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

I also spotted this just now: https://stevefenton.co.uk/blog/2025/09/playwright-insteall-github-actions/#fewer-dependencies

Seems a bit fragile but could be another optimization to test.

Copy link
Member Author

Choose a reason for hiding this comment

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

Interesting, definitely fragile (I would guess mostly around majors), but interesting nonetheless. With the current setup of this PR, dependencies takes 5 seconds, so I'm tempted to say it may not be worth it right now but something to keep in mind if it ever becomes more of a bottleneck?

Copy link
Member

Choose a reason for hiding this comment

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

Ah yeah, could be that your fix has the same end result as theirs but with a much nicer (and I’d guess more stable) approach.

@HiDeoo HiDeoo marked this pull request as ready for review October 30, 2025 11:56
Copy link
Member

@delucis delucis left a comment

Choose a reason for hiding this comment

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

Looks good! Thanks for investigating this — will be an nice speed-up 🚀

The man page thing is really funny. Hopefully GitHub won’t start trying to run AI agents in our PRs that want to check man pages 😁

@HiDeoo HiDeoo merged commit 28e44c0 into withastro:main Nov 3, 2025
17 checks passed
@HiDeoo HiDeoo mentioned this pull request Nov 3, 2025
HiDeoo added a commit to HiDeoo/starlight that referenced this pull request Nov 5, 2025
* main: (47 commits)
  feat: add some of trueberryless' new Starlight blogs to community content (withastro#3525)
  i18n(fr): update `resources/themes` (withastro#3526)
  Fix file filters added in withastro#3520 (withastro#3522)
  i18n(fr): update `guides/site-search.mdx` (withastro#3524)
  i18n(fr): update `resources/plugins.mdx` (withastro#3523)
  docs: add starlight-themes link (withastro#3510)
  i18n(de): update translation resources/plugins.mdx (withastro#3519)
  i18n(de): update translation guides/site-search.mdx (withastro#3518)
  Skip a11y CI checks for docs changes that aren’t tested anyway (withastro#3520)
  Speed up Linux e2e tests (withastro#3517)
  i18n(ru): update translations (withastro#3512)
  Tweak a11y e2e tests (withastro#3507)
  [ci] format
  docs(plugin): starlight-docsearch-typesense (withastro#3504)
  Add starlight-page-actions (withastro#3515)
  ci: update file icons (withastro#3511)
  [i18nIgnore] Match title case convention for components/using-components (withastro#3508)
  Disable Prettier on GitHub Actions workflow files (withastro#3509)
  [ci] release (withastro#3490)
  Update release workflow for OIDC (withastro#3500)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🚨 action Changes to GitHub Action workflows 📚 docs Documentation website changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants