Skip to content

Commit

Permalink
Clean tests
Browse files Browse the repository at this point in the history
  • Loading branch information
arnaud-lb committed Oct 24, 2024
1 parent 9f0cc2c commit 962ef27
Show file tree
Hide file tree
Showing 21 changed files with 24 additions and 68 deletions.
1 change: 0 additions & 1 deletion package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@
<file role="test" name="produce_consume.phpt"/>
<file role="test" name="produce_consume_queue.phpt"/>
<file role="test" name="produce_consume_transactional.phpt"/>
<file role="test" name="produce_opaque_noconf.phpt"/>
<file role="test" name="produce_opaque_noflush_dr_callback.phpt"/>
<file role="test" name="produce_opaque_noflush.phpt"/>
<file role="test" name="produce_opaque.phpt"/>
Expand Down
2 changes: 1 addition & 1 deletion tests/bug115.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ require __DIR__ . '/integration-tests-check.php';
$delivered = 0;

$conf = new RdKafka\Conf();
if (RD_KAFKA_VERSION >= 0x090000 && false !== getenv('TEST_KAFKA_BROKER_VERSION')) {
if (false !== getenv('TEST_KAFKA_BROKER_VERSION')) {
$conf->set('broker.version.fallback', getenv('TEST_KAFKA_BROKER_VERSION'));
}
$conf->setErrorCb(function ($producer, $err, $errstr) {
Expand Down
2 changes: 1 addition & 1 deletion tests/bug465.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ var_dump($n > 0);

function getTopics() {
$conf = new RdKafka\Conf();
if (RD_KAFKA_VERSION >= 0x090000 && false !== getenv('TEST_KAFKA_BROKER_VERSION')) {
if (false !== getenv('TEST_KAFKA_BROKER_VERSION')) {
$conf->set('broker.version.fallback', getenv('TEST_KAFKA_BROKER_VERSION'));
}
$conf->set('metadata.broker.list', getenv('TEST_KAFKA_BROKERS'));
Expand Down
3 changes: 0 additions & 3 deletions tests/conf_callbacks.phpt
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
--TEST--
RdKafka\Conf
--SKIPIF--
<?php
(RD_KAFKA_VERSION >= 0x090000 && RD_KAFKA_VERSION < 0x010100ff) || die("skip librdkafka too old");
--FILE--
<?php

Expand Down
1 change: 0 additions & 1 deletion tests/conf_callbacks_integration.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
RdKafka\Conf
--SKIPIF--
<?php
RD_KAFKA_VERSION >= 0x090000 || die("skip librdkafka too old");
(!isset($_ENV['TESTS_DONT_SKIP_RISKY']) || $_ENV['TESTS_DONT_SKIP_RISKY']) && die("skip Risky/broken test");
require __DIR__ . '/integration-tests-check.php';
--FILE--
Expand Down
3 changes: 0 additions & 3 deletions tests/conf_callbacks_rdkafka11.phpt
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
--TEST--
RdKafka\Conf
--SKIPIF--
<?php
RD_KAFKA_VERSION >= 0x010100ff || die("skip librdkafka too old");
--FILE--
<?php

Expand Down
6 changes: 0 additions & 6 deletions tests/conf_setDefaultTopicConf.phpt
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
--TEST--
RdKafka\Conf::setDefaultTopicConf()
--SKIPIF--
<?php
if (!method_exists('RdKafka\Conf', 'setDefaultTopicConf') || 7 < PHP_MAJOR_VERSION) {
echo "skip";
}
?>
--FILE--
<?php

Expand Down
4 changes: 2 additions & 2 deletions tests/controller_id.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Display controller id
--SKIPIF--
<?php
require __DIR__ . '/integration-tests-check.php';
RD_KAFKA_BUILD_VERSION < 0x010000ff && die("skip librdkafka < 1.0.0");
?>
--FILE--
<?php
require __DIR__ . '/integration-tests-check.php';
Expand All @@ -22,4 +22,4 @@ echo (new RdKafka\KafkaConsumer($conf))->getControllerId(10*1000) . \PHP_EOL;
--EXPECT--
1
1
1
1
2 changes: 1 addition & 1 deletion tests/init_transaction_not_configured.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ if (!class_exists("RdKafka\\KafkaErrorException")) {
require __DIR__ . '/integration-tests-check.php';

$conf = new RdKafka\Conf();
if (RD_KAFKA_VERSION >= 0x090000 && false !== getenv('TEST_KAFKA_BROKER_VERSION')) {
if (false !== getenv('TEST_KAFKA_BROKER_VERSION')) {
$conf->set('broker.version.fallback', getenv('TEST_KAFKA_BROKER_VERSION'));
}

Expand Down
2 changes: 1 addition & 1 deletion tests/message_headers.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
Message headers
--SKIPIF--
<?php
RD_KAFKA_VERSION >= 0x000b04ff || die("skip librdkafka too old");
require __DIR__ . '/integration-tests-check.php';
?>
--FILE--
<?php
require __DIR__ . '/integration-tests-check.php';
Expand Down
4 changes: 2 additions & 2 deletions tests/oauthbearer_integration.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Oauthbearer
--SKIPIF--
<?php
require __DIR__ . '/integration-tests-check.php';
RD_KAFKA_VERSION >= 0x01010000 || die("skip librdkafka too old does not support oauthbearer");
?>
--FILE--
<?php
require __DIR__ . '/integration-tests-check.php';
Expand Down Expand Up @@ -37,7 +37,7 @@ function generateJws($scope = 'required-scope', $expiresInSeconds = 60)

// Set up tests
$conf = new RdKafka\Conf();
if (RD_KAFKA_VERSION >= 0x090000 && false !== getenv('TEST_KAFKA_BROKER_VERSION')) {
if (false !== getenv('TEST_KAFKA_BROKER_VERSION')) {
$conf->set('broker.version.fallback', getenv('TEST_KAFKA_BROKER_VERSION'));
}
$conf->set('metadata.broker.list', getenv('TEST_KAFKA_OAUTH_BROKERS'));
Expand Down
2 changes: 1 addition & 1 deletion tests/produce_consume.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ require __DIR__ . '/integration-tests-check.php';
$delivered = 0;

$conf = new RdKafka\Conf();
if (RD_KAFKA_VERSION >= 0x090000 && false !== getenv('TEST_KAFKA_BROKER_VERSION')) {
if (false !== getenv('TEST_KAFKA_BROKER_VERSION')) {
$conf->set('broker.version.fallback', getenv('TEST_KAFKA_BROKER_VERSION'));
}
$conf->setErrorCb(function ($producer, $err, $errstr) {
Expand Down
4 changes: 2 additions & 2 deletions tests/produce_consume_queue.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ require __DIR__ . '/integration-tests-check.php';
$delivered = 0;

$conf = new RdKafka\Conf();
if (RD_KAFKA_VERSION >= 0x090000 && false !== getenv('TEST_KAFKA_BROKER_VERSION')) {
if (false !== getenv('TEST_KAFKA_BROKER_VERSION')) {
$conf->set('broker.version.fallback', getenv('TEST_KAFKA_BROKER_VERSION'));
}
$conf->setErrorCb(function ($producer, $err, $errstr) {
Expand Down Expand Up @@ -54,7 +54,7 @@ printf("%d messages delivered\n", $delivered);
$conf = new RdKafka\Conf();
// Required to detect actual reaching of partition EOF for both topics
$conf->set('enable.partition.eof', 'true');
if (RD_KAFKA_VERSION >= 0x090000 && false !== getenv('TEST_KAFKA_BROKER_VERSION')) {
if (false !== getenv('TEST_KAFKA_BROKER_VERSION')) {
$conf->set('broker.version.fallback', getenv('TEST_KAFKA_BROKER_VERSION'));
}
$conf->setErrorCb(function ($producer, $err, $errstr) {
Expand Down
2 changes: 1 addition & 1 deletion tests/produce_consume_transactional.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ $delivered = 0;

$conf = new RdKafka\Conf();
$conf->set('transactional.id', 'transactional-producer');
if (RD_KAFKA_VERSION >= 0x090000 && false !== getenv('TEST_KAFKA_BROKER_VERSION')) {
if (false !== getenv('TEST_KAFKA_BROKER_VERSION')) {
$conf->set('broker.version.fallback', getenv('TEST_KAFKA_BROKER_VERSION'));
}
$conf->setLogCb(function ($kafka, $level, $facility, $message) {});
Expand Down
4 changes: 2 additions & 2 deletions tests/produce_opaque.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ Produce with opaque
--SKIPIF--
<?php
require __DIR__ . '/integration-tests-check.php';
RD_KAFKA_BUILD_VERSION < 0x1000000 && die("skip librdkafka < 1.0.0");
?>
--FILE--
<?php
require __DIR__ . '/integration-tests-check.php';

$conf = new RdKafka\Conf();
if (RD_KAFKA_VERSION >= 0x090000 && false !== getenv('TEST_KAFKA_BROKER_VERSION')) {
if (false !== getenv('TEST_KAFKA_BROKER_VERSION')) {
$conf->set('broker.version.fallback', getenv('TEST_KAFKA_BROKER_VERSION'));
}
$conf->set('metadata.broker.list', getenv('TEST_KAFKA_BROKERS'));
Expand Down
30 changes: 0 additions & 30 deletions tests/produce_opaque_noconf.phpt

This file was deleted.

4 changes: 2 additions & 2 deletions tests/produce_opaque_noflush.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ Produce with opaque, no flush
--SKIPIF--
<?php
require __DIR__ . '/integration-tests-check.php';
RD_KAFKA_BUILD_VERSION < 0x1000000 && die("skip librdkafka < 1.0.0");
?>
--FILE--
<?php
require __DIR__ . '/integration-tests-check.php';

$conf = new RdKafka\Conf();
if (RD_KAFKA_VERSION >= 0x090000 && false !== getenv('TEST_KAFKA_BROKER_VERSION')) {
if (false !== getenv('TEST_KAFKA_BROKER_VERSION')) {
$conf->set('broker.version.fallback', getenv('TEST_KAFKA_BROKER_VERSION'));
}
$conf->set('metadata.broker.list', getenv('TEST_KAFKA_BROKERS'));
Expand Down
4 changes: 2 additions & 2 deletions tests/produce_opaque_noflush_dr_callback.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ Produce with opaque, no flush, with delivery callback
--SKIPIF--
<?php
require __DIR__ . '/integration-tests-check.php';
RD_KAFKA_BUILD_VERSION < 0x1000000 && die("skip librdkafka < 1.0.0");
?>
--FILE--
<?php
require __DIR__ . '/integration-tests-check.php';

$conf = new RdKafka\Conf();
if (RD_KAFKA_VERSION >= 0x090000 && false !== getenv('TEST_KAFKA_BROKER_VERSION')) {
if (false !== getenv('TEST_KAFKA_BROKER_VERSION')) {
$conf->set('broker.version.fallback', getenv('TEST_KAFKA_BROKER_VERSION'));
}
$conf->set('metadata.broker.list', getenv('TEST_KAFKA_BROKERS'));
Expand Down
4 changes: 2 additions & 2 deletions tests/produce_opaque_purge.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ Produce with opaque, purge queued/inflight messages
--SKIPIF--
<?php
require __DIR__ . '/integration-tests-check.php';
RD_KAFKA_BUILD_VERSION < 0x1000000 && die("skip librdkafka < 1.0.0");
?>
--FILE--
<?php
require __DIR__ . '/integration-tests-check.php';

$conf = new RdKafka\Conf();
if (RD_KAFKA_VERSION >= 0x090000 && false !== getenv('TEST_KAFKA_BROKER_VERSION')) {
if (false !== getenv('TEST_KAFKA_BROKER_VERSION')) {
$conf->set('broker.version.fallback', getenv('TEST_KAFKA_BROKER_VERSION'));
}
$conf->set('metadata.broker.list', getenv('TEST_KAFKA_BROKERS'));
Expand Down
4 changes: 2 additions & 2 deletions tests/produce_opaque_purge_dr_callback.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ Produce with opaque, purge queued/inflight messages, with delivery callback
--SKIPIF--
<?php
require __DIR__ . '/integration-tests-check.php';
RD_KAFKA_BUILD_VERSION < 0x1000000 && die("skip librdkafka < 1.0.0");
?>
--FILE--
<?php
require __DIR__ . '/integration-tests-check.php';

$conf = new RdKafka\Conf();
if (RD_KAFKA_VERSION >= 0x090000 && false !== getenv('TEST_KAFKA_BROKER_VERSION')) {
if (false !== getenv('TEST_KAFKA_BROKER_VERSION')) {
$conf->set('broker.version.fallback', getenv('TEST_KAFKA_BROKER_VERSION'));
}
$conf->set('metadata.broker.list', getenv('TEST_KAFKA_BROKERS'));
Expand Down
4 changes: 2 additions & 2 deletions tests/producev_opaque.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ Producev with opaque
--SKIPIF--
<?php
require __DIR__ . '/integration-tests-check.php';
RD_KAFKA_BUILD_VERSION < 0x1000000 && die("skip librdkafka < 1.0.0");
?>
--FILE--
<?php
require __DIR__ . '/integration-tests-check.php';

$conf = new RdKafka\Conf();
if (RD_KAFKA_VERSION >= 0x090000 && false !== getenv('TEST_KAFKA_BROKER_VERSION')) {
if (false !== getenv('TEST_KAFKA_BROKER_VERSION')) {
$conf->set('broker.version.fallback', getenv('TEST_KAFKA_BROKER_VERSION'));
}
$conf->set('metadata.broker.list', getenv('TEST_KAFKA_BROKERS'));
Expand Down

0 comments on commit 962ef27

Please sign in to comment.