From 7414584afed4f2aae1e15675d9d443f82e93547f Mon Sep 17 00:00:00 2001 From: Justin Stephenson Date: Wed, 3 May 2023 15:41:36 -0400 Subject: [PATCH] Fix node-modules in run-test.sh --- test/browser/run-test.sh | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/test/browser/run-test.sh b/test/browser/run-test.sh index 716197e..99b8029 100755 --- a/test/browser/run-test.sh +++ b/test/browser/run-test.sh @@ -3,18 +3,23 @@ set -eux # tests need cockpit's bots/ libraries and test infrastructure cd $SOURCE +git init rm -f bots # common local case: existing bots symlink make bots test/common -if [ -e .git ]; then - tools/node-modules checkout - # disable detection of affected tests; testing takes too long as there is no parallelization - mv .git dot-git -else - # upstream tarballs ship test dependencies; print version for debugging - grep '"version"' node_modules/chrome-remote-interface/package.json +# support running from clean git tree +if [ ! -d node_modules/chrome-remote-interface ]; then + # copy package.json temporarily otherwise npm might try to install the dependencies from it + rm -f package-lock.json # otherwise the command below installs *everything*, argh + mv package.json .package.json + # only install a subset to save time/space + npm install chrome-remote-interface sizzle + mv .package.json package.json fi +# disable detection of affected tests; testing takes too long as there is no parallelization +mv .git dot-git + . /etc/os-release export TEST_OS="${ID}-${VERSION_ID/./-}" export TEST_AUDIT_NO_SELINUX=1