Skip to content

Commit 509095c

Browse files
committed
- Code coverage with Coveralls prepared.
1 parent d913fa0 commit 509095c

File tree

4 files changed

+10
-12
lines changed

4 files changed

+10
-12
lines changed

docker/entrypoint.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -247,10 +247,6 @@ apk add curl bash vim nodejs npm mariadb mariadb-client openrc
247247
curl 'https://dl.bintray.com/php-alpine/key/php-alpine.rsa.pub' -o /etc/apk/keys/php-alpine.rsa.pub
248248
apk add php7-curl php7-dom php7-fpm php7-json php7-session php7-openssl php7-pdo_mysql php7-pdo php7-fileinfo --repository https://dl.bintray.com/php-alpine/v3.10/php-7.4
249249

250-
# Install and enable Xdebug for code coverage with coveralls
251-
pecl install xdebug
252-
docker-php-ext-enable xdebug
253-
254250
# Config ~/.vimrc file
255251
cat <<EOF -> ~/.vimrc
256252
set sts=2
@@ -969,6 +965,10 @@ rc-service nginx start
969965
rc-update add php-fpm7 default
970966
rc-update add nginx default
971967

968+
# Install and enable Xdebug for code coverage with coveralls
969+
pecl install xdebug
970+
docker-php-ext-enable xdebug
971+
972972
# Don't stop the container on server crash
973973
set +x
974974
sleep 3

docker/install-container.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ $dockerdir/remove-container.sh
6565
# Install container
6666
sudo docker run \
6767
-d \
68+
-e UPLOAD_COVERALLS=false \
6869
-e LARAVEL_HTTP_PORT=$LARAVEL_HTTP_PORT \
6970
-e LARAVEL_SERVER_ENV=$LARAVEL_SERVER_ENV \
7071
-e LARAVEL_MAXMIND_COUNTRY_LICENSE_KEY=$LARAVEL_MAXMIND_COUNTRY_LICENSE_KEY \

phpunit.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,5 +59,6 @@
5959
</php>
6060
<logging>
6161
<log type="coverage-clover" target="build/logs/clover.xml"/>
62+
<log type="coverage-html" target="build/logs/html"/>
6263
</logging>
6364
</phpunit>

tests/run-tests.sh

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ CREATE_DB=true
1111
CLEAR_CONFIG_CACHE=true
1212

1313
# UPLOAD_COVERALLS=<true|false>
14-
UPLOAD_COVERALLS=true
14+
UPLOAD_COVERALLS=${UPLOAD_COVERALLS-true}
1515

1616
if [ ! -e vendor/bin/phpunit ]
1717
then
@@ -68,18 +68,14 @@ fi
6868
# Clean up
6969
rm -rf $localdirname/build/
7070

71+
# Run unit and feature tests
72+
vendor/bin/phpunit -v
73+
7174
if [ "$UPLOAD_COVERALLS" == "true" ]
7275
then
73-
# Run unit and feature tests and output coverage data
74-
vendor/bin/phpunit --coverage-clover "$localdirname/build/logs/clover.xml"
75-
7676
# Run the code coverage analysis
7777
vendor/bin/php-coveralls -v
7878

79-
else
80-
# Run unit and feature tests and output html data
81-
vendor/bin/phpunit --coverage-html "$localdirname/build/logs/html"
82-
8379
fi
8480

8581
# Store the error code from the previous command because

0 commit comments

Comments
 (0)