Skip to content

Commit f412b76

Browse files
committed
fix Predis Tests
1 parent c3b825d commit f412b76

File tree

4 files changed

+27
-4
lines changed

4 files changed

+27
-4
lines changed

Makefile

+11
Original file line numberDiff line numberDiff line change
@@ -560,6 +560,7 @@ TEST_INTEGRATIONS_70 := \
560560
test_integrations_phpredis3 \
561561
test_integrations_phpredis4 \
562562
test_integrations_phpredis5 \
563+
test_integrations_predis_1 \
563564
test_integrations_predis_latest \
564565
test_integrations_sqlsrv
565566

@@ -603,6 +604,7 @@ TEST_INTEGRATIONS_71 := \
603604
test_integrations_phpredis3 \
604605
test_integrations_phpredis4 \
605606
test_integrations_phpredis5 \
607+
test_integrations_predis_1 \
606608
test_integrations_predis_latest \
607609
test_integrations_sqlsrv \
608610
test_opentracing_10
@@ -657,6 +659,7 @@ TEST_INTEGRATIONS_72 := \
657659
test_integrations_phpredis3 \
658660
test_integrations_phpredis4 \
659661
test_integrations_phpredis5 \
662+
test_integrations_predis_1 \
660663
test_integrations_predis_latest \
661664
test_integrations_sqlsrv \
662665
test_opentracing_10
@@ -716,6 +719,7 @@ TEST_INTEGRATIONS_73 :=\
716719
test_integrations_phpredis3 \
717720
test_integrations_phpredis4 \
718721
test_integrations_phpredis5 \
722+
test_integrations_predis_1 \
719723
test_integrations_predis_latest \
720724
test_integrations_sqlsrv \
721725
test_opentracing_10
@@ -776,6 +780,7 @@ TEST_INTEGRATIONS_74 := \
776780
test_integrations_phpredis3 \
777781
test_integrations_phpredis4 \
778782
test_integrations_phpredis5 \
783+
test_integrations_predis_1 \
779784
test_integrations_predis_latest \
780785
test_integrations_roadrunner \
781786
test_integrations_sqlsrv \
@@ -841,6 +846,7 @@ TEST_INTEGRATIONS_80 := \
841846
test_integrations_guzzle_latest \
842847
test_integrations_pcntl \
843848
test_integrations_phpredis5 \
849+
test_integrations_predis_1 \
844850
test_integrations_predis_latest \
845851
test_integrations_sqlsrv \
846852
test_integrations_swoole_5 \
@@ -895,6 +901,7 @@ TEST_INTEGRATIONS_81 := \
895901
test_integrations_pdo \
896902
test_integrations_elasticsearch7 \
897903
test_integrations_phpredis5 \
904+
test_integrations_predis_1 \
898905
test_integrations_predis_latest \
899906
test_integrations_sqlsrv \
900907
test_integrations_swoole_5 \
@@ -951,6 +958,7 @@ TEST_INTEGRATIONS_82 := \
951958
test_integrations_elasticsearch7 \
952959
test_integrations_elasticsearch_latest \
953960
test_integrations_phpredis5 \
961+
test_integrations_predis_1 \
954962
test_integrations_predis_latest \
955963
test_integrations_frankenphp \
956964
test_integrations_roadrunner \
@@ -1014,6 +1022,7 @@ TEST_INTEGRATIONS_83 := \
10141022
test_integrations_elasticsearch7 \
10151023
test_integrations_elasticsearch_latest \
10161024
test_integrations_phpredis5 \
1025+
test_integrations_predis_1 \
10171026
test_integrations_predis_latest \
10181027
test_integrations_frankenphp \
10191028
test_integrations_roadrunner \
@@ -1281,6 +1290,8 @@ test_integrations_phpredis5: global_test_run_dependencies
12811290
$(call run_tests_debug,tests/Integrations/PHPRedis/V5)
12821291
$(eval TEST_EXTRA_INI=)
12831292
$(eval TEST_EXTRA_ENV=)
1293+
test_integrations_predis_1: global_test_run_dependencies tests/Integrations/Predis/V1/composer.lock-php$(PHP_MAJOR_MINOR)
1294+
$(call run_tests_debug,tests/Integrations/Predis/V1)
12841295
test_integrations_predis_latest: global_test_run_dependencies tests/Integrations/Predis/Latest/composer.lock-php$(PHP_MAJOR_MINOR)
12851296
$(call run_tests_debug,tests/Integrations/Predis/Latest)
12861297
test_integrations_frankenphp: global_test_run_dependencies

tests/Integrations/Predis/Latest/PredisTest.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
<?php
22

3-
namespace Integrations\Predis\Latest;
3+
namespace DDTrace\Tests\Integrations\Predis\Latest;
44

55
use DDTrace\Tag;
66
use DDTrace\Tests\Common\IntegrationTestCase;
77
use DDTrace\Tests\Common\SpanAssertion;
88
use Predis\Configuration\Options;
99

10-
final class PredisTest extends IntegrationTestCase
10+
class PredisTest extends IntegrationTestCase
1111
{
1212
protected static $lockedResource = "redis";
1313

14-
private $host = 'redis_integration';
14+
protected $host = 'redis_integration';
1515
private $port = '6379';
1616

1717
public static function ddSetUpBeforeClass()
@@ -166,7 +166,7 @@ public function testPredisClusterConnect()
166166
$connectionString = "tcp://{$this->host}";
167167

168168
$traces = $this->isolateTracer(function () use ($connectionString) {
169-
$client = new \Predis\Client([$connectionString, $connectionString, $connectionString]);
169+
$client = new \Predis\Client([$connectionString, $connectionString, $connectionString], ['cluster' => 'redis']);
170170
$client->connect();
171171
});
172172

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?php
2+
3+
namespace DDTrace\Tests\Integrations\Predis\V1;
4+
5+
class PredisTest extends \DDTrace\Tests\Integrations\Predis\Latest\PredisTest
6+
{
7+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"require": {
3+
"predis/predis": "^1"
4+
}
5+
}

0 commit comments

Comments
 (0)