Comment 7 for bug 1731421

Revision history for this message
Antoine "hashar" Musso (hashar) wrote :

Hello Andreas,

After all the reviews and useful comments you did for me, there is finally a time I think I can help.

For Wikimedia/MediaWiki we do use npm/Karma/Xvfb/Chromium. The tldr is:

  export CHROME_BIN=/usr/bin/chromium-browser
  https://github.com/karma-runner/karma-chrome-launcher/pull/41

The forensic version:

The log being:

| ubuntu-xenial
| No binary for Chrome browser on your platform.
| Please, set "CHROME_BIN" env variable.

Assuming your image has the chromium-browser package installed, the binary is /usr/bin/chromium-browser

karma-chrome-launcher should support chromium (instead of chrome) since 0.1.8. And on Windows/Mac since 2.0.0.

The fault is most probably that Karma is configured for "Chrome", that would be what is configured in the Horizon source repository. But it most definitely is NOT available in Ubuntu:

* Chrome is the Google browser with their "features"
* Chromium is the pure open source one. That is the one in Debian/Ubuntu.

Since developers usually have Chrome but you can't get it on the CI machine, you gotta to do some usurpation. For MediaWiki/Wikimedia, what we ended doing is to set CHROME_BIN ourselves:

  export CHROME_BIN=`which chromium-browser || which chromium`

https://gerrit.wikimedia.org/r/#/c/331110/1/bin/global-set-env.sh

(credits to Timo "Krinkle" Tijhof)

Or really just /usr/bin/chromium-browser

When Karma is configured to use Chrome, it would use CHROME_BIN if indicated, else try to find eg /usr/bin/chrome.

By pointing Chrome to Chromium, the source repo is still configured for Chrome which makes developers happy. And on CI you trick it in using Chromium.

Hope that helps!