diff --git a/.github/actions/test_tests-cache.sh b/.github/actions/test_tests-cache.sh index 239f977c195..79980e713b3 100755 --- a/.github/actions/test_tests-cache.sh +++ b/.github/actions/test_tests-cache.sh @@ -1,22 +1,20 @@ #!/bin/bash set -e -u -x -o pipefail -TMP_CACHE_DIR=$(mktemp -d -t glpi-cache-test-XXXXXXXXXX) +PHPUNIT_ADDITIONNAL_OPTIONS="" +if [[ "${CODE_COVERAGE:-}" = true ]]; then + export COVERAGE_DIR="coverage-functional" + PHPUNIT_ADDITIONNAL_OPTIONS="--coverage-filter src --coverage-clover phpunit/$COVERAGE_DIR/clover.xml" + +else + PHPUNIT_ADDITIONNAL_OPTIONS="--no-coverage"; +fi for CONFIG in {"--use-default","--dsn=memcached://memcached","--dsn=redis://redis"}; do php bin/console cache:configure \ - --config-dir=./tests/config --ansi --no-interaction \ + --ansi --no-interaction \ $CONFIG - vendor/bin/atoum \ - -p 'php -d memory_limit=512M' \ - --debug \ - --force-terminal \ - --use-dot-report \ - --bootstrap-file tests/bootstrap.php \ - --fail-if-void-methods \ - --fail-if-skipped-methods \ - --no-code-coverage \ - --max-children-number 1 \ - -d tests/functional \ - -t cache + vendor/bin/phpunit --group cache $PHPUNIT_ADDITIONNAL_OPTIONS $@ done + +unset COVERAGE_DIR diff --git a/phpunit/functional/Calendar_HolidayTest.php b/phpunit/functional/Calendar_HolidayTest.php index 65bf0f7964b..6fb9042106b 100644 --- a/phpunit/functional/Calendar_HolidayTest.php +++ b/phpunit/functional/Calendar_HolidayTest.php @@ -78,7 +78,7 @@ public function testGetHolidaysForCalendar() } /** - * @tags cache + * @group cache */ public function testHolidaysCache() { diff --git a/phpunit/functional/DbUtilsTest.php b/phpunit/functional/DbUtilsTest.php index cf8542c7bd0..8cdf3dadf73 100644 --- a/phpunit/functional/DbUtilsTest.php +++ b/phpunit/functional/DbUtilsTest.php @@ -915,7 +915,7 @@ public function testGetAncestorsOf() } /** - * @tags cache + * @group cache */ public function testGetAncestorsOfCached() { @@ -1107,7 +1107,7 @@ public function testGetSonsOf() } /** - * @tags cache + * @group cache */ public function testGetSonsOfCached() { diff --git a/phpunit/functional/EntityTest.php b/phpunit/functional/EntityTest.php index 161afc5c156..0b794d4f948 100644 --- a/phpunit/functional/EntityTest.php +++ b/phpunit/functional/EntityTest.php @@ -283,7 +283,7 @@ public function testChangeEntityParent() } /** - * @tags cache + * @group cache */ public function testChangeEntityParentCached() { @@ -302,7 +302,7 @@ public function testMoveParentEntity(): void } /** - * @tags cache + * @group cache */ public function testMoveParentEntityCached(): void {