forked from thelia/thelia
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun-tests.sh
executable file
·29 lines (22 loc) · 981 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
#!/bin/bash
# --------------------------------------------------------------
# This script is started by Travis to perform all Thelia 2 tests
# --------------------------------------------------------------
# will exit with non-zero error code if any of the command fails
set -e
echo "backup DB"
mysqldump -h localhost -u $DB_USER thelia >../thelia.sql
echo "phpunit"
./bin/phpunit
echo "restore DB"
mysql -h localhost -u $DB_USER thelia <../thelia.sql
echo "deactivate modules only needed by phpunit tests"
php Thelia module:refresh
php Thelia module:deactivate HookTest
echo "Clearing cache"
php Thelia cache:clear --env=prod
rm -rf local/session/sess_*
echo "CasperJS"
cd ../casperjs
export DISPLAY=:99.0
./bin/casperjs test ../thelia/tests/functionnal/casperjs/exe/front/ --pre=../thelia/tests/functionnal/casperjs/conf/local.js --verbose --thelia2_base_url="http://localhost:8000/index.php/" --thelia2_screenshot_path="../thelia/tests/functionnal/casperjs/screenshot/"