Problem
While running frontend QUnit tests in a fresh Discourse Dev Container, I encountered an issue with the Chrome wrapper at .devcontainer/scripts/chrome_wrapper.
After installing Chromium using:
pnpm playwright-install
Playwright downloaded Chrome for Testing 156.0.8078.4 into:
/home/discourse/.cache/ms-playwright/chromium-1248/chrome-linux64/chrome
However, the wrapper looks for:
/home/discourse/.cache/ms-playwright/chromium-*/chrome-linux/chrome
Consequently, google-chrome --version returned:
No Chrome/Chromium found at expected location: /home/discourse/.cache/ms-playwright/chromium-*
Running the QUnit tests then failed during browser detection:
ArgumentError: Malformed version number string .
from lib/chrome_installed_checker.rb:39
Reproduction
- Open a fresh Discourse Dev Container.
- Run
pnpm install. - Run
pnpm playwright-install. - Run
google-chrome --version.
Expected: The installed Chromium executable is located and its version is displayed.
Actual: The wrapper reports that no Chromium installation was found, despite Playwright having installed it successfully.
Workaround
Creating a symlink resolved the path mismatch:
ln -s chrome-linux64 \
/home/discourse/.cache/ms-playwright/chromium-1248/chrome-linux
The container also initially lacked the shared libraries required by Chromium. I installed these using:
pnpm exec playwright install-deps chromium
Afterwards, google-chrome --version correctly reported Chrome for Testing 156.0.8078.4.
The affected QUnit test suite subsequently completed successfully, with 63 tests passed and 0 failures.
Suggested improvement
Could .devcontainer/scripts/chrome_wrapper be updated to recognise both chrome-linux/chrome and chrome-linux64/chrome layouts?
It may also be worthwhile to improve the version parsing in lib/chrome_installed_checker.rb, so that invalid browser-version output produces a clearer diagnostic rather than an ArgumentError.