forked from Berdir/d8modulestatus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·50 lines (38 loc) · 1.29 KB
/
build.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
#!/usr/bin/env bash
# Build the make file.
chmod -R 777 www
rm -r www
drush make --nocolor --force-complete project.make www
# Install drupal
cd www
drush si -y --nocolor --db-url=mysql://d8modulestatus:d8modulestatus@localhost/d8modulestatus minimal
# Enable simpletest and composer manager
drush en -y --nocolor simpletest composer_manager
# Update composer dependencies
php ./modules/composer_manager/scripts/init.sh
cd core
composer drupal-update
# Define a mapping of non-standard test groups.
declare -A groupMap
groupMap[currency]=Currency
groupMap[google_analytics]="Google Analytics"
groupMap[payment]="Payment"
# Loop over all projects.
for FOLDER in `cd modules; ls -d1 */`; do
# Remove trailing / from foldername
PROJECT=${FOLDER%%/}
# Set simpletest group from the group map, default to project name.
GROUP=${groupMap[$PROJECT]:-$PROJECT}
echo ""
echo "=== Testing $PROJECT ==="
echo ""
# Prepare results folder.
mkdir -p ../results-new/$PROJECT/simpletest
phpunit -c core/phpunit.xml.dist --log-junit=../results-new/$PROJECT/phpunit.xml modules/$PROJECT/
php core/scripts/run-tests.sh --concurrency 2 --url http://d8modulestatus/ --xml ../results-new/$PROJECT/simpletest "$GROUP"
done
cd ..
rm -r results-old
mv results results-old
mv results-new results
php parse_results.php