diff --git a/spiffworkflow-backend/src/spiffworkflow_backend/api.yml b/spiffworkflow-backend/src/spiffworkflow_backend/api.yml index 664b9186e..30b5812a8 100755 --- a/spiffworkflow-backend/src/spiffworkflow_backend/api.yml +++ b/spiffworkflow-backend/src/spiffworkflow_backend/api.yml @@ -148,9 +148,9 @@ paths: schema: $ref: "#/components/schemas/OkTrue" - /status/test-raise-error: + /debug/test-raise-error: get: - operationId: spiffworkflow_backend.routes.health_controller.test_raise_error + operationId: spiffworkflow_backend.routes.debug_controller.test_raise_error summary: Returns an unhandled exception that should notify sentry, if sentry is configured tags: - Status diff --git a/spiffworkflow-backend/src/spiffworkflow_backend/routes/debug_controller.py b/spiffworkflow-backend/src/spiffworkflow_backend/routes/debug_controller.py new file mode 100644 index 000000000..29a81447b --- /dev/null +++ b/spiffworkflow-backend/src/spiffworkflow_backend/routes/debug_controller.py @@ -0,0 +1,6 @@ +"""APIs for dealing with process groups, process models, and process instances.""" +from flask.wrappers import Response + + +def test_raise_error() -> Response: + raise Exception("This exception was generated by /debug/test-raise-error for testing purposes. Please ignore.") diff --git a/spiffworkflow-backend/tests/spiffworkflow_backend/integration/test_debug_controller.py b/spiffworkflow-backend/tests/spiffworkflow_backend/integration/test_debug_controller.py new file mode 100644 index 000000000..84fcafb38 --- /dev/null +++ b/spiffworkflow-backend/tests/spiffworkflow_backend/integration/test_debug_controller.py @@ -0,0 +1,17 @@ +from flask.app import Flask +from flask.testing import FlaskClient +from tests.spiffworkflow_backend.helpers.base_test import BaseTest + + +class TestDebugController(BaseTest): + + def test_test_raise_error( + self, + app: Flask, + client: FlaskClient, + with_db_and_bpmn_file_cleanup: None, + ) -> None: + response = client.get( + "/v1.0/debug/test-raise-error", + ) + assert response.status_code == 500 diff --git a/spiffworkflow-backend/tests/spiffworkflow_backend/integration/test_health_controller.py b/spiffworkflow-backend/tests/spiffworkflow_backend/integration/test_health_controller.py index 4958dcdb7..750028676 100644 --- a/spiffworkflow-backend/tests/spiffworkflow_backend/integration/test_health_controller.py +++ b/spiffworkflow-backend/tests/spiffworkflow_backend/integration/test_health_controller.py @@ -2,34 +2,15 @@ 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", + "/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