add test-raise-error endpoint for sentry testing, etc
This commit is contained in:
parent
c74474f019
commit
562cb091dc
|
@ -148,6 +148,21 @@ paths:
|
|||
schema:
|
||||
$ref: "#/components/schemas/OkTrue"
|
||||
|
||||
/status/test-raise-error:
|
||||
get:
|
||||
operationId: spiffworkflow_backend.routes.health_controller.test_raise_error
|
||||
summary: Returns an unhandled exception that should notify sentry, if sentry is configured
|
||||
tags:
|
||||
- Status
|
||||
responses:
|
||||
"500":
|
||||
description: The server raises a test error as expected.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/OkTrue"
|
||||
|
||||
|
||||
/process-groups:
|
||||
parameters:
|
||||
- name: process_group_identifier
|
||||
|
|
|
@ -9,3 +9,7 @@ def status() -> Response:
|
|||
"""Status."""
|
||||
ProcessInstanceModel.query.filter().first()
|
||||
return make_response({"ok": True}, 200)
|
||||
|
||||
|
||||
def test_raise_error() -> Response:
|
||||
raise Exception("This exception was generated by /status/test-raise-error for testing purposes. Please ignore.")
|
||||
|
|
|
@ -310,6 +310,7 @@ class AuthorizationService:
|
|||
swagger_functions = ["get_json_spec"]
|
||||
authentication_exclusion_list = [
|
||||
"status",
|
||||
"test_raise_error",
|
||||
"authentication_callback",
|
||||
"github_webhook_receive",
|
||||
]
|
||||
|
|
|
@ -0,0 +1,35 @@
|
|||
from flask.app import Flask
|
||||
from flask.testing import FlaskClient
|
||||
from tests.spiffworkflow_backend.helpers.base_test import BaseTest
|
||||
|
||||
from spiffworkflow_backend.models.user import UserModel
|
||||
|
||||
|
||||
class TestHealthController(BaseTest):
|
||||
"""TestUsersController."""
|
||||
|
||||
def test_status(
|
||||
self,
|
||||
app: Flask,
|
||||
client: FlaskClient,
|
||||
with_db_and_bpmn_file_cleanup: None,
|
||||
with_super_admin_user: UserModel,
|
||||
) -> None:
|
||||
"""Test_user_search_returns_a_user."""
|
||||
response = client.get(
|
||||
f"/v1.0/status",
|
||||
)
|
||||
assert response.status_code == 200
|
||||
|
||||
def test_test_raise_error(
|
||||
self,
|
||||
app: Flask,
|
||||
client: FlaskClient,
|
||||
with_db_and_bpmn_file_cleanup: None,
|
||||
with_super_admin_user: UserModel,
|
||||
) -> None:
|
||||
"""Test_user_search_returns_a_user."""
|
||||
response = client.get(
|
||||
f"/v1.0/status/test-raise-error",
|
||||
)
|
||||
assert response.status_code == 500
|
Loading…
Reference in New Issue