Skip to content

Commit 967008f

Browse files
authored
Skip whole browser test, not just the execution part (#25426)
I am running browser test suites several times, with ``` set EMCC_CFLAGS=-sMIN_FIREFOX_VERSION=xyz -Wno-unused-command-line-argument ``` but even when I also set the environment variables ``` set EMTEST_LACKS_OFFSCREEN_CANVAS=1 set EMTEST_LACKS_ES6_WORKERS=1 ``` to skip the relevant ES6 or OffscreenCanvas tests that the Firefox browser under test does not support, the test will actually not skip, but still produce a test failure. This is because the `skipExecIf()` function used to build the `@requires_offscreen_canvas` and `@requires_es6_workers` decorators will still attempt to compile the test, and only skip running it in the browser. But when I have set e.g. `EMCC_CFLAGS=-sMIN_FIREFOX_VERSION=95`, then that Firefox does not support OffscreenCanvas, and it does not help even if I also set the env. var. `EMTEST_LACKS_OFFSCREEN_CANVAS=1`. The failing compilation still happens, and the test fails. This PR fixes that issue by making EMTEST_LACKS_OFFSCREEN_CANVAS and EMTEST_LACKS_ES6_WORKERS skip the whole test, and not just the browser execution part. Though this does have the drawback that CircleCI coverage might be reduced, e.g. for the OffscreenCanvas tests parts, if it was seen valuable to still compile those on targets that don't support OffscreenCanvas. But is that important anymore?
1 parent b0c3638 commit 967008f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/test_browser.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,8 +202,8 @@ def webgpu_disabled():
202202
requires_webgl2 = unittest.skipIf(webgl2_disabled(), "This test requires WebGL2 to be available")
203203
requires_webgpu = unittest.skipIf(webgpu_disabled(), "This test requires WebGPU to be available")
204204
requires_sound_hardware = skipExecIf(os.getenv('EMTEST_LACKS_SOUND_HARDWARE'), 'This test requires sound hardware')
205-
requires_offscreen_canvas = skipExecIf(os.getenv('EMTEST_LACKS_OFFSCREEN_CANVAS'), 'This test requires a browser with OffscreenCanvas')
206-
requires_es6_workers = skipExecIf(os.getenv('EMTEST_LACKS_ES6_WORKERS'), 'This test requires a browser with ES6 Module Workers support')
205+
requires_offscreen_canvas = unittest.skipIf(os.getenv('EMTEST_LACKS_OFFSCREEN_CANVAS'), 'This test requires a browser with OffscreenCanvas')
206+
requires_es6_workers = unittest.skipIf(os.getenv('EMTEST_LACKS_ES6_WORKERS'), 'This test requires a browser with ES6 Module Workers support')
207207

208208

209209
class browser(BrowserCore):

0 commit comments

Comments
 (0)