[TESTS] Add test container with Xdebug and allow for generation of coverage reports with 'make test'
This commit is contained in:
parent
091f4b5194
commit
ee97cc5b00
@ -3,3 +3,4 @@ KERNEL_CLASS='App\Kernel'
|
||||
APP_SECRET='$ecretf0rt3st'
|
||||
SYMFONY_DEPRECATIONS_HELPER=999999
|
||||
PANTHER_APP_ENV=panther
|
||||
DATABASE_URL=postgresql://postgres:password@db:5432/social
|
||||
|
5
.gitignore
vendored
5
.gitignore
vendored
@ -52,4 +52,7 @@ social.local.yaml
|
||||
config.php
|
||||
/file
|
||||
|
||||
notes
|
||||
notes
|
||||
|
||||
|
||||
.test_coverage_report
|
@ -6,6 +6,12 @@ echo "Got response from DB"
|
||||
|
||||
for script in /var/entrypoint.d/*.sh; do
|
||||
$script
|
||||
ret=$?
|
||||
if [ $ret -eq 64 ]; then
|
||||
exit 0
|
||||
elif [ $ret -eq 65 ]; then
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
exec php-fpm
|
||||
|
8
docker/testing/Dockerfile
Normal file
8
docker/testing/Dockerfile
Normal file
@ -0,0 +1,8 @@
|
||||
FROM gsocial/php
|
||||
|
||||
WORKDIR /var/www/social
|
||||
|
||||
RUN apk update \
|
||||
&& apk add --no-cache $PHPIZE_DEPS \
|
||||
&& pecl install xdebug \
|
||||
&& docker-php-ext-enable xdebug
|
7
docker/testing/coverage.sh
Executable file
7
docker/testing/coverage.sh
Executable file
@ -0,0 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
if /var/www/social/bin/phpunit --coverage-html .test_coverage_report; then
|
||||
exit 64
|
||||
else
|
||||
exit 65
|
||||
fi
|
3
docker/testing/xdebug.ini
Normal file
3
docker/testing/xdebug.ini
Normal file
@ -0,0 +1,3 @@
|
||||
zend_extension=xdebug
|
||||
xdebug.mode=develop,coverage
|
||||
|
Loading…
Reference in New Issue
Block a user