Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Transactions Fail when Test Fails #22

Open
scefali opened this issue May 31, 2023 · 3 comments
Open

Make Transactions Fail when Test Fails #22

scefali opened this issue May 31, 2023 · 3 comments

Comments

@scefali
Copy link

scefali commented May 31, 2023

It will be a lot easier to see which tests are flaky if we can make the transition fail for that test so we can look at failure rates on each test as a transaction in Sentry.

@untitaker
Copy link
Member

@scefali were you planning to work on this feature? I think it's not that hard to impl

@scefali
Copy link
Author

scefali commented Jun 12, 2023

@untitaker No I wasn't but if you think it's that easy I can try

@untitaker
Copy link
Member

I think you want to grab the current transaction and set the status, right around here:

sentry_sdk.set_tag("pytest.result", "pending")

we already do something that here: https://github.com/getsentry/sentry-python/blob/f4c19e168d15fbb7caa942333d048a85f147045c/sentry_sdk/integrations/celery.py#L319

Just substitute hub for Hub.current

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants