Skip to content

Commit de433d6

Browse files
committed
Add Kafka cluster to travis configuration
1 parent c5acb0f commit de433d6

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

.travis.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,22 @@ before_install:
5454
sudo rm /etc/apt/sources.list.d/google-chrome.list
5555
sudo rm /etc/apt/sources.list.d/mongodb-3.4.list
5656
sudo apt update
57-
sudo apt install -y librabbitmq-dev libsodium-dev
57+
sudo apt install -y librabbitmq-dev libsodium-dev librdkafka-dev
5858
5959
- |
6060
# Start Redis cluster
6161
docker pull grokzen/redis-cluster:5.0.4
6262
docker run -d -p 7000:7000 -p 7001:7001 -p 7002:7002 -p 7003:7003 -p 7004:7004 -p 7005:7005 -p 7006:7006 -p 7007:7007 -e "STANDALONE=true" --name redis-cluster grokzen/redis-cluster:5.0.4
6363
export REDIS_CLUSTER_HOSTS='localhost:7000 localhost:7001 localhost:7002 localhost:7003 localhost:7004 localhost:7005'
6464
65+
- |
66+
# Start Kafka
67+
docker pull wurstmeister/zookeeper:3.4.6
68+
docker run -d -p 21810:2181 --name zookeeper wurstmeister/zookeeper:3.4.6
69+
docker pull wurstmeister/kafka:2.12-2.3.1
70+
docker run -d -p 9092:9092 -e "KAFKA_AUTO_CREATE_TOPICS_ENABLE=true" -e "KAFKA_ADVERTISED_HOST_NAME=kafka" -e "KAFKA_ZOOKEEPER_CONNECT=zookeeper:21810" -e "KAFKA_ADVERTISED_PORT=9092" --name kafka wurstmeister/kafka:2.12-2.3.1
71+
export KAFKA_BROKER=kafka:9092
72+
6573
- |
6674
# General configuration
6775
set -e
@@ -175,6 +183,7 @@ before_install:
175183
tfold ext.igbinary tpecl igbinary-2.0.8 igbinary.so $INI
176184
tfold ext.zookeeper tpecl zookeeper-0.7.1 zookeeper.so $INI
177185
tfold ext.amqp tpecl amqp-1.9.4 amqp.so $INI
186+
tfold ext.rdkafka tpecl rdkafka-3.0.0 rdkafka.so $INI
178187
tfold ext.redis tpecl redis-4.3.0 redis.so $INI "no"
179188
done
180189
- |

src/Symfony/Component/VarDumper/Tests/Caster/RdKafkaCasterTest.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
use RdKafka\TopicConf;
1919
use Symfony\Component\VarDumper\Test\VarDumperTestTrait;
2020

21+
/**
22+
* @requires extension rdkafka
23+
*/
2124
class RdKafkaCasterTest extends TestCase
2225
{
2326
use VarDumperTestTrait;
@@ -27,10 +30,6 @@ class RdKafkaCasterTest extends TestCase
2730

2831
protected function setUp(): void
2932
{
30-
if (!\extension_loaded('rdkafka')) {
31-
$this->markTestSkipped('Extension rdkafka not loaded.');
32-
}
33-
3433
if (!$this->hasBroker && getenv('KAFKA_BROKER')) {
3534
$this->broker = getenv('KAFKA_BROKER');
3635
$this->hasBroker = true;

0 commit comments

Comments
 (0)