1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 21:22:58 +01:00
invoiceninja/dusk.sh

65 lines
1.7 KiB
Bash
Raw Normal View History

2021-07-11 17:29:27 +02:00
#!/bin/bash
2021-07-12 14:51:43 +02:00
n=1
TYPE=${!n}
if [ -z "$TYPE" ]; then
TYPE="all"
fi
echo "$ RUNNING: '$TYPE'"
2021-07-11 17:29:27 +02:00
echo "$ php artisan optimize"
php artisan optimize
2021-07-12 14:51:43 +02:00
echo "=========================================="
2021-07-11 17:29:27 +02:00
GENERIC_TESTS=`find tests/Browser/ClientPortal/ -maxdepth 1 -type f -name '*.php'`
2021-07-12 14:51:43 +02:00
if [ $TYPE == 'gateways' ]; then
GENERIC_TESTS=""
echo "$ Skippping generic tests."
echo "=========================================="
fi
2021-07-11 17:29:27 +02:00
for TEST_CLASS in $GENERIC_TESTS; do
echo "Test class: $TEST_CLASS"
echo "$ php artisan migrate:fresh --seed"
php artisan migrate:fresh --seed &> /dev/null
echo "$ php artisan ninja:create-single-account"
php artisan ninja:create-single-account &> /dev/null
echo "$ php artisan dusk $TEST_CLASS"
2021-07-13 14:44:21 +02:00
php -d memory_limit=1G artisan dusk ${@:2} --stop-on-error --stop-on-failure $TEST_CLASS || exit 1
2021-07-11 17:29:27 +02:00
echo "=========================================="
done || exit 1
GATEWAY_TESTS=`find tests/Browser/ClientPortal/Gateways/ -type f -name '*.php'`
2021-07-12 14:51:43 +02:00
if [ $TYPE == 'generic' ]; then
GATEWAY_TESTS=""
echo "$ Skippping gateway tests."
echo "=========================================="
fi
2021-07-11 17:29:27 +02:00
for TEST_CLASS in $GATEWAY_TESTS; do
echo "Test class: $TEST_CLASS"
echo "$ php artisan migrate:fresh --seed"
php artisan migrate:fresh --seed &> /dev/null
echo "$ php artisan ninja:create-single-account"
php artisan ninja:create-single-account &> /dev/null
echo "$ php artisan dusk $TEST_CLASS"
2021-07-13 14:44:21 +02:00
php -d memory_limit=1G artisan dusk ${@:2} --stop-on-error --stop-on-failure $TEST_CLASS || exit 1
2021-07-11 17:29:27 +02:00
echo "=========================================="
done || exit 1
echo 'All tests completed successfully.'