Skip to content

Commit

Permalink
fix cache tests test: Update test launch script
Browse files Browse the repository at this point in the history
  • Loading branch information
SebSept authored Jan 15, 2025
1 parent acf00e8 commit 3c0650c
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 19 deletions.
26 changes: 12 additions & 14 deletions .github/actions/test_tests-cache.sh
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion phpunit/functional/Calendar_HolidayTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public function testGetHolidaysForCalendar()
}

/**
* @tags cache
* @group cache
*/
public function testHolidaysCache()
{
Expand Down
4 changes: 2 additions & 2 deletions phpunit/functional/DbUtilsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -915,7 +915,7 @@ public function testGetAncestorsOf()
}

/**
* @tags cache
* @group cache
*/
public function testGetAncestorsOfCached()
{
Expand Down Expand Up @@ -1107,7 +1107,7 @@ public function testGetSonsOf()
}

/**
* @tags cache
* @group cache
*/
public function testGetSonsOfCached()
{
Expand Down
4 changes: 2 additions & 2 deletions phpunit/functional/EntityTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ public function testChangeEntityParent()
}

/**
* @tags cache
* @group cache
*/
public function testChangeEntityParentCached()
{
Expand All @@ -302,7 +302,7 @@ public function testMoveParentEntity(): void
}

/**
* @tags cache
* @group cache
*/
public function testMoveParentEntityCached(): void
{
Expand Down

0 comments on commit 3c0650c

Please sign in to comment.