Attempt to fix tests
Some checks failed
Gitea - aviat/banker/pipeline/head There was a failure building this commit

This commit is contained in:
Timothy Warren 2021-02-05 13:47:37 -05:00
parent 3215c392aa
commit 7379170ca8
4 changed files with 25 additions and 4 deletions

14
Jenkinsfile vendored
View File

@ -1,8 +1,16 @@
node { node {
checkout scm checkout scm
docker.image('memcached:latest').withRun('-p 11211:11211') { c -> docker.image('memcached:latest').withRun('-p 11212:11211') { c ->
docker.image('redis:latest').withRun('-p 6379:6379') { d -> docker.image('redis:latest').withRun('-p 6380:6379') { d ->
docker.image('php:7.2') { 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 { steps {
sh 'sh build/docker_install.sh > /dev/null' sh 'sh build/docker_install.sh > /dev/null'
sh 'curl -sS https://getcomposer.org/installer | php' sh 'curl -sS https://getcomposer.org/installer | php'

View File

@ -21,6 +21,12 @@ class ApcuDriverTest extends DriverTestBase {
public function setup(): void public function setup(): void
{ {
if ( ! extension_loaded('apcu'))
{
$this->markTestSkipped();
return;
}
$this->driver = new ApcuDriver(); $this->driver = new ApcuDriver();
$this->driver->flush(); $this->driver->flush();
} }

View File

@ -21,6 +21,12 @@ class MemcachedDriverTest extends DriverTestBase {
public function setUp(): void public function setUp(): void
{ {
if ( ! class_exists('Memcached'))
{
$this->markTestSkipped();
return;
}
$config = [ $config = [
'host' => '127.0.0.1', 'host' => '127.0.0.1',
'port' => 11211 'port' => 11211
@ -28,6 +34,7 @@ class MemcachedDriverTest extends DriverTestBase {
if (array_key_exists('MEMCACHED_HOST', $_ENV)) if (array_key_exists('MEMCACHED_HOST', $_ENV))
{ {
$config['host'] = $_ENV['MEMCACHED_HOST']; $config['host'] = $_ENV['MEMCACHED_HOST'];
$config['port'] = 11212;
} }
$this->driver = new MemcachedDriver($config); $this->driver = new MemcachedDriver($config);

View File

@ -26,7 +26,7 @@ class RedisDriverTest extends DriverTestBase {
{ {
$config['scheme'] = 'tcp'; $config['scheme'] = 'tcp';
$config['host'] = $_ENV['REDIS_HOST']; $config['host'] = $_ENV['REDIS_HOST'];
$config['port'] = 6379; $config['port'] = 6380;
} }
$this->driver = new RedisDriver($config); $this->driver = new RedisDriver($config);