Skip to content

Commit

Permalink
bug 1748268: implement /__broken__ endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
willkg committed Jan 3, 2022
1 parent 848b05f commit e027151
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions webapp-django/crashstats/monitoring/tests/test_views.py
Expand Up @@ -167,3 +167,9 @@ def test_version_with_file(self, client, settings, tmpdir, monkeypatch):
assert resp.status_code == 200
assert resp["Content-Type"] == "application/json"
assert smart_text(resp.content) == text


class TestBroken:
def test_broken(self, client):
with pytest.raises(Exception):
client.get(reverse("monitoring:broken"))
1 change: 1 addition & 0 deletions webapp-django/crashstats/monitoring/urls.py
Expand Up @@ -11,6 +11,7 @@
urlpatterns = [
url(r"^monitoring/$", views.index, name="index"),
url(r"^monitoring/cron/$", views.cron_status, name="cron_status"),
url(r"^__broken__$", views.broken, name="broken"),
# Dockerflow endpoints
url(r"^__heartbeat__$", views.dockerflow_heartbeat, name="dockerflow_heartbeat"),
url(
Expand Down
5 changes: 5 additions & 0 deletions webapp-django/crashstats/monitoring/views.py
Expand Up @@ -140,3 +140,8 @@ def dockerflow_heartbeat(request):
def dockerflow_lbheartbeat(request):
"""Dockerflow endpoint for load balancer checks."""
return {"ok": True}


def broken(request):
"""Throws an error to test Sentry connetivity."""
raise Exception("intentional exception")

0 comments on commit e027151

Please sign in to comment.