Skip to content

Commit ec6bc2b

Browse files
authored
[ci] Split windows browser testing into its own runner. NFC (#25296)
1 parent 71e0500 commit ec6bc2b

File tree

1 file changed

+61
-22
lines changed

1 file changed

+61
-22
lines changed

.circleci/config.yml

Lines changed: 61 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ commands:
388388
# PIC version of libSDL which is used by test_sdl2_misc_main_module
389389
export EM_FROZEN_CACHE=""
390390
echo "-----"
391-
echo "Running browser tests"
391+
echo "Running browser tests (EMTEST_BROWSER=$EMTEST_BROWSER)"
392392
echo "-----"
393393
test/runner << parameters.test_targets >>
394394
# posix and emrun suites are disabled because firefox errors on
@@ -425,15 +425,19 @@ commands:
425425
Invoke-WebRequest -Uri $nightlyUrl -OutFile $outZip
426426
427427
# Extract to user home directory
428+
Write-Host "Extracing $outZip"
428429
$installDir = Join-Path $env:USERPROFILE "firefox"
429430
if (Test-Path $installDir) { Remove-Item -Recurse -Force $installDir }
430-
Expand-Archive -LiteralPath $outZip -DestinationPath $installDir
431+
# All files in the archive are in the firefox/ directory so extract
432+
# directly to $USERPROFILE.
433+
Expand-Archive -LiteralPath $outZip -DestinationPath $env:USERPROFILE
431434
432-
# Set environment variable for tests
433-
$ffExe = Join-Path $installDir "firefox.exe"
434-
[System.Environment]::SetEnvironmentVariable("EMTEST_BROWSER", $ffExe, "User")
435-
$env:EMTEST_BROWSER = $ffExe
436-
Write-Host "EMTEST_BROWSER set to $env:EMTEST_BROWSER"
435+
# FIXME(sbc): This does not seem to work, and EMTEST_BROWSER is
436+
# not set in the bash job below.
437+
# Set environment variable that will be visibvle in future steps
438+
#$ffExe = Join-Path $installDir "firefox.exe"
439+
#Write-Host "Setting EMTEST_BROWSER to '$ffExe' in $env:BASH_ENV"
440+
#Add-Content -Path $env:BASH_ENV -Value "export EMTEST_BROWSER='$ffExe'"
437441
- run:
438442
name: run tests (<< parameters.title >>)
439443
environment:
@@ -448,12 +452,20 @@ commands:
448452
EMTEST_CORES: "2"
449453
DISPLAY: ":0"
450454
command: |
455+
# For some reason its not possible for the powershell job above to
456+
# add to BASH_ENV, so we need set this here
457+
export EMTEST_BROWSER="$USERPROFILE\\firefox\\firefox.exe"
458+
451459
# There are tests in the browser test suite that using libraries
452460
# that are not included by "./embuilder build ALL". For example the
453461
# PIC version of libSDL which is used by test_sdl2_misc_main_module
454-
set EM_FROZEN_CACHE=
462+
export EM_FROZEN_CACHE=
463+
464+
echo "BASH_ENV($BASH_ENV):"
465+
echo "-----"
466+
cat $BASH_ENV
455467
echo "-----"
456-
echo "Running browser tests"
468+
echo "Running browser tests (EMTEST_BROWSER=$EMTEST_BROWSER)"
457469
echo "-----"
458470
test/runner << parameters.test_targets >>
459471
- upload-test-results
@@ -1072,6 +1084,44 @@ jobs:
10721084
browser64.test_sdl_image
10731085
browser64.test_dylink_many
10741086
"
1087+
test-windows-browser-firefox:
1088+
# Use spaces and other special chars in the path to emsdk to flush out
1089+
# issues with windows. In particular, the .bat file launchers can have
1090+
# trouble with these.
1091+
working_directory: "~/path with spaces ()/"
1092+
executor:
1093+
name: win/server-2019
1094+
shell: bash.exe -eo pipefail
1095+
environment:
1096+
PYTHONUNBUFFERED: "1"
1097+
EMSDK_NOTTY: "1"
1098+
steps:
1099+
- checkout
1100+
- run:
1101+
name: Install packages
1102+
command: |
1103+
choco install -y cmake.portable ninja pkgconfiglite
1104+
- run:
1105+
name: Add python to bash path
1106+
command: echo "export PATH=\"$PATH:/c/Python27amd64/\"" >> $BASH_ENV
1107+
- install-emsdk
1108+
- pip-install:
1109+
python: "$EMSDK_PYTHON"
1110+
- run-tests-firefox-windows:
1111+
title: "browser on firefox on windows"
1112+
# skip browser.test_glbook, as it requires mingw32-make, which is not
1113+
# installed on CircleCI.
1114+
# skip browser.test_sdl2_mixer_wav_dash_l, fails to build on Windows
1115+
# on CircleCI (works locally)
1116+
#
1117+
# For now, just run a small subset of tests that are know to work.
1118+
# TODO: Include more tests here.
1119+
test_targets: "
1120+
browser.test_sdl_image
1121+
browser.test_dylink_many
1122+
skip:browser.test_glbook
1123+
skip:browser.test_sdl2_mixer_wav_dash_l
1124+
"
10751125
# TODO(sbc): Re-enable once we figure out why the emrun tests are
10761126
# locking up.
10771127
#test-browser-chrome-emrun:
@@ -1083,6 +1133,7 @@ jobs:
10831133
executor: focal
10841134
steps:
10851135
- test-sockets-chrome
1136+
10861137
# windows and mac do not have separate build and test jobs, as they only run
10871138
# a limited set of tests; it is simpler and faster to do it all in one job.
10881139
test-windows:
@@ -1129,19 +1180,6 @@ jobs:
11291180
title: "sockets.test_nodejs_sockets_echo*"
11301181
test_targets: "sockets.test_nodejs_sockets_echo*"
11311182
- upload-test-results
1132-
# Run browser tests as well.
1133-
- run-tests-firefox-windows:
1134-
title: "browser on firefox on windows"
1135-
# skip browser.test_glbook, as it requires mingw32-make, which is not
1136-
# installed on CircleCI.
1137-
# skip browser.test_sdl2_mixer_wav_dash_l, fails to build on Windows
1138-
# on CircleCI (works locally)
1139-
test_targets: "
1140-
browser
1141-
skip:browser.test_glbook
1142-
skip:browser.test_sdl2_mixer_wav_dash_l
1143-
"
1144-
- upload-test-results
11451183

11461184
test-mac-arm64:
11471185
executor: mac-arm64
@@ -1229,6 +1267,7 @@ workflows:
12291267
- test-spidermonkey
12301268
- test-node-compat
12311269
- test-windows
1270+
- test-windows-browser-firefox
12321271
- test-mac-arm64:
12331272
requires:
12341273
- build-linux

0 commit comments

Comments
 (0)