-
Notifications
You must be signed in to change notification settings - Fork 14
/
build.sh
executable file
·62 lines (42 loc) · 1.5 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
50
51
52
53
54
55
56
57
58
59
60
61
#!/usr/bin/env bash
MYSQLPASS=${1:-d8modulestatus}
CONCURRENCY=${2:-2}
mkdir -p www-new
cp -rp assets www-new
# Build the make file.
chmod -R 777 internal
rm -r internal
drush make --working-copy --nocolor --force-complete project.make internal
# Install drupal
cd internal
drush si -y --nocolor --db-url=mysql://d8modulestatus:$MYSQLPASS@localhost/d8modulestatus minimal
# Enable simpletest
drush en -y --nocolor simpletest
# Update composer dependencies
php ./modules/composer_manager/scripts/init.php
/usr/local/bin/composer drupal-rebuild
/usr/local/bin/composer update --lock
# Drop block_page_layout as its tests are broken and kill simpletest
rm -r modules/layout_plugin/modules/block_page_layout
# @todo Use mysql?
export SIMPLETEST_BASE_URL=http://d8modulestatus/
export SIMPLETEST_DB=sqlite://localhost//tmp/test.sqlite
# Loop over all projects.
for FOLDER in `cd modules; ls -d1 */`; do
# Remove trailing / from foldername
PROJECT=${FOLDER%%/}
echo ""
echo "=== Testing $PROJECT ==="
echo ""
# Prepare www folder.
mkdir -p ../www-new/$PROJECT/simpletest
./vendor/bin/phpunit -c core/phpunit.xml.dist --log-junit=../www-new/$PROJECT/phpunit.xml modules/$PROJECT/
done
test_files=`find modules/ -name "*Test*.php" | grep src/Tests | paste -s -d,`
mkdir -p ../www-new/simpletest
php core/scripts/run-tests.sh --concurrency $CONCURRENCY --url http://d8modulestatus/ --xml ../www-new/simpletest --file "$test_files"
cd ..
rm -r www-old
mv www www-old
mv www-new www
php parse_results.php