Fix node-modules in run-test.sh

This commit is contained in:
Justin Stephenson 2023-05-03 15:41:36 -04:00
parent 806eeab1f2
commit 7414584afe

View file

@ -3,18 +3,23 @@ set -eux
# tests need cockpit's bots/ libraries and test infrastructure # tests need cockpit's bots/ libraries and test infrastructure
cd $SOURCE cd $SOURCE
git init
rm -f bots # common local case: existing bots symlink rm -f bots # common local case: existing bots symlink
make bots test/common make bots test/common
if [ -e .git ]; then # support running from clean git tree
tools/node-modules checkout if [ ! -d node_modules/chrome-remote-interface ]; then
# disable detection of affected tests; testing takes too long as there is no parallelization # copy package.json temporarily otherwise npm might try to install the dependencies from it
mv .git dot-git rm -f package-lock.json # otherwise the command below installs *everything*, argh
else mv package.json .package.json
# upstream tarballs ship test dependencies; print version for debugging # only install a subset to save time/space
grep '"version"' node_modules/chrome-remote-interface/package.json npm install chrome-remote-interface sizzle
mv .package.json package.json
fi fi
# disable detection of affected tests; testing takes too long as there is no parallelization
mv .git dot-git
. /etc/os-release . /etc/os-release
export TEST_OS="${ID}-${VERSION_ID/./-}" export TEST_OS="${ID}-${VERSION_ID/./-}"
export TEST_AUDIT_NO_SELINUX=1 export TEST_AUDIT_NO_SELINUX=1