@@ -87,46 +87,46 @@ public function testQueueJobsWithBreadcrumbSetInBetweenKeepsNonJobBreadcrumbsOnC
87
87
$ this ->assertCount (1 , $ this ->getCurrentSentryBreadcrumbs ());
88
88
}
89
89
90
- protected function withoutSampling ($ app ): void
90
+ protected function withTracingEnabled ($ app ): void
91
91
{
92
92
$ app ['config ' ]->set ('sentry.traces_sample_rate ' , 1.0 );
93
93
}
94
94
95
95
/**
96
- * @define-env withoutSampling
96
+ * @define-env withTracingEnabled
97
97
*/
98
- public function testQueueJobDoesntCreateTransactionByDefault (): void
98
+ public function testQueueJobCreatesTransactionByDefault (): void
99
99
{
100
100
dispatch (new QueueEventsTestJob );
101
101
102
102
$ transaction = $ this ->getLastSentryEvent ();
103
103
104
- $ this ->assertNull ($ transaction );
104
+ $ this ->assertNotNull ($ transaction );
105
+
106
+ $ this ->assertEquals (EventType::transaction (), $ transaction ->getType ());
107
+ $ this ->assertEquals (QueueEventsTestJob::class, $ transaction ->getTransaction ());
108
+
109
+ $ traceContext = $ transaction ->getContexts ()['trace ' ];
110
+
111
+ $ this ->assertEquals ('queue.process ' , $ traceContext ['op ' ]);
105
112
}
106
113
107
- protected function withQueueJobTracingEnabled ($ app ): void
114
+ protected function withQueueJobTracingDisabled ($ app ): void
108
115
{
109
116
$ app ['config ' ]->set ('sentry.traces_sample_rate ' , 1.0 );
110
- $ app ['config ' ]->set ('sentry.tracing.queue_job_transactions ' , true );
117
+ $ app ['config ' ]->set ('sentry.tracing.queue_job_transactions ' , false );
111
118
}
112
119
113
120
/**
114
- * @define-env withQueueJobTracingEnabled
121
+ * @define-env withQueueTracingDisabled
115
122
*/
116
- public function testQueueJobCreatesTransactionWhenEnabled (): void
123
+ public function testQueueJobDoesntCreateTransaction (): void
117
124
{
118
125
dispatch (new QueueEventsTestJob );
119
126
120
127
$ transaction = $ this ->getLastSentryEvent ();
121
128
122
- $ this ->assertNotNull ($ transaction );
123
-
124
- $ this ->assertEquals (EventType::transaction (), $ transaction ->getType ());
125
- $ this ->assertEquals (QueueEventsTestJob::class, $ transaction ->getTransaction ());
126
-
127
- $ traceContext = $ transaction ->getContexts ()['trace ' ];
128
-
129
- $ this ->assertEquals ('queue.process ' , $ traceContext ['op ' ]);
129
+ $ this ->assertNull ($ transaction );
130
130
}
131
131
}
132
132
0 commit comments