From 15e4b759868d15d25f3b0ca61dfc70c152bfca0f Mon Sep 17 00:00:00 2001 From: Derrick Oswald Date: Fri, 29 Sep 2023 10:33:04 +0200 Subject: [PATCH] allow testing with Firefox snap The snap version of Firefox cannot write to the /tmp location. Recommended workaround is to set TMPDIR environment variable to location that both geckodriver and firefox can write to e.g. $HOME/tmp. See https://github.com/mozilla/geckodriver/releases/tag/v0.31.0 and https://github.com/mozilla/geckodriver/issues/2010 This change adds the TMPDIR environment to allow testing with the Snap version of Firefox. The downside is a possibly orphan directory (~/tmp) containing geckodriver and v8-compile-cache-1000. --- veilid-wasm/wasm_test.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/veilid-wasm/wasm_test.sh b/veilid-wasm/wasm_test.sh index 3103cb57..1fcde9f0 100755 --- a/veilid-wasm/wasm_test.sh +++ b/veilid-wasm/wasm_test.sh @@ -15,6 +15,10 @@ wasm-pack build $WASM_PACK_FLAGS --target bundler --weak-refs # Install test deps and run test suite cd tests npm install +original_tmpdir=$TMPDIR +mkdir --parents ~/tmp +export TMPDIR=~/tmp npm run test:headless +export TMPDIR=$original_tmpdir popd &> /dev/null