Add a test if command not found

This commit is contained in:
Laurent Destailleur 2025-10-22 13:30:36 +02:00
parent 43aa97edcc
commit 8d50b69bce

View file

@ -1,4 +1,6 @@
#!/bin/bash
# Script to run unit tests on API with hurl
#
if [[ -z ${DOLIHOST+x} ]]; then
DOLIHOST="localhost"
@ -16,6 +18,12 @@ if [[ "" != "${DOLISUBURL}" ]]; then
hostnport="${hostnport}/${DOLISUBURL}"
fi
echo "----- Run hurl test on APIs ---"
if ! command -v hurl &> /dev/null; then
echo The command hurl must be available.
exit 1
fi
echo "First we run tests that do not require authentication"
find api/ gui/ public/ -type f -iname '00*.hurl' -exec hurl --variable "hostnport=${hostnport}" --test "{}" + || exit 1