forked from Islandora-Devops/isle-dc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun-tests.sh
executable file
·33 lines (26 loc) · 868 Bytes
/
run-tests.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/sh
if [ -t 1 ] ; then
echo "WARNING: running the test suite will result in resetting the stack's state "
echo "to the SNAPSHOT_TAG specified in .env. This will wipe out all local changes "
echo "to Drupal's databases and remove any active content or configuration added since"
echo "the last snapshot."
echo ""
echo "WARNING: continue? [Y/n]"
read line; if [ $line != "Y" ]; then echo aborting; exit 1 ; fi
fi
reset() {
printf "\nResetting state to last snapshot\n"
docker-compose down -v 2>/dev/null
make -s up 2>/dev/null
}
for testscript in tests/*; do
reset
printf "\n\nRunning ${testscript}\n"
{ $testscript && echo "PASS: $testscript"; } || { FAILURES="${FAILURES} $testscript" && echo "FAIL: $testscript";}
done
reset
if [ ! -z "${FAILURES}" ] ; then
printf "\nFAIL: ${FAILURES}\n"
exit 1
fi
printf "\nSUCCESS: All test passed\n"