Skip to content

Commit f157156

Browse files
chore: update latest versions (#3065)
* chore: update latest versions * tests: Latest Predis Version * tests: Setup `test_integrations_predis_[1|latest]` * fix: Replace object key by Predis Connection --------- Co-authored-by: PROFeNoM <[email protected]> Co-authored-by: Alexandre Choura <[email protected]>
1 parent c11372f commit f157156

File tree

10 files changed

+44
-15
lines changed

10 files changed

+44
-15
lines changed

Makefile

+11-2
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ TEST_INTEGRATIONS_70 := \
560560
test_integrations_phpredis3 \
561561
test_integrations_phpredis4 \
562562
test_integrations_phpredis5 \
563-
test_integrations_predis_latest \
563+
test_integrations_predis_1 \
564564
test_integrations_sqlsrv
565565

566566
TEST_WEB_70 := \
@@ -602,7 +602,7 @@ TEST_INTEGRATIONS_71 := \
602602
test_integrations_phpredis3 \
603603
test_integrations_phpredis4 \
604604
test_integrations_phpredis5 \
605-
test_integrations_predis_latest \
605+
test_integrations_predis_1 \
606606
test_integrations_sqlsrv \
607607
test_opentracing_10
608608

@@ -655,6 +655,7 @@ TEST_INTEGRATIONS_72 := \
655655
test_integrations_phpredis3 \
656656
test_integrations_phpredis4 \
657657
test_integrations_phpredis5 \
658+
test_integrations_predis_1 \
658659
test_integrations_predis_latest \
659660
test_integrations_sqlsrv \
660661
test_opentracing_10
@@ -714,6 +715,7 @@ TEST_INTEGRATIONS_73 :=\
714715
test_integrations_phpredis3 \
715716
test_integrations_phpredis4 \
716717
test_integrations_phpredis5 \
718+
test_integrations_predis_1 \
717719
test_integrations_predis_latest \
718720
test_integrations_sqlsrv \
719721
test_opentracing_10
@@ -774,6 +776,7 @@ TEST_INTEGRATIONS_74 := \
774776
test_integrations_phpredis3 \
775777
test_integrations_phpredis4 \
776778
test_integrations_phpredis5 \
779+
test_integrations_predis_1 \
777780
test_integrations_predis_latest \
778781
test_integrations_roadrunner \
779782
test_integrations_sqlsrv \
@@ -839,6 +842,7 @@ TEST_INTEGRATIONS_80 := \
839842
test_integrations_guzzle_latest \
840843
test_integrations_pcntl \
841844
test_integrations_phpredis5 \
845+
test_integrations_predis_1 \
842846
test_integrations_predis_latest \
843847
test_integrations_sqlsrv \
844848
test_integrations_swoole_5 \
@@ -892,6 +896,7 @@ TEST_INTEGRATIONS_81 := \
892896
test_integrations_pdo \
893897
test_integrations_elasticsearch7 \
894898
test_integrations_phpredis5 \
899+
test_integrations_predis_1 \
895900
test_integrations_predis_latest \
896901
test_integrations_sqlsrv \
897902
test_integrations_swoole_5 \
@@ -949,6 +954,7 @@ TEST_INTEGRATIONS_82 := \
949954
test_integrations_elasticsearch7 \
950955
test_integrations_elasticsearch_latest \
951956
test_integrations_phpredis5 \
957+
test_integrations_predis_1 \
952958
test_integrations_predis_latest \
953959
test_integrations_frankenphp \
954960
test_integrations_roadrunner \
@@ -1012,6 +1018,7 @@ TEST_INTEGRATIONS_83 := \
10121018
test_integrations_elasticsearch7 \
10131019
test_integrations_elasticsearch_latest \
10141020
test_integrations_phpredis5 \
1021+
test_integrations_predis_1 \
10151022
test_integrations_predis_latest \
10161023
test_integrations_frankenphp \
10171024
test_integrations_roadrunner \
@@ -1281,6 +1288,8 @@ test_integrations_phpredis5: global_test_run_dependencies
12811288
$(call run_tests_debug,tests/Integrations/PHPRedis/V5)
12821289
$(eval TEST_EXTRA_INI=)
12831290
$(eval TEST_EXTRA_ENV=)
1291+
test_integrations_predis_1: global_test_run_dependencies tests/Integrations/Predis/V1/composer.lock-php$(PHP_MAJOR_MINOR)
1292+
$(call run_tests_debug,tests/Integrations/Predis/V1)
12841293
test_integrations_predis_latest: global_test_run_dependencies tests/Integrations/Predis/Latest/composer.lock-php$(PHP_MAJOR_MINOR)
12851294
$(call run_tests_debug,tests/Integrations/Predis/Latest)
12861295
test_integrations_frankenphp: global_test_run_dependencies

src/DDTrace/Integrations/Predis/PredisIntegration.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public function init(): int
105105
$span->name = 'Predis.Pipeline.executePipeline';
106106
$span->resource = $span->name;
107107
$span->type = Type::REDIS;
108-
PredisIntegration::setMetaAndServiceFromConnection($this, $span);
108+
PredisIntegration::setMetaAndServiceFromConnection($this->getClient(), $span);
109109
if (\count($args) < 2) {
110110
return;
111111
}
@@ -161,8 +161,8 @@ public static function storeConnectionMetaAndService($predis, $args)
161161
}
162162
}
163163

164-
ObjectKVStore::put($predis, 'service', $service);
165-
ObjectKVStore::put($predis, 'connection_meta', $tags);
164+
ObjectKVStore::put($predis->getConnection(), 'service', $service);
165+
ObjectKVStore::put($predis->getConnection(), 'connection_meta', $tags);
166166
}
167167

168168
/**
@@ -175,12 +175,12 @@ public static function storeConnectionMetaAndService($predis, $args)
175175
*/
176176
public static function setMetaAndServiceFromConnection($predis, SpanData $span)
177177
{
178-
$span->service = ObjectKVStore::get($predis, 'service', PredisIntegration::DEFAULT_SERVICE_NAME);
178+
$span->service = ObjectKVStore::get($predis->getConnection(), 'service', PredisIntegration::DEFAULT_SERVICE_NAME);
179179
$span->meta[Tag::SPAN_KIND] = 'client';
180180
$span->meta[Tag::COMPONENT] = PredisIntegration::NAME;
181181
$span->meta[Tag::DB_SYSTEM] = PredisIntegration::SYSTEM;
182182

183-
foreach (ObjectKVStore::get($predis, 'connection_meta', []) as $tag => $value) {
183+
foreach (ObjectKVStore::get($predis->getConnection(), 'connection_meta', []) as $tag => $value) {
184184
$span->meta[$tag] = $value;
185185
}
186186
}

tests/Frameworks/Laravel/Latest/composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"license": "MIT",
1010
"require": {
1111
"php": "^8.2",
12-
"laravel/framework": "11.39.1",
12+
"laravel/framework": "11.41.3",
1313
"laravel/tinker": "^2.9"
1414
},
1515
"require-dev": {

tests/Frameworks/Laravel/Octane/Latest/composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"require": {
1111
"php": "^8.2",
1212
"laravel/framework": "^11.0",
13-
"laravel/octane": "2.6.0",
13+
"laravel/octane": "2.6.1",
1414
"laravel/tinker": "^2.9"
1515
},
1616
"require-dev": {

tests/Frameworks/Symfony/Latest/composer.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
"symfony/dotenv": "*",
1919
"symfony/flex": "^2",
2020
"symfony/form": "*",
21-
"symfony/framework-bundle": "7.2.2",
22-
"symfony/messenger": "7.2.1",
21+
"symfony/framework-bundle": "7.2.3",
22+
"symfony/messenger": "7.2.3",
2323
"symfony/monolog-bundle": "^3.10",
2424
"symfony/property-access": "*",
2525
"symfony/property-info": "*",
@@ -93,4 +93,4 @@
9393
"require-dev": {
9494
"symfony/maker-bundle": "^1.49"
9595
}
96-
}
96+
}

tests/Integrations/GoogleSpanner/Latest/composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"require": {
3-
"google/cloud-spanner": "1.92.0"
3+
"google/cloud-spanner": "1.92.1"
44
},
55
"provide": {
66
"ext-grpc": "*"

tests/Integrations/Predis/Latest/PredisTest.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -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

@@ -251,6 +251,8 @@ public function testPredisPipeline()
251251
Tag::COMPONENT => 'predis',
252252
Tag::DB_SYSTEM => 'redis',
253253
'redis.pipeline_length' => '2',
254+
Tag::TARGET_HOST => $this->host,
255+
Tag::TARGET_PORT => $this->port,
254256
];
255257

256258
$this->assertFlameGraph($traces, [
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"require": {
3-
"predis/predis": "1.1.10"
3+
"predis/predis": "2.3.0"
44
}
55
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
namespace DDTrace\Tests\Integrations\Predis\V1;
4+
5+
use DDTrace\Tag;
6+
use DDTrace\Tests\Common\IntegrationTestCase;
7+
use DDTrace\Tests\Common\SpanAssertion;
8+
use Predis\Configuration\Options;
9+
10+
class PredisTest extends \DDTrace\Tests\Integrations\Predis\Latest\PredisTest
11+
{
12+
//
13+
}
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)