Skip to content

Commit

Permalink
Merge pull request #5874 from drew2a/feature/sentry_test_url
Browse files Browse the repository at this point in the history
Add an option to run Tribler with sentry URL for tests
  • Loading branch information
drew2a authored Dec 22, 2020
2 parents f664376 + d665458 commit 7562d25
Showing 1 changed file with 23 additions and 2 deletions.
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

0 comments on commit 7562d25

Please sign in to comment.