diff --git a/webapp-django/crashstats/monitoring/tests/test_views.py b/webapp-django/crashstats/monitoring/tests/test_views.py index 84d05a4adf..2c8f1cf32c 100644 --- a/webapp-django/crashstats/monitoring/tests/test_views.py +++ b/webapp-django/crashstats/monitoring/tests/test_views.py @@ -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")) diff --git a/webapp-django/crashstats/monitoring/urls.py b/webapp-django/crashstats/monitoring/urls.py index b44e826748..0bc9783648 100644 --- a/webapp-django/crashstats/monitoring/urls.py +++ b/webapp-django/crashstats/monitoring/urls.py @@ -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( diff --git a/webapp-django/crashstats/monitoring/views.py b/webapp-django/crashstats/monitoring/views.py index e8a584bde8..0253a49bb5 100644 --- a/webapp-django/crashstats/monitoring/views.py +++ b/webapp-django/crashstats/monitoring/views.py @@ -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")