Skip to content

Commit

Permalink
fix Predis Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
PROFeNoM committed Jan 17, 2025
1 parent c3b825d commit f412b76
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 4 deletions.
11 changes: 11 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,7 @@ TEST_INTEGRATIONS_70 := \
test_integrations_phpredis3 \
test_integrations_phpredis4 \
test_integrations_phpredis5 \
test_integrations_predis_1 \
test_integrations_predis_latest \
test_integrations_sqlsrv

Expand Down Expand Up @@ -603,6 +604,7 @@ TEST_INTEGRATIONS_71 := \
test_integrations_phpredis3 \
test_integrations_phpredis4 \
test_integrations_phpredis5 \
test_integrations_predis_1 \
test_integrations_predis_latest \
test_integrations_sqlsrv \
test_opentracing_10
Expand Down Expand Up @@ -657,6 +659,7 @@ TEST_INTEGRATIONS_72 := \
test_integrations_phpredis3 \
test_integrations_phpredis4 \
test_integrations_phpredis5 \
test_integrations_predis_1 \
test_integrations_predis_latest \
test_integrations_sqlsrv \
test_opentracing_10
Expand Down Expand Up @@ -716,6 +719,7 @@ TEST_INTEGRATIONS_73 :=\
test_integrations_phpredis3 \
test_integrations_phpredis4 \
test_integrations_phpredis5 \
test_integrations_predis_1 \
test_integrations_predis_latest \
test_integrations_sqlsrv \
test_opentracing_10
Expand Down Expand Up @@ -776,6 +780,7 @@ TEST_INTEGRATIONS_74 := \
test_integrations_phpredis3 \
test_integrations_phpredis4 \
test_integrations_phpredis5 \
test_integrations_predis_1 \
test_integrations_predis_latest \
test_integrations_roadrunner \
test_integrations_sqlsrv \
Expand Down Expand Up @@ -841,6 +846,7 @@ TEST_INTEGRATIONS_80 := \
test_integrations_guzzle_latest \
test_integrations_pcntl \
test_integrations_phpredis5 \
test_integrations_predis_1 \
test_integrations_predis_latest \
test_integrations_sqlsrv \
test_integrations_swoole_5 \
Expand Down Expand Up @@ -895,6 +901,7 @@ TEST_INTEGRATIONS_81 := \
test_integrations_pdo \
test_integrations_elasticsearch7 \
test_integrations_phpredis5 \
test_integrations_predis_1 \
test_integrations_predis_latest \
test_integrations_sqlsrv \
test_integrations_swoole_5 \
Expand Down Expand Up @@ -951,6 +958,7 @@ TEST_INTEGRATIONS_82 := \
test_integrations_elasticsearch7 \
test_integrations_elasticsearch_latest \
test_integrations_phpredis5 \
test_integrations_predis_1 \
test_integrations_predis_latest \
test_integrations_frankenphp \
test_integrations_roadrunner \
Expand Down Expand Up @@ -1014,6 +1022,7 @@ TEST_INTEGRATIONS_83 := \
test_integrations_elasticsearch7 \
test_integrations_elasticsearch_latest \
test_integrations_phpredis5 \
test_integrations_predis_1 \
test_integrations_predis_latest \
test_integrations_frankenphp \
test_integrations_roadrunner \
Expand Down Expand Up @@ -1281,6 +1290,8 @@ test_integrations_phpredis5: global_test_run_dependencies
$(call run_tests_debug,tests/Integrations/PHPRedis/V5)
$(eval TEST_EXTRA_INI=)
$(eval TEST_EXTRA_ENV=)
test_integrations_predis_1: global_test_run_dependencies tests/Integrations/Predis/V1/composer.lock-php$(PHP_MAJOR_MINOR)
$(call run_tests_debug,tests/Integrations/Predis/V1)
test_integrations_predis_latest: global_test_run_dependencies tests/Integrations/Predis/Latest/composer.lock-php$(PHP_MAJOR_MINOR)
$(call run_tests_debug,tests/Integrations/Predis/Latest)
test_integrations_frankenphp: global_test_run_dependencies
Expand Down
8 changes: 4 additions & 4 deletions tests/Integrations/Predis/Latest/PredisTest.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<?php

namespace Integrations\Predis\Latest;
namespace DDTrace\Tests\Integrations\Predis\Latest;

use DDTrace\Tag;
use DDTrace\Tests\Common\IntegrationTestCase;
use DDTrace\Tests\Common\SpanAssertion;
use Predis\Configuration\Options;

final class PredisTest extends IntegrationTestCase
class PredisTest extends IntegrationTestCase
{
protected static $lockedResource = "redis";

private $host = 'redis_integration';
protected $host = 'redis_integration';
private $port = '6379';

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

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

Expand Down
7 changes: 7 additions & 0 deletions tests/Integrations/Predis/V1/PredisTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

namespace DDTrace\Tests\Integrations\Predis\V1;

class PredisTest extends \DDTrace\Tests\Integrations\Predis\Latest\PredisTest
{
}
5 changes: 5 additions & 0 deletions tests/Integrations/Predis/V1/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"require": {
"predis/predis": "^1"
}
}

0 comments on commit f412b76

Please sign in to comment.