]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: run-frontend-e2e-tests.sh: allow user defined BASE_URL & npm binary. 32211/head
authorAlfonso Martínez <almartin@redhat.com>
Thu, 12 Dec 2019 13:05:29 +0000 (14:05 +0100)
committerAlfonso Martínez <almartin@redhat.com>
Thu, 12 Dec 2019 13:05:29 +0000 (14:05 +0100)
Fixes: https://tracker.ceph.com/issues/43284
Signed-off-by: Alfonso Martínez <almartin@redhat.com>
src/pybind/mgr/dashboard/run-frontend-e2e-tests.sh

index 1d6c728b70eb94e237ebb1a0815cddb99d08bf0f..9930d45aab21ebf61ed94ef292a10e80a14b0286 100755 (executable)
@@ -18,10 +18,7 @@ while getopts 'd:r:' flag; do
   case "${flag}" in
     d) DEVICE=$OPTARG;;
     r) REMOTE='true'
-       # jq is expecting a string literal, otherwise it will fail on the url ':'.
-       # We need to ensure that jq gets a json string for assignment; we achieve
-       # that by introducing literal double quotes (i.e., '"').
-       BASE_URL='"'$OPTARG'"';;
+       BASE_URL=$OPTARG;;
   esac
 done
 
@@ -73,7 +70,7 @@ export BASE_URL
 cd $DASH_DIR/frontend
 jq .[].target=\"$BASE_URL\" proxy.conf.json.sample > proxy.conf.json
 
-. ${FULL_PATH_BUILD_DIR}/src/pybind/mgr/dashboard/node-env/bin/activate
+[[ "$(command -v npm)" == '' ]] && . ${FULL_PATH_BUILD_DIR}/src/pybind/mgr/dashboard/node-env/bin/activate
 
 if [ "$DEVICE" == "chrome" ]; then
     npm run e2e:ci || stop 1