Skip to content

Commit 34ef11e

Browse files
committed
Fix tests: our new version doesn't support old symfony versions
1 parent 8eb1101 commit 34ef11e

File tree

12 files changed

+26
-21
lines changed

12 files changed

+26
-21
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1543,7 +1543,7 @@ test_web_symfony_42: global_test_run_dependencies tests/Frameworks/Symfony/Versi
15431543
php tests/Frameworks/Symfony/Version_4_2/bin/console cache:clear --no-warmup --env=prod
15441544
$(call run_tests_debug,tests/Integrations/Symfony/V4_2)
15451545
test_web_symfony_44: global_test_run_dependencies tests/Frameworks/Symfony/Version_4_4/composer.lock-php$(PHP_MAJOR_MINOR)
1546-
php tests/Frameworks/Symfony/Version_4_4/bin/console cache:clear --no-warmup --env=prod
1546+
php tests/Frameworks/Symfony/Version_4_4/bin/console cache:clear --env=prod
15471547
$(call run_tests_debug,--testsuite=symfony-44-test)
15481548
test_web_symfony_50: global_test_run_dependencies
15491549
$(COMPOSER) --working-dir=tests/Frameworks/Symfony/Version_5_0 install # EOL; install from lock

src/DDTrace/Integrations/Symfony/EndpointCatalog.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,14 @@ public static function pathForRoute($routeName, ContainerInterface $container)
4444
return null;
4545
}
4646

47-
$genFile = rtrim($cacheDir, '/\\') . DIRECTORY_SEPARATOR . 'url_generating_routes.php';
47+
$base = rtrim($cacheDir, '/\\') . DIRECTORY_SEPARATOR;
48+
// Symfony 5+ uses url_generating_routes.php; 4.3–4.4 uses UrlGenerator.php
49+
$genFile = $base . 'url_generating_routes.php';
4850
if (!is_file($genFile)) {
49-
return null;
51+
$genFile = $base . 'UrlGenerator.php';
52+
if (!is_file($genFile)) {
53+
return null;
54+
}
5055
}
5156

5257
$gen = require $genFile;

tests/Integrations/Symfony/V3_3/CommonScenariosTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public function provideSpecs()
5252
)->withExactTags([
5353
'symfony.route.action' => 'AppBundle\Controller\CommonScenariosController@simpleAction',
5454
'symfony.route.name' => 'simple',
55-
'http.route' => '/simple',
55+
5656
'http.method' => 'GET',
5757
'http.url' => 'http://localhost/simple?key=value&<redacted>',
5858
'http.status_code' => '200',
@@ -91,7 +91,7 @@ public function provideSpecs()
9191
)->withExactTags([
9292
'symfony.route.action' => 'AppBundle\Controller\CommonScenariosController@simpleViewAction',
9393
'symfony.route.name' => 'simple_view',
94-
'http.route' => '/simple_view',
94+
9595
'http.method' => 'GET',
9696
'http.url' => 'http://localhost/simple_view?key=value&<redacted>',
9797
'http.status_code' => '200',
@@ -139,7 +139,7 @@ public function provideSpecs()
139139
)->withExactTags([
140140
'symfony.route.action' => 'AppBundle\Controller\CommonScenariosController@errorAction',
141141
'symfony.route.name' => 'error',
142-
'http.route' => '/error',
142+
143143
'http.method' => 'GET',
144144
'http.url' => 'http://localhost/error?key=value&<redacted>',
145145
'http.status_code' => '500',

tests/Integrations/Symfony/V3_3/TraceSearchConfigTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function testScenario()
4242
)->withExactTags([
4343
'symfony.route.action' => 'AppBundle\Controller\CommonScenariosController@simpleAction',
4444
'symfony.route.name' => 'simple',
45-
'http.route' => '/simple',
45+
4646
'http.method' => 'GET',
4747
'http.url' => 'http://localhost/simple',
4848
'http.status_code' => '200',

tests/Integrations/Symfony/V3_4/AutofinishedTracesSymfony34Test.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function testEndpointThatExitsWithNoProcess()
3636
)->withExactTags([
3737
'symfony.route.action' => 'AppBundle\Controller\HomeController@actionBeingTerminatedByExit',
3838
'symfony.route.name' => 'terminated_by_exit',
39-
'http.route' => '/terminated_by_exit',
39+
4040
'http.method' => 'GET',
4141
'http.url' => 'http://localhost/terminated_by_exit',
4242
'http.status_code' => '200',

tests/Integrations/Symfony/V3_4/CommonScenariosTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function provideSpecs()
5959
)->withExactTags([
6060
'symfony.route.action' => 'AppBundle\Controller\CommonScenariosController@simpleAction',
6161
'symfony.route.name' => 'simple',
62-
'http.route' => '/simple',
62+
6363
'http.method' => 'GET',
6464
'http.url' => 'http://localhost/simple?key=value&<redacted>',
6565
'http.status_code' => '200',
@@ -98,7 +98,7 @@ public function provideSpecs()
9898
)->withExactTags([
9999
'symfony.route.action' => 'AppBundle\Controller\CommonScenariosController@simpleViewAction',
100100
'symfony.route.name' => 'simple_view',
101-
'http.route' => '/simple_view',
101+
102102
'http.method' => 'GET',
103103
'http.url' => 'http://localhost/simple_view?key=value&<redacted>',
104104
'http.status_code' => '200',
@@ -148,7 +148,7 @@ public function provideSpecs()
148148
->withExactTags([
149149
'symfony.route.action' => 'AppBundle\Controller\CommonScenariosController@errorAction',
150150
'symfony.route.name' => 'error',
151-
'http.route' => '/error',
151+
152152
'http.method' => 'GET',
153153
'http.url' => 'http://localhost/error?key=value&<redacted>',
154154
'http.status_code' => '500',

tests/Integrations/Symfony/V3_4/TemplateEnginesTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function testAlternateTemplatingEngine()
2929
)->withExactTags([
3030
'symfony.route.action' => 'AppBundle\Controller\HomeController@indexAction',
3131
'symfony.route.name' => 'alternate_templating',
32-
'http.route' => '/alternate_templating',
32+
3333
'http.method' => 'GET',
3434
'http.url' => 'http://localhost/alternate_templating',
3535
'http.status_code' => '200',

tests/Integrations/Symfony/V3_4/TraceSearchConfigTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function testScenario()
4242
)->withExactTags([
4343
'symfony.route.action' => 'AppBundle\Controller\CommonScenariosController@simpleAction',
4444
'symfony.route.name' => 'simple',
45-
'http.route' => '/simple',
45+
4646
'http.method' => 'GET',
4747
'http.url' => 'http://localhost/simple',
4848
'http.status_code' => '200',

tests/Integrations/Symfony/V4_0/CommonScenariosTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function provideSpecs()
5555
)->withExactTags([
5656
'symfony.route.action' => 'App\Controller\CommonScenariosController@simpleAction',
5757
'symfony.route.name' => 'simple',
58-
'http.route' => '/simple',
58+
5959
'http.method' => 'GET',
6060
'http.url' => 'http://localhost/simple?key=value&<redacted>',
6161
'http.status_code' => '200',
@@ -94,7 +94,7 @@ public function provideSpecs()
9494
)->withExactTags([
9595
'symfony.route.action' => 'App\Controller\CommonScenariosController@simpleViewAction',
9696
'symfony.route.name' => 'simple_view',
97-
'http.route' => '/simple_view',
97+
9898
'http.method' => 'GET',
9999
'http.url' => 'http://localhost/simple_view?key=value&<redacted>',
100100
'http.status_code' => '200',
@@ -142,7 +142,7 @@ public function provideSpecs()
142142
)->withExactTags([
143143
'symfony.route.action' => 'App\Controller\CommonScenariosController@errorAction',
144144
'symfony.route.name' => 'error',
145-
'http.route' => '/error',
145+
146146
'http.method' => 'GET',
147147
'http.url' => 'http://localhost/error?key=value&<redacted>',
148148
'http.status_code' => '500',

tests/Integrations/Symfony/V4_0/TraceSearchConfigTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function testScenario()
4242
)->withExactTags([
4343
'symfony.route.action' => 'App\Controller\CommonScenariosController@simpleAction',
4444
'symfony.route.name' => 'simple',
45-
'http.route' => '/simple',
45+
4646
'http.method' => 'GET',
4747
'http.url' => 'http://localhost/simple',
4848
'http.status_code' => '200',

0 commit comments

Comments
 (0)