mirror of https://github.com/sipwise/data-hal.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
738 B
34 lines
738 B
#!/bin/bash
|
|
# This script is used for running the tests with proper arguments
|
|
# from within Jenkins
|
|
|
|
set -e
|
|
set -u
|
|
|
|
RC=0
|
|
|
|
if [ -d /results ] ; then
|
|
# Running from Jenkins (RW)
|
|
RESULTS="/results"
|
|
|
|
cd "/code"
|
|
prove --timer --formatter TAP::Formatter::JUnit -l -I/code/lib | \
|
|
tee -a "${RESULTS}/results.xml" || RC=$?
|
|
else
|
|
# Running locally in Docker
|
|
RESULTS="./results"
|
|
mkdir -p "${RESULTS}"
|
|
|
|
prove -v --color -l -I/code/lib | tee -a "${RESULTS}/results.pretty" || RC=$?
|
|
fi
|
|
|
|
echo "Finished test execution, test execution returned with exit code ${RC}."
|
|
for file in "${RESULTS}/results.pretty" "${RESULTS}/results.xml" ; do
|
|
if [ -f "$file" ] ; then
|
|
echo "Test results available at ${file}"
|
|
fi
|
|
done
|
|
|
|
exit "${RC}"
|
|
|