summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2021-09-10 15:14:31 +0200
committerRemi Collet <remi@remirepo.net>2021-09-10 15:14:31 +0200
commitfedee1f311abc7f99158b6f161d2aa99f1f66de2 (patch)
tree6c9e401f5f555dfe07bf634b30a53843c679efe2
parent9e21b6e42274425900db59f748f1721b884cf297 (diff)
run upstream test suite during the buildHEADmaster
(lot of tests are skipped as no configured server)
-rw-r--r--integration-tests-check.php11
-rw-r--r--php-pecl-rdkafka5.spec15
2 files changed, 25 insertions, 1 deletions
diff --git a/integration-tests-check.php b/integration-tests-check.php
new file mode 100644
index 0000000..24f5b89
--- /dev/null
+++ b/integration-tests-check.php
@@ -0,0 +1,11 @@
+<?php
+
+if (file_exists(__DIR__ . "/test_env.php")) {
+ include __DIR__ . '/test_env.php';
+}
+
+if (getenv('TEST_KAFKA_BROKERS')) {
+ return;
+}
+
+die('skip due to missing TEST_KAFKA_BROKERS environment & no test_env.php');
diff --git a/php-pecl-rdkafka5.spec b/php-pecl-rdkafka5.spec
index f161bfb..930a5f9 100644
--- a/php-pecl-rdkafka5.spec
+++ b/php-pecl-rdkafka5.spec
@@ -21,11 +21,12 @@
Summary: Kafka client based on librdkafka
Name: %{?sub_prefix}php-pecl-%{pecl_name}5
Version: 5.0.0
-Release: 3%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}
+Release: 4%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}
License: MIT
URL: https://pecl.php.net/package/%{pecl_name}
Source0: https://pecl.php.net/get/%{pecl_name}-%{version}.tgz
+Source1: https://raw.githubusercontent.com/arnaud-lb/php-rdkafka/%{version}/tests/integration-tests-check.php
Patch0: %{pecl_name}-php81.patch
BuildRequires: make
@@ -95,6 +96,7 @@ sed -e 's/role="test"/role="src"/' \
cd NTS
%patch0 -p1
+cp %{SOURCE1} tests
# Sanity check, really often broken
extver=$(sed -n '/#define PHP_RDKAFKA_VERSION/{s/.* "//;s/".*$//;p}' php_rdkafka.h)
@@ -194,6 +196,13 @@ cd ../ZTS
--modules | grep '^%{pecl_name}$'
%endif
+: Upstream test suite for NTS extension
+cd ../NTS
+TEST_PHP_EXECUTABLE=%{__php} \
+TEST_PHP_ARGS="-n -d extension=$PWD/modules/%{pecl_name}.so" \
+REPORT_EXIT_STATUS=1 \
+%{__php} -n run-tests.php -q --show-diff
+
%files
%{?_licensedir:%license NTS/LICENSE}
@@ -210,6 +219,10 @@ cd ../ZTS
%changelog
+* Fri Sep 10 2021 Remi Collet <remi@remirepo.net> - 5.0.0-4
+- run upstream test suite during the build
+ (lot of tests are skipped as no configured server)
+
* Fri Sep 10 2021 Remi Collet <remi@remirepo.net> - 5.0.0-3
- add fix for PHP 8.1 from upstream and from
https://github.com/arnaud-lb/php-rdkafka/pull/467