Skip to content

Commit a3ab41a

Browse files
authored
[test] Enable entire browser test suite to run in wasm64 mode (#20392)
This creates a new CI runner/bot that runs the same subset of browser tests that we run today in wasm64 mode. This should speedd up CI as it splits the chrome and firefox tests between two different runners. However, it makes it possible to run the entire browser test suite in this mode if/when we want to do that.
1 parent a712598 commit a3ab41a

File tree

3 files changed

+118
-111
lines changed

3 files changed

+118
-111
lines changed

.circleci/config.yml

Lines changed: 95 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,37 @@ commands:
267267
test_targets: << parameters.test_targets >>
268268
title: << parameters.title >>
269269
- upload-test-results
270+
run-tests-chrome:
271+
description: "Runs browser tests under chrome"
272+
parameters:
273+
test_targets:
274+
description: "Test suites to run"
275+
type: string
276+
title:
277+
description: "Name of given test suite"
278+
type: string
279+
default: ""
280+
steps:
281+
- prepare-for-tests
282+
- download-chrome
283+
- run:
284+
name: run tests (<< parameters.title >>)
285+
environment:
286+
EMTEST_LACKS_SOUND_HARDWARE: "1"
287+
EMTEST_DETECT_TEMPFILE_LEAKS: "0"
288+
# --no-sandbox because we are running as root and chrome requires
289+
# this flag for now: https://crbug.com/638180
290+
CHROME_FLAGS_BASE: "--no-first-run -start-maximized --no-sandbox --use-gl=swiftshader --user-data-dir=/tmp/chrome-emscripten-profile --enable-experimental-web-platform-features"
291+
CHROME_FLAGS_HEADLESS: "--headless=new --remote-debugging-port=1234"
292+
CHROME_FLAGS_WASM: "--enable-experimental-webassembly-features --js-flags=\"--experimental-wasm-memory64 --experimental-wasm-stack-switching --experimental-wasm-type-reflection\""
293+
CHROME_FLAGS_NOCACHE: "--disk-cache-dir=/dev/null --disk-cache-size=1 --media-cache-size=1 --disable-application-cache --incognito"
294+
command: |
295+
export EMTEST_BROWSER="/usr/bin/google-chrome $CHROME_FLAGS_BASE $CHROME_FLAGS_HEADLESS $CHROME_FLAGS_WASM $CHROME_FLAGS_NOCACHE"
296+
# There are tests in the browser test suite that using libraries
297+
# that are not included by "./embuilder build ALL". For example the
298+
# PIC version of libSDL which is used by test_sdl2_misc_main_module
299+
export EM_FROZEN_CACHE=""
300+
test/runner << parameters.test_targets >>
270301
setup-macos:
271302
steps:
272303
- run:
@@ -336,40 +367,6 @@ commands:
336367
# "Firefox is already running, but is not responding."
337368
# TODO: find out a way to shut down and restart firefox
338369
- upload-test-results
339-
test-chrome:
340-
description: "Runs emscripten browser tests under chrome"
341-
steps:
342-
- prepare-for-tests
343-
- download-chrome
344-
- run:
345-
name: run tests
346-
environment:
347-
EMTEST_LACKS_SOUND_HARDWARE: "1"
348-
EMTEST_DETECT_TEMPFILE_LEAKS: "0"
349-
# --no-sandbox because we are running as root and chrome requires
350-
# this flag for now: https://crbug.com/638180
351-
CHROME_FLAGS_BASE: "--no-first-run -start-maximized --no-sandbox --use-gl=swiftshader --user-data-dir=/tmp/chrome-emscripten-profile --enable-experimental-web-platform-features"
352-
CHROME_FLAGS_HEADLESS: "--headless=new --remote-debugging-port=1234"
353-
CHROME_FLAGS_WASM: "--enable-experimental-webassembly-features --js-flags=\"--experimental-wasm-memory64 --experimental-wasm-stack-switching --experimental-wasm-type-reflection\""
354-
CHROME_FLAGS_NOCACHE: "--disk-cache-dir=/dev/null --disk-cache-size=1 --media-cache-size=1 --disable-application-cache --incognito"
355-
command: |
356-
export EMTEST_BROWSER="/usr/bin/google-chrome $CHROME_FLAGS_BASE $CHROME_FLAGS_HEADLESS $CHROME_FLAGS_WASM $CHROME_FLAGS_NOCACHE"
357-
# There are tests in the browser test suite that using libraries
358-
# that are not included by "./embuilder build ALL". For example the
359-
# PIC version of libSDL which is used by test_sdl2_misc_main_module
360-
export EM_FROZEN_CACHE=""
361-
echo
362-
echo "browser"
363-
echo
364-
# skip test_zzz_zzz_4gb_fail as it OOMs on the current bot
365-
test/runner browser skip:browser.test_zzz_zzz_4gb_fail skip:browser.test_zzz_zzz_4gb_fail_wasm64
366-
echo
367-
echo "emrun"
368-
echo
369-
# TODO(sbc): Re-enable once we figure out why the emrun tests are
370-
# locking up.
371-
# test/runner emrun
372-
- upload-test-results
373370
test-sockets-chrome:
374371
description: "Runs emscripten sockets tests under chrome"
375372
steps:
@@ -764,11 +761,71 @@ jobs:
764761
test-browser-chrome:
765762
executor: bionic
766763
steps:
767-
- test-chrome
764+
- run-tests-chrome:
765+
title: "browser"
766+
# skip test_zzz_zzz_4gb_fail as it OOMs on the current bot
767+
test_targets: "browser skip:browser.test_zzz_zzz_4gb_fail"
768+
test-browser-chrome-wasm64:
769+
executor: bionic
770+
steps:
771+
- run-tests-chrome:
772+
title: "browser64"
773+
test_targets: "
774+
browser64.test_sdl_swsurface
775+
browser64.test_sdl_surface_lock_opts
776+
browser64.test_sdl_canvas
777+
browser64.test_sdl_canvas_proxy
778+
browser64.test_sdl_canvas_alpha
779+
browser64.test_canvas_focus
780+
browser64.test_sdl_text
781+
browser64.test_sdl_mouse
782+
browser64.test_sdl_mouse_offsets
783+
browser64.test_sdl_joystick_1
784+
browser64.test_sdl_joystick_2
785+
browser64.test_idbstore
786+
browser64.test_idbstore_sync_asyncify
787+
browser64.test_idbstore_sync_jspi
788+
browser64.test_sdl_pumpevents
789+
browser64.test_sdl_canvas_size
790+
browser64.test_sdl_gl_read
791+
browser64.test_sdl_gl_mapbuffers
792+
browser64.test_sdl_ogl
793+
browser64.test_sdl_ogl_defaultmatrixmode
794+
browser64.test_sdl_ogl_p
795+
browser64.test_sdl_ogl_proc_alias
796+
browser64.test_sdl_fog_simple
797+
browser64.test_sdl_fog_negative
798+
browser64.test_sdl_fog_density
799+
browser64.test_sdl_fog_exp2
800+
browser64.test_sdl_fog_linear
801+
browser64.test_egl
802+
browser64.test_egl_width_height
803+
browser64.test_egl_createcontext_error
804+
browser64.test_glgears_animation
805+
browser64.test_glgears_deriv
806+
browser64.test_anisotropic
807+
browser64.test_webgpu_get_device
808+
browser64.test_fetch_to_memory
809+
browser64.test_fetch_to_indexdb
810+
browser64.test_fetch_cached_xhr
811+
browser64.test_fetch_response_headers
812+
browser64.test_fetch_stream_file
813+
browser64.test_fetch_headers_received
814+
browser64.test_fetch_xhr_abort
815+
browser64.test_fetch_sync_xhr
816+
browser64.test_fetch_implicit_append
817+
"
768818
test-browser-firefox:
769819
executor: bionic
770820
steps:
771821
- test-firefox
822+
# TODO(sbc): Re-enable once we figure out why the emrun tests are
823+
# locking up.
824+
#test-browser-chrome-emrun:
825+
# executor: bionic
826+
# steps:
827+
# - run-tests-chrome:
828+
# test_targets: "emrun"
772829
test-sockets-chrome:
773830
executor: bionic
774831
steps:
@@ -914,6 +971,9 @@ workflows:
914971
- test-browser-chrome:
915972
requires:
916973
- build-linux
974+
- test-browser-chrome-wasm64:
975+
requires:
976+
- build-linux
917977
- test-browser-firefox:
918978
requires:
919979
- build-linux

test/runner.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@
9595
'wasm64',
9696
'wasm64l',
9797
'bigint',
98+
'browser64',
9899
]
99100

100101

0 commit comments

Comments
 (0)