From 0823f4d72d204f1ea5b22fff0637a8ef5107885b Mon Sep 17 00:00:00 2001 From: Philipp Holzer Date: Mon, 23 Sep 2019 14:31:13 +0200 Subject: [PATCH] Add group for cache tests --- autotest.sh | 22 +++++++++++++++++-- tests/src/Core/Cache/APCuCacheTest.php | 3 +++ tests/src/Core/Cache/MemcacheCacheTest.php | 1 + tests/src/Core/Cache/MemcachedCacheTest.php | 1 + tests/src/Core/Cache/RedisCacheTest.php | 1 + tests/src/Core/Lock/APCuCacheLockTest.php | 3 +++ tests/src/Core/Lock/MemcacheCacheLockTest.php | 1 + .../src/Core/Lock/MemcachedCacheLockTest.php | 1 + tests/src/Core/Lock/RedisCacheLockTest.php | 1 + 9 files changed, 32 insertions(+), 2 deletions(-) diff --git a/autotest.sh b/autotest.sh index 796572d809..b160950275 100755 --- a/autotest.sh +++ b/autotest.sh @@ -134,13 +134,31 @@ function execute_tests { echo "No coverage" fi + # per default, there is no cache installed + GROUP='--exclude-group=REDIS,MEMCACHE,MEMCACHED,APCU' + if [ "$TEST_SELECTION" == "REDIS" ]; then + GROUP="--group REDIS" + fi + if [ "$TEST_SELECTION" == "MEMCACHE" ]; then + GROUP="--group MEMCACHE" + fi + if [ "$TEST_SELECTION" == "MEMCACHED" ]; then + GROUP="--group MEMCACHED" + fi + if [ "$TEST_SELECTION" == "APCU" ]; then + GROUP="--group APCU" + fi + if [ "$TEST_SELECTION" == "NODB" ]; then + GROUP="--exclude-group=DB,SLOWDB" + fi + INPUT="$BASEDIR/tests" if [ -n "$1" ]; then INPUT="$INPUT/$1" fi - echo "${PHPUNIT[@]}" --configuration tests/phpunit.xml $COVER --log-junit "autotest-results.xml" "$INPUT" "$2" - "${PHPUNIT[@]}" --configuration tests/phpunit.xml $COVER --log-junit "autotest-results.xml" "$INPUT" "$2" + echo "${PHPUNIT[@]}" --configuration tests/phpunit.xml "$GROUP" "$COVER" --log-junit "autotest-results.xml" "$INPUT" "$2" + "${PHPUNIT[@]}" --configuration tests/phpunit.xml "$GROUP" "$COVER" --log-junit "autotest-results.xml" "$INPUT" "$2" RESULT=$? if [ -n "$DOCKER_CONTAINER_ID" ]; then diff --git a/tests/src/Core/Cache/APCuCacheTest.php b/tests/src/Core/Cache/APCuCacheTest.php index 1b90be574e..dfb81d9c6c 100644 --- a/tests/src/Core/Cache/APCuCacheTest.php +++ b/tests/src/Core/Cache/APCuCacheTest.php @@ -4,6 +4,9 @@ namespace Friendica\Test\src\Core\Cache; use Friendica\Core\Cache\APCuCache; +/** + * @group APCU + */ class APCuCacheTest extends MemoryCacheTest { protected function setUp() diff --git a/tests/src/Core/Cache/MemcacheCacheTest.php b/tests/src/Core/Cache/MemcacheCacheTest.php index 8abf169aea..4e3a806191 100644 --- a/tests/src/Core/Cache/MemcacheCacheTest.php +++ b/tests/src/Core/Cache/MemcacheCacheTest.php @@ -7,6 +7,7 @@ use Friendica\Core\Config\Configuration; /** * @requires extension memcache + * @group MEMCACHE */ class MemcacheCacheTest extends MemoryCacheTest { diff --git a/tests/src/Core/Cache/MemcachedCacheTest.php b/tests/src/Core/Cache/MemcachedCacheTest.php index c8c65c9caa..058a784da7 100644 --- a/tests/src/Core/Cache/MemcachedCacheTest.php +++ b/tests/src/Core/Cache/MemcachedCacheTest.php @@ -9,6 +9,7 @@ use Psr\Log\NullLogger; /** * @requires extension memcached + * @group MEMCACHED */ class MemcachedCacheTest extends MemoryCacheTest { diff --git a/tests/src/Core/Cache/RedisCacheTest.php b/tests/src/Core/Cache/RedisCacheTest.php index cddefe3acc..75891cd1b8 100644 --- a/tests/src/Core/Cache/RedisCacheTest.php +++ b/tests/src/Core/Cache/RedisCacheTest.php @@ -8,6 +8,7 @@ use Friendica\Core\Config\Configuration; /** * @requires extension redis + * @group REDIS */ class RedisCacheTest extends MemoryCacheTest { diff --git a/tests/src/Core/Lock/APCuCacheLockTest.php b/tests/src/Core/Lock/APCuCacheLockTest.php index 3fbb3605a1..c243717810 100644 --- a/tests/src/Core/Lock/APCuCacheLockTest.php +++ b/tests/src/Core/Lock/APCuCacheLockTest.php @@ -5,6 +5,9 @@ namespace Friendica\Test\src\Core\Lock; use Friendica\Core\Cache\APCuCache; use Friendica\Core\Lock\CacheLock; +/** + * @group APCU + */ class APCuCacheLockTest extends LockTest { protected function setUp() diff --git a/tests/src/Core/Lock/MemcacheCacheLockTest.php b/tests/src/Core/Lock/MemcacheCacheLockTest.php index 4e7dd30340..cebe246c19 100644 --- a/tests/src/Core/Lock/MemcacheCacheLockTest.php +++ b/tests/src/Core/Lock/MemcacheCacheLockTest.php @@ -9,6 +9,7 @@ use Friendica\Core\Lock\CacheLock; /** * @requires extension Memcache + * @group MEMCACHE */ class MemcacheCacheLockTest extends LockTest { diff --git a/tests/src/Core/Lock/MemcachedCacheLockTest.php b/tests/src/Core/Lock/MemcachedCacheLockTest.php index 2249b88b8c..85387239b7 100644 --- a/tests/src/Core/Lock/MemcachedCacheLockTest.php +++ b/tests/src/Core/Lock/MemcachedCacheLockTest.php @@ -10,6 +10,7 @@ use Psr\Log\NullLogger; /** * @requires extension memcached + * @group MEMCACHED */ class MemcachedCacheLockTest extends LockTest { diff --git a/tests/src/Core/Lock/RedisCacheLockTest.php b/tests/src/Core/Lock/RedisCacheLockTest.php index 5cecd8f4c1..95f7206e2c 100644 --- a/tests/src/Core/Lock/RedisCacheLockTest.php +++ b/tests/src/Core/Lock/RedisCacheLockTest.php @@ -9,6 +9,7 @@ use Friendica\Core\Lock\CacheLock; /** * @requires extension redis + * @group REDIS */ class RedisCacheLockTest extends LockTest {