-
Notifications
You must be signed in to change notification settings - Fork 0
/
generate.sh
executable file
·113 lines (101 loc) · 3.81 KB
/
generate.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
#!/bin/bash
while true; do
read -p "Do you want to install magento 1.9.x or 1.6.x [19|16]? " version
case $version in
[19]* ) break;;
[16]* ) break;;
* ) echo "Please answer 19 or 16.";;
esac
done
while true; do
read -p "Do you wish to run dev or test [test|dev]? " devtest
case $devtest in
[dev]* ) container="magento$version-dev";test=false; break;;
[test]* ) container="magento$version-test";test=true; break;;
* ) echo "Please answer dev or test.";;
esac
done
while true; do
read -p "You have chosen to start ${container}, are you sure [y/n]? " yn
case $yn in
[Yy]* ) break;;
[Nn]* ) exit;;
* ) echo "Please answer yes or no.";;
esac
done
composer install
# Prepare environment and build package
docker-compose down
docker-compose up -d ${container} selenium
sleep 10
# Copy Files for test container
if [ $test = true ];
then
docker cp ./extension/. ${container}:/pagantis/
else
export MAGENTO_TEST_ENV=dev
fi
if [ $version = "16" ];
then
echo "copying ./resources/Mysql4.php into ${container}:/var/www/html/app/code/core/Mage/Install/Model/Installer/Db/"
docker cp ./resources/Mysql4.php ${container}:/var/www/html/app/code/core/Mage/Install/Model/Installer/Db/
fi
# Install magento and sample data
docker-compose exec ${container} install-sampledata
docker-compose exec ${container} install-magento
# Install modman and enable the link creation
docker-compose exec ${container} modman init
docker-compose exec ${container} modman link /pagantis
# Install n98-magerun to enable automatically dev:symlinks so that modman works
docker-compose exec ${container} curl -O https://files.magerun.net/n98-magerun.phar
docker-compose exec ${container} chmod +x n98-magerun.phar
docker-compose exec ${container} ./n98-magerun.phar dev:symlinks 1
sleep 20
set -e
while true; do
read -p "Do you want to run full tests battery or only configure the module [full/configure]? " tests
case $tests in
[full]* ) break;;
[configure]* ) break;;
* ) echo "Please answer full or configure."; exit;;
esac
done
if [ $tests = "full" ];
then
echo "magento $version tests start"
# Run test
echo magento-basic
extension/lib/Pagantis/bin/phpunit --group magento-basic-$version
echo magento-configure-backoffice
extension/lib/Pagantis/bin/phpunit --group magento-configure-backoffice-$version
echo magento-product-page
extension/lib/Pagantis/bin/phpunit --group magento-product-page-$version
echo magento-register
extension/lib/Pagantis/bin/phpunit --group magento-register-$version
echo magento-fill-data
extension/lib/Pagantis/bin/phpunit --group magento-fill-data-$version
echo magento-buy-unregistered
extension/lib/Pagantis/bin/phpunit --group magento-buy-unregistered-$version
echo magento-cancel-buy-unregistered
extension/lib/Pagantis/bin/phpunit --group magento-cancel-buy-unregistered-$version
echo magento-buy-registered
extension/lib/Pagantis/bin/phpunit --group magento-buy-registered-$version
echo magento-cancel-buy-registered
extension/lib/Pagantis/bin/phpunit --group magento-cancel-buy-registered-$version
echo magento-cancel-buy-controllers
extension/lib/Pagantis/bin/phpunit --group magento-controllers-$version
# Copy Files for test container
if [ $test = true ];
then
# Generate Pakage
echo magento-package
extension/lib/Pagantis/bin/phpunit --group magento-package
fi
else
echo "magento $version configuration start"
echo magento-basic
extension/lib/Pagantis/bin/phpunit --group magento-basic-$version
echo magento-configure-backoffice
extension/lib/Pagantis/bin/phpunit --group magento-configure-backoffice-$version
fi
docker-compose exec ${container} ./n98-magerun.phar cache:flush