test: Initialize SDK in relevant tests#758
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 265e126. Configure here.
I don't like the idea that our main execution is reliant on the Sentry SDK. Is there a way to structure this so we capture the information but don't fail if the sentry SDK functions fail? |
|
Of course, you don't want your program to also fail if your observability fails. |
|
Closing as we've discussed in person in VIE that we'll keep the tests in the SDK and continue relying on the no-op client that exists when the SDK is not initialized in taskbroker tests. |

Initialize the SDK with a mock transport in tests in which
_execute_activationorcreate_activationis called, since the functions rely on tracing functions. The SDK was previously uninitialized in tests.The initialization fixture is adapted from https://github.com/getsentry/sentry-python.
This allows us to exercise options that change the tracing behavior in tests. The tests are parametrized on the trace lifecycle in a follow up PR (#757).