Skip to content

Commit

Permalink
tests: Update Symfony v4.4 snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
PROFeNoM committed Nov 15, 2024
1 parent d3005df commit f56d3f5
Show file tree
Hide file tree
Showing 6 changed files with 445 additions and 38 deletions.
25 changes: 25 additions & 0 deletions tests/Integrations/Symfony/V4_4/MessengerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ protected static function getEnvs()
'DD_SERVICE' => 'symfony_messenger_test',
'DD_TRACE_DEBUG' => 'true',
'DD_TRACE_SYMFONY_MESSENGER_MIDDLEWARES' => 'true',
'DD_INSTRUMENTATION_TELEMETRY_ENABLED' => 'false',
'DD_TRACE_PHPREDIS_ENABLED' => 'false' // We are NOT testing the phpredis integration
]);
}
Expand All @@ -55,6 +56,7 @@ public function testAsyncSuccess()
'DD_TRACE_REMOVE_AUTOINSTRUMENTATION_ORPHANS' => 'true',
'DD_TRACE_SYMFONY_MESSENGER_MIDDLEWARES' => 'true',
'DD_TRACE_DEBUG' => 'true',
'DD_INSTRUMENTATION_TELEMETRY_ENABLED' => 'false',
], [], ['messenger:consume', 'async', '--limit=1']);

$this->snapshotFromTraces(
Expand All @@ -78,6 +80,7 @@ public function testAsyncFailure()
'DD_SERVICE' => 'symfony_messenger_test',
'DD_TRACE_REMOVE_AUTOINSTRUMENTATION_ORPHANS' => 'true',
'DD_TRACE_SYMFONY_MESSENGER_MIDDLEWARES' => 'true',
'DD_INSTRUMENTATION_TELEMETRY_ENABLED' => 'false',
], [], ['messenger:consume', 'async', '--limit=1']);

$this->snapshotFromTraces(
Expand All @@ -87,4 +90,26 @@ public function testAsyncFailure()
true
);
}

public function testAsyncWithTracerDisabledOnConsume()
{
// GH Issue: https://github.com/DataDog/dd-trace-php/pull/2749#issuecomment-2467409884

$this->tracesFromWebRequestSnapshot(function () {
$spec = GetSpec::create('Lucky number', '/lucky/number');
$this->call($spec);
}, self::FIELDS_TO_IGNORE);

list($output, $exitCode) = $this->executeCli(
self::getConsoleScript(),
[],
['ddtrace.disable' => 'true'],
['messenger:consume', 'async', '--limit=1'],
true,
true,
true
);

$this->assertEquals(0, $exitCode, "Command failed with exit code 1. Output: $output");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
"resource": "lucky_fail",
"trace_id": 0,
"span_id": 1,
"parent_id": 7459318832667968177,
"parent_id": 18306335288450662101,
"type": "web",
"meta": {
"_dd.p.dm": "-0",
"_dd.p.tid": "669786ad00000000",
"_dd.p.tid": "6737718e00000000",
"component": "symfony",
"http.method": "GET",
"http.status_code": "200",
"http.url": "http://localhost/lucky/fail",
"runtime-id": "f776fad2-f39f-4b4f-81e6-9faafebfaaee",
"runtime-id": "d7b13848-ab88-43bb-853d-29cf4386f11e",
"span.kind": "server",
"symfony.route.action": "App\\Controller\\LuckyController@fail",
"symfony.route.name": "lucky_fail"
Expand Down Expand Up @@ -127,9 +127,9 @@
"messaging.system": "symfony"
},
"metrics": {
"messaging.symfony.stamps.DDTrace\\Integrations\\SymfonyMessenger\\DDTraceStamp": 1.0,
"messaging.symfony.stamps.Symfony\\Component\\Messenger\\Stamp\\BusNameStamp": 1.0,
"messaging.symfony.stamps.Symfony\\Component\\Messenger\\Stamp\\SentStamp": 1.0,
"messaging.symfony.stamps.Symfony\\Component\\Messenger\\Stamp\\SerializerStamp": 2.0,
"messaging.symfony.stamps.Symfony\\Component\\Messenger\\Stamp\\TransportMessageIdStamp": 1.0
}
},
Expand Down Expand Up @@ -260,9 +260,9 @@
"span.kind": "producer"
},
"metrics": {
"messaging.symfony.stamps.DDTrace\\Integrations\\SymfonyMessenger\\DDTraceStamp": 1.0,
"messaging.symfony.stamps.Symfony\\Component\\Messenger\\Stamp\\BusNameStamp": 1.0,
"messaging.symfony.stamps.Symfony\\Component\\Messenger\\Stamp\\SentStamp": 1.0,
"messaging.symfony.stamps.Symfony\\Component\\Messenger\\Stamp\\SerializerStamp": 2.0,
"messaging.symfony.stamps.Symfony\\Component\\Messenger\\Stamp\\TransportMessageIdStamp": 1.0
}
},
Expand Down
Loading

0 comments on commit f56d3f5

Please sign in to comment.