MapStore2 icon indicating copy to clipboard operation
MapStore2 copied to clipboard

Caesium Tests using headless chrome fail on MacOS due to disabled WebGL in deprecated karma launcher

Open fkellner opened this issue 11 months ago • 0 comments

Description

Running the test suite with npm test on a MacBook (with Apple Silicon, but I don't know if this is really relevant here) results in a lot of errors, which are not present when running them on Windows, e.g.:

Cesium MeasurementSupport
    ✖ should render with default values
      Chrome Headless 122.0.6261.111 (Mac OS 10.15.7)
    The browser supports WebGL, but initialization failed.

This is a known issue with karma-chrome-launcher and will not be fixed due to the karma test runner being deprecated.

How to reproduce

Check out master on a MacBook and run npm run test. More specifically, you can run a test from web/client/components/map/cesium/__tests__/DrawGeometrySupport-test.jsx e.g. from your IDE if you do not want to wait that long.

Expected Result

The tests to run through.

Current Result

Errors complaining that WebGL is supported, but initialization fails.

Browser info (use this site: https://www.whatsmybrowser.org/ for non expert users)
Browser Affected Version
Internet Explorer
Edge
Chrome Headless 122.0.6261.111
Firefox
Safari

Other useful information

Workaround

A possible workaround is to go to node_modules/karma-chrome-launcher/index.js and manually change the following:

image

I.e, removing the --disable-gpu flag that is added per default and cannot be overridden, and adding the --use-angle=gl flag. Only removing the --disable-gpu flag did not work.

fkellner avatar Mar 07 '24 11:03 fkellner