From 7379170ca8204ef3f82b7d2b497051ad19cf8f09 Mon Sep 17 00:00:00 2001 From: "Timothy J. Warren" Date: Fri, 5 Feb 2021 13:47:37 -0500 Subject: [PATCH] Attempt to fix tests --- Jenkinsfile | 14 +++++++++++--- tests/Driver/ApcuDriverTest.php | 6 ++++++ tests/Driver/MemcachedDriverTest.php | 7 +++++++ tests/Driver/RedisDriverTest.php | 2 +- 4 files changed, 25 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index b5b0a72..81c05a6 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,8 +1,16 @@ node { checkout scm - docker.image('memcached:latest').withRun('-p 11211:11211') { c -> - docker.image('redis:latest').withRun('-p 6379:6379') { d -> - docker.image('php:7.2') { + docker.image('memcached:latest').withRun('-p 11212:11211') { c -> + docker.image('redis:latest').withRun('-p 6380:6379') { d -> + docker.image('php:7.4') { + steps { + sh 'sh build/docker_install.sh > /dev/null' + sh 'curl -sS https://getcomposer.org/installer | php' + sh 'php composer.phar install --ignore-platform-reqs' + sh 'phpdbg -qrr -- ./vendor/bin/phpunit --coverage-text --colors=never' + } + } + docker.image('php:8') { steps { sh 'sh build/docker_install.sh > /dev/null' sh 'curl -sS https://getcomposer.org/installer | php' diff --git a/tests/Driver/ApcuDriverTest.php b/tests/Driver/ApcuDriverTest.php index f289b48..0843b7d 100644 --- a/tests/Driver/ApcuDriverTest.php +++ b/tests/Driver/ApcuDriverTest.php @@ -21,6 +21,12 @@ class ApcuDriverTest extends DriverTestBase { public function setup(): void { + if ( ! extension_loaded('apcu')) + { + $this->markTestSkipped(); + return; + } + $this->driver = new ApcuDriver(); $this->driver->flush(); } diff --git a/tests/Driver/MemcachedDriverTest.php b/tests/Driver/MemcachedDriverTest.php index 96b5b1c..df641d0 100644 --- a/tests/Driver/MemcachedDriverTest.php +++ b/tests/Driver/MemcachedDriverTest.php @@ -21,6 +21,12 @@ class MemcachedDriverTest extends DriverTestBase { public function setUp(): void { + if ( ! class_exists('Memcached')) + { + $this->markTestSkipped(); + return; + } + $config = [ 'host' => '127.0.0.1', 'port' => 11211 @@ -28,6 +34,7 @@ class MemcachedDriverTest extends DriverTestBase { if (array_key_exists('MEMCACHED_HOST', $_ENV)) { $config['host'] = $_ENV['MEMCACHED_HOST']; + $config['port'] = 11212; } $this->driver = new MemcachedDriver($config); diff --git a/tests/Driver/RedisDriverTest.php b/tests/Driver/RedisDriverTest.php index 662f6f9..c00f45a 100644 --- a/tests/Driver/RedisDriverTest.php +++ b/tests/Driver/RedisDriverTest.php @@ -26,7 +26,7 @@ class RedisDriverTest extends DriverTestBase { { $config['scheme'] = 'tcp'; $config['host'] = $_ENV['REDIS_HOST']; - $config['port'] = 6379; + $config['port'] = 6380; } $this->driver = new RedisDriver($config);