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

Add an option to run Tribler with sentry URL for tests #5874

Merged
merged 1 commit into from
Dec 22, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 23 additions & 2 deletions src/run_tribler.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,30 @@ async def start_tribler():
get_event_loop().run_forever()


def init_sentry_reporter():
""" Initialise sentry reporter

We use `sentry_url` as a URL for normal tribler mode and TEST_SENTRY_URL
as a URL for sending sentry's reports while a Tribler client running in
test mode
"""
test_sentry_url = os.environ.get('TEST_SENTRY_URL', None)

if not test_sentry_url:
SentryReporter.init(sentry_url=sentry_url,
release_version=version_id,
scrubber=SentryScrubber(),
strategy=SentryStrategy.SEND_ALLOWED_WITH_CONFIRMATION)
else:
SentryReporter.init(sentry_url=test_sentry_url,
release_version=version_id,
scrubber=None,
strategy=SentryStrategy.SEND_ALLOWED)


if __name__ == "__main__":
SentryReporter.init(sentry_url=sentry_url, release_version=version_id, scrubber=SentryScrubber(),
strategy=SentryStrategy.SEND_ALLOWED_WITH_CONFIRMATION)
init_sentry_reporter()

# Get root state directory (e.g. from environment variable or from system default)
root_state_dir = get_root_state_directory()
# Check whether we need to start the core or the user interface
Expand Down