Skip to content

Commit 282bd66

Browse files
committed
refactor ai slop
1 parent 35f9525 commit 282bd66

File tree

1 file changed

+17
-2
lines changed
  • dev-packages/node-integration-tests/suites/tracing/kafkajs

1 file changed

+17
-2
lines changed

dev-packages/node-integration-tests/suites/tracing/kafkajs/test.ts

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,27 @@ describe('kafkajs', () => {
2727
transaction: (transaction: TransactionEvent) => {
2828
receivedTransactions.push(transaction);
2929

30-
const producer = receivedTransactions.find(t => t.transaction === 'send test-topic');
31-
const consumer = receivedTransactions.find(t => t.transaction === 'process test-topic');
30+
const producer = receivedTransactions.find(
31+
t => t.contexts?.trace?.data?.['sentry.origin'] === 'auto.kafkajs.otel.producer',
32+
);
33+
const consumer = receivedTransactions.find(
34+
t => t.contexts?.trace?.data?.['sentry.origin'] === 'auto.kafkajs.otel.consumer',
35+
);
3236

3337
expect(producer).toBeDefined();
3438
expect(consumer).toBeDefined();
3539

40+
for (const t of [producer, consumer]) {
41+
// just to assert on the basic shape (for more straight-forward tests, this is usually done by the runner)
42+
expect(t).toMatchObject({
43+
event_id: expect.any(String),
44+
timestamp: expect.anything(),
45+
start_timestamp: expect.anything(),
46+
spans: expect.any(Array),
47+
type: 'transaction',
48+
});
49+
}
50+
3651
expect(producer!.contexts?.trace).toMatchObject(
3752
expect.objectContaining({
3853
op: 'message',

0 commit comments

Comments
 (0)