Skip to content

Commit 0a38276

Browse files
chore: update latest versions (#3396)
* chore: update latest versions * chore: update openai test snapshots with new error line numbers * chore: update symfony test snapshots * chore: update line numbers in Symfony test snapshots * tests: add rate limit exception handling to OpenAI integration test * feat: add rate limit error type handling for OpenAI exceptions * test: update line numbers in Symfony test snapshots to match latest framework version * test: update OpenAI test error type from ErrorException to RateLimitException * test: update line numbers in Symfony test snapshots to match latest vendor code * test: update line numbers in symfony messenger test snapshots --------- Co-authored-by: PROFeNoM <[email protected]> Co-authored-by: Alexandre Choura <[email protected]>
1 parent c1cb023 commit 0a38276

16 files changed

+50
-46
lines changed

src/DDTrace/Integrations/OpenAI/OpenAIIntegration.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -645,6 +645,8 @@ public static function sendMetrics(
645645
$errorType = null;
646646
if ($span->exception instanceof \OpenAI\Exceptions\ErrorException) {
647647
$errorType = $span->exception->getErrorType() ?? $span->exception->getErrorCode() ?? null;
648+
} elseif ($span->exception instanceof \OpenAI\Exceptions\RateLimitException) {
649+
$errorType = 'rate_limit_exceeded';
648650
} elseif ($span->exception) {
649651
$errorType = \get_class($span->exception);
650652
}

tests/Frameworks/CakePHP/Latest/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"license": "MIT",
77
"require": {
88
"php": ">=8.1",
9-
"cakephp/cakephp": "5.2.6",
9+
"cakephp/cakephp": "5.2.7",
1010
"cakephp/migrations": "^4.0.0",
1111
"cakephp/plugin-installer": "^2.0",
1212
"mobiledetect/mobiledetectlib": "^3.74"

tests/Frameworks/Laravel/Latest/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"license": "MIT",
1010
"require": {
1111
"php": "^8.2",
12-
"laravel/framework": "12.25.0",
12+
"laravel/framework": "12.26.4",
1313
"laravel/tinker": "^2.9"
1414
},
1515
"require-dev": {

tests/Frameworks/Symfony/Latest/composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@
1313
"doctrine/orm": "^2.17",
1414
"phpdocumentor/reflection-docblock": "^5.6",
1515
"phpstan/phpdoc-parser": "^2.0",
16-
"symfony/console": "7.3.2",
16+
"symfony/console": "7.3.3",
1717
"symfony/doctrine-messenger": "^7.1",
1818
"symfony/dotenv": "*",
1919
"symfony/flex": "^2",
2020
"symfony/form": "*",
21-
"symfony/framework-bundle": "7.3.2",
22-
"symfony/messenger": "7.3.2",
21+
"symfony/framework-bundle": "7.3.3",
22+
"symfony/messenger": "7.3.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/OpenAI/Latest/OpenAITest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ private function call($resource, $openAIFn, $metaHeaders, $responseBodyArray, $o
8484
}
8585
} catch (\OpenAI\Exceptions\ErrorException $e) {
8686
// Ignore exceptions, they're "expected"
87+
} catch (\OpenAI\Exceptions\RateLimitException $e) {
88+
// Ignore exceptions, they're "expected"
8789
}
8890
}, snapshotMetrics: true, logsFile: __DIR__ . "/openai.log");
8991
}

tests/Integrations/OpenAI/Latest/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"require": {
3-
"openai-php/client": "0.15.0",
3+
"openai-php/client": "0.16.0",
44
"guzzlehttp/guzzle": "^7.8.1",
55
"guzzlehttp/psr7": "^2.6.2"
66
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
openai.request.duration:262041|d|#env:test,service:openai-test,version:1.0,env:test,service:openai-test,version:1.0,openai.user.api_key:sk-...9d5d,openai.request.endpoint:/v1/models,openai.request.error:1,error_type:quota_exceeded
2-
openai.request.error:1|c|#env:test,service:openai-test,version:1.0,env:test,service:openai-test,version:1.0,openai.user.api_key:sk-...9d5d,openai.request.endpoint:/v1/models,openai.request.error:1,error_type:quota_exceeded
1+
openai.request.duration:262041|d|#env:test,service:openai-test,version:1.0,env:test,service:openai-test,version:1.0,openai.user.api_key:sk-...9d5d,openai.request.endpoint:/v1/models,openai.request.error:1,error_type:rate_limit_exceeded
2+
openai.request.error:1|c|#env:test,service:openai-test,version:1.0,env:test,service:openai-test,version:1.0,openai.user.api_key:sk-...9d5d,openai.request.endpoint:/v1/models,openai.request.error:1,error_type:rate_limit_exceeded

tests/snapshots/tests.integrations.cli.symfony.latest.common_scenarios_test.test_silenced_spans_are_dropped.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
"_dd.code_origin.frames.2.method": "doRun",
8686
"_dd.code_origin.frames.2.type": "Symfony\\Bundle\\FrameworkBundle\\Console\\Application",
8787
"_dd.code_origin.frames.3.file": "{path}/tests/Frameworks/Symfony/Latest/vendor/symfony/console/Application.php",
88-
"_dd.code_origin.frames.3.line": "192",
88+
"_dd.code_origin.frames.3.line": "194",
8989
"_dd.code_origin.frames.3.method": "run",
9090
"_dd.code_origin.frames.3.type": "Symfony\\Component\\Console\\Application",
9191
"_dd.code_origin.frames.4.file": "{path}/tests/Frameworks/Symfony/Latest/vendor/symfony/runtime/Runner/Symfony/ConsoleApplicationRunner.php",
@@ -110,23 +110,23 @@
110110
"type": "system",
111111
"meta": {
112112
"_dd.code_origin.frames.0.file": "{path}/tests/Frameworks/Symfony/Latest/vendor/symfony/console/Application.php",
113-
"_dd.code_origin.frames.0.line": "999",
113+
"_dd.code_origin.frames.0.line": "1017",
114114
"_dd.code_origin.frames.0.method": "doRunCommand",
115115
"_dd.code_origin.frames.0.type": "Symfony\\Component\\Console\\Application",
116116
"_dd.code_origin.frames.1.file": "{path}/tests/Frameworks/Symfony/Latest/vendor/symfony/framework-bundle/Console/Application.php",
117117
"_dd.code_origin.frames.1.line": "123",
118118
"_dd.code_origin.frames.1.method": "doRunCommand",
119119
"_dd.code_origin.frames.1.type": "Symfony\\Bundle\\FrameworkBundle\\Console\\Application",
120120
"_dd.code_origin.frames.2.file": "{path}/tests/Frameworks/Symfony/Latest/vendor/symfony/console/Application.php",
121-
"_dd.code_origin.frames.2.line": "341",
121+
"_dd.code_origin.frames.2.line": "359",
122122
"_dd.code_origin.frames.2.method": "doRun",
123123
"_dd.code_origin.frames.2.type": "Symfony\\Component\\Console\\Application",
124124
"_dd.code_origin.frames.3.file": "{path}/tests/Frameworks/Symfony/Latest/vendor/symfony/framework-bundle/Console/Application.php",
125125
"_dd.code_origin.frames.3.line": "77",
126126
"_dd.code_origin.frames.3.method": "doRun",
127127
"_dd.code_origin.frames.3.type": "Symfony\\Bundle\\FrameworkBundle\\Console\\Application",
128128
"_dd.code_origin.frames.4.file": "{path}/tests/Frameworks/Symfony/Latest/vendor/symfony/console/Application.php",
129-
"_dd.code_origin.frames.4.line": "192",
129+
"_dd.code_origin.frames.4.line": "194",
130130
"_dd.code_origin.frames.4.method": "run",
131131
"_dd.code_origin.frames.4.type": "Symfony\\Component\\Console\\Application",
132132
"_dd.code_origin.frames.5.file": "{path}/tests/Frameworks/Symfony/Latest/vendor/symfony/runtime/Runner/Symfony/ConsoleApplicationRunner.php",

tests/snapshots/tests.integrations.open_ai.open_ai_test.test_create_completions_with_multiple_error_messages.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"_dd.p.dm": "0",
1313
"_dd.p.tid": "681cb52300000000",
1414
"env": "test",
15-
"error.message": "Uncaught OpenAI\\Exceptions\\ErrorException: Invalid schema for function 'get_current_weather':\nIn context=('properties', 'location'), array schema missing items in {path}/tests/Integrations/OpenAI/Latest/vendor/openai-php/client/src/Transporters/HttpTransporter.php:133",
15+
"error.message": "Uncaught OpenAI\\Exceptions\\ErrorException: Invalid schema for function 'get_current_weather':\nIn context=('properties', 'location'), array schema missing items in {path}/tests/Integrations/OpenAI/Latest/vendor/openai-php/client/src/Transporters/HttpTransporter.php:169",
1616
"error.stack": "#0 {path}/tests/Integrations/OpenAI/Latest/vendor/openai-php/client/src/Transporters/HttpTransporter.php(57): OpenAI\\Transporters\\HttpTransporter->throwIfJsonError()\n#1 {path}/tests/Integrations/OpenAI/Latest/vendor/openai-php/client/src/Resources/Completions.php(33): OpenAI\\Transporters\\HttpTransporter->requestObject()\n#2 {path}/tests/Integrations/OpenAI/Latest/OpenAITest.php(81): OpenAI\\Resources\\Completions->create()\n#3 {path}/tests/Common/SnapshotTestTrait.php(346): DDTrace\\Tests\\Integrations\\OpenAI\\OpenAITest->DDTrace\\Tests\\Integrations\\OpenAI\\{closure}()\n#4 {path}/tests/Integrations/OpenAI/Latest/OpenAITest.php(76): DDTrace\\Tests\\Common\\IntegrationTestCase->isolateTracerSnapshot()\n#5 {path}/tests/Integrations/OpenAI/Latest/OpenAITest.php(468): DDTrace\\Tests\\Integrations\\OpenAI\\OpenAITest->call()\n#6 {path}/tests/vendor/phpunit/phpunit/src/Framework/TestCase.php(1617): DDTrace\\Tests\\Integrations\\OpenAI\\OpenAITest->testCreateCompletionsWithMultipleErrorMessages()\n#7 {path}/tests/vendor/phpunit/phpunit/src/Framework/TestCase.php(1223): PHPUnit\\Framework\\TestCase->runTest()\n#8 {path}/tests/Common/RetryTraitVersionGeneric.php(28): PHPUnit\\Framework\\TestCase->runBare()\n#9 {path}/tests/vendor/phpunit/phpunit/src/Framework/TestResult.php(729): DDTrace\\Tests\\Common\\IntegrationTestCase->runBare()\n#10 {path}/tests/vendor/phpunit/phpunit/src/Framework/TestCase.php(973): PHPUnit\\Framework\\TestResult->run()\n#11 {path}/tests/vendor/phpunit/phpunit/src/Framework/TestSuite.php(685): PHPUnit\\Framework\\TestCase->run()\n#12 {path}/tests/vendor/phpunit/phpunit/src/Framework/TestSuite.php(685): PHPUnit\\Framework\\TestSuite->run()\n#13 {path}/tests/vendor/phpunit/phpunit/src/TextUI/TestRunner.php(651): PHPUnit\\Framework\\TestSuite->run()\n#14 {path}/tests/vendor/phpunit/phpunit/src/TextUI/Command.php(146): PHPUnit\\TextUI\\TestRunner->run()\n#15 {path}/tests/vendor/phpunit/phpunit/src/TextUI/Command.php(99): PHPUnit\\TextUI\\Command->run()\n#16 {path}/tests/vendor/phpunit/phpunit/phpunit(107): PHPUnit\\TextUI\\Command::main()\n#17 {path}/tests/vendor/bin/phpunit(122): include()\n#18 {main}",
1717
"error.type": "OpenAI\\Exceptions\\ErrorException",
1818
"openai.api_base": "https://api.openai.com/v1/",

tests/snapshots/tests.integrations.open_ai.open_ai_test.test_list_models_with_error.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"_dd.p.dm": "0",
1313
"_dd.p.tid": "681cb4f800000000",
1414
"env": "test",
15-
"error.message": "Uncaught OpenAI\\Exceptions\\ErrorException: Incorrect API key provided: foo. You can find your API key at https://platform.openai.com. in {path}/tests/Integrations/OpenAI/Latest/vendor/openai-php/client/src/Transporters/HttpTransporter.php:133",
15+
"error.message": "Uncaught OpenAI\\Exceptions\\ErrorException: Incorrect API key provided: foo. You can find your API key at https://platform.openai.com. in {path}/tests/Integrations/OpenAI/Latest/vendor/openai-php/client/src/Transporters/HttpTransporter.php:169",
1616
"error.stack": "#0 {path}/tests/Integrations/OpenAI/Latest/vendor/openai-php/client/src/Transporters/HttpTransporter.php(57): OpenAI\\Transporters\\HttpTransporter->throwIfJsonError()\n#1 {path}/tests/Integrations/OpenAI/Latest/vendor/openai-php/client/src/Resources/Models.php(28): OpenAI\\Transporters\\HttpTransporter->requestObject()\n#2 {path}/tests/Integrations/OpenAI/Latest/OpenAITest.php(83): OpenAI\\Resources\\Models->list()\n#3 {path}/tests/Common/SnapshotTestTrait.php(346): DDTrace\\Tests\\Integrations\\OpenAI\\OpenAITest->DDTrace\\Tests\\Integrations\\OpenAI\\{closure}()\n#4 {path}/tests/Integrations/OpenAI/Latest/OpenAITest.php(76): DDTrace\\Tests\\Common\\IntegrationTestCase->isolateTracerSnapshot()\n#5 {path}/tests/Integrations/OpenAI/Latest/OpenAITest.php(463): DDTrace\\Tests\\Integrations\\OpenAI\\OpenAITest->call()\n#6 {path}/tests/vendor/phpunit/phpunit/src/Framework/TestCase.php(1617): DDTrace\\Tests\\Integrations\\OpenAI\\OpenAITest->testListModelsWithError()\n#7 {path}/tests/vendor/phpunit/phpunit/src/Framework/TestCase.php(1223): PHPUnit\\Framework\\TestCase->runTest()\n#8 {path}/tests/Common/RetryTraitVersionGeneric.php(28): PHPUnit\\Framework\\TestCase->runBare()\n#9 {path}/tests/vendor/phpunit/phpunit/src/Framework/TestResult.php(729): DDTrace\\Tests\\Common\\IntegrationTestCase->runBare()\n#10 {path}/tests/vendor/phpunit/phpunit/src/Framework/TestCase.php(973): PHPUnit\\Framework\\TestResult->run()\n#11 {path}/tests/vendor/phpunit/phpunit/src/Framework/TestSuite.php(685): PHPUnit\\Framework\\TestCase->run()\n#12 {path}/tests/vendor/phpunit/phpunit/src/Framework/TestSuite.php(685): PHPUnit\\Framework\\TestSuite->run()\n#13 {path}/tests/vendor/phpunit/phpunit/src/TextUI/TestRunner.php(651): PHPUnit\\Framework\\TestSuite->run()\n#14 {path}/tests/vendor/phpunit/phpunit/src/TextUI/Command.php(146): PHPUnit\\TextUI\\TestRunner->run()\n#15 {path}/tests/vendor/phpunit/phpunit/src/TextUI/Command.php(99): PHPUnit\\TextUI\\Command->run()\n#16 {path}/tests/vendor/phpunit/phpunit/phpunit(107): PHPUnit\\TextUI\\Command::main()\n#17 {path}/tests/vendor/bin/phpunit(122): include()\n#18 {main}",
1717
"error.type": "OpenAI\\Exceptions\\ErrorException",
1818
"openai.api_base": "https://api.openai.com/v1/",

0 commit comments

Comments
 (0)