edx_django_utils.monitoring.tests package#
Subpackages#
- edx_django_utils.monitoring.tests.code_owner package
- Submodules
- edx_django_utils.monitoring.tests.code_owner.mock_views module
- edx_django_utils.monitoring.tests.code_owner.test_middleware module
CodeOwnerMetricMiddlewareTestsCodeOwnerMetricMiddlewareTests.setUp()CodeOwnerMetricMiddlewareTests.test_catch_all_with_errors()CodeOwnerMetricMiddlewareTests.test_code_owner_no_mappings()CodeOwnerMetricMiddlewareTests.test_code_owner_path_mapping_hits_and_misses_1____middleware_test____None_()CodeOwnerMetricMiddlewareTests.test_code_owner_path_mapping_hits_and_misses_2____test_____team_red__()CodeOwnerMetricMiddlewareTests.test_code_owner_path_mapping_with_catch_all_1____middleware_test_____team_blue__()CodeOwnerMetricMiddlewareTests.test_code_owner_path_mapping_with_catch_all_2____test_____team_red__()CodeOwnerMetricMiddlewareTests.test_code_owner_transaction_mapping_error()CodeOwnerMetricMiddlewareTests.test_code_owner_transaction_mapping_hits_and_misses_1___edx_django_utils_monitoring_tests_code_owner_test_middleware____edx_django_utils_monitoring_tests_code_owner_test_middleware_MockMiddlewareViewTest___None_()CodeOwnerMetricMiddlewareTests.test_code_owner_transaction_mapping_hits_and_misses_2___edx_django_utils_monitoring_tests_code_owner_mock_views____edx_django_utils_monitoring_tests_code_owner_mock_views_MockViewTest____team_red__()CodeOwnerMetricMiddlewareTests.test_code_owner_transaction_mapping_with_catch_all_1___edx_django_utils_monitoring_tests_code_owner_test_middleware____edx_django_utils_monitoring_tests_code_owner_test_middleware_MockMiddlewareViewTest____team_blue__()CodeOwnerMetricMiddlewareTests.test_code_owner_transaction_mapping_with_catch_all_2___edx_django_utils_monitoring_tests_code_owner_mock_views____edx_django_utils_monitoring_tests_code_owner_mock_views_MockViewTest____team_red__()CodeOwnerMetricMiddlewareTests.test_code_owner_transaction_no_mappings()CodeOwnerMetricMiddlewareTests.test_init()CodeOwnerMetricMiddlewareTests.test_load_config_with_invalid_dict()CodeOwnerMetricMiddlewareTests.test_no_resolver_for_path_and_no_transaction()CodeOwnerMetricMiddlewareTests.test_request_call()CodeOwnerMetricMiddlewareTests.urls
MockMiddlewareViewTestget_set_custom_attribute_mock()
- edx_django_utils.monitoring.tests.code_owner.test_utils module
MonitoringUtilsTestsMonitoringUtilsTests.setUp()MonitoringUtilsTests.test_code_owner_mapping_hits_and_misses_01___xbl___None_()MonitoringUtilsTests.test_code_owner_mapping_hits_and_misses_02___xblock_2___None_()MonitoringUtilsTests.test_code_owner_mapping_hits_and_misses_03___xblock____team_red__()MonitoringUtilsTests.test_code_owner_mapping_hits_and_misses_04___openedx_core_djangoapps___None_()MonitoringUtilsTests.test_code_owner_mapping_hits_and_misses_05___openedx_core_djangoapps_xblock____team_red__()MonitoringUtilsTests.test_code_owner_mapping_hits_and_misses_06___openedx_core_djangoapps_xblock_views____team_red__()MonitoringUtilsTests.test_code_owner_mapping_hits_and_misses_07___grades____team_red__()MonitoringUtilsTests.test_code_owner_mapping_hits_and_misses_08___lms_djangoapps_grades____team_red__()MonitoringUtilsTests.test_code_owner_mapping_hits_and_misses_09___xblock_django____team_blue__()MonitoringUtilsTests.test_code_owner_mapping_hits_and_misses_10___common_djangoapps_xblock_django____team_blue__()MonitoringUtilsTests.test_code_owner_mapping_with_invalid_dict()MonitoringUtilsTests.test_code_owner_mapping_with_no_module()MonitoringUtilsTests.test_code_owner_mapping_with_no_settings()MonitoringUtilsTests.test_mapping_performance()MonitoringUtilsTests.test_set_code_owner_attribute_catch_all()MonitoringUtilsTests.test_set_code_owner_attribute_from_module_success()MonitoringUtilsTests.test_set_code_owner_attribute_no_mappings()MonitoringUtilsTests.test_set_code_owner_attribute_success()MonitoringUtilsTests.test_set_code_owner_attribute_with_invalid_setting()
decorated_function()
- Module contents
Submodules#
edx_django_utils.monitoring.tests.test_backends module#
Tests for TelemetryBackend and implementations.
- class edx_django_utils.monitoring.tests.test_backends.TestBackendsConfig(methodName='runTest')#
Bases:
TestCaseTest configuration of the backends list.
- test_configured_backends_1__None____NewRelicBackend___(setting, expected_classnames)#
Test that backends are loaded as expected.
- test_configured_backends_2_________(setting, expected_classnames)#
Test that backends are loaded as expected.
- test_configured_backends_3____edx_django_utils_monitoring_OpenTelemetryBackend______OpenTelemetryBackend___(setting, expected_classnames)#
Test that backends are loaded as expected.
- test_configured_backends_4____edx_django_utils_monitoring_NewRelicBackend____edx_django_utils_monitoring_OpenTelemetryBackend____edx_django_utils_monitoring_DatadogBackend______NewRelicBackend____OpenTelemetryBackend____DatadogBackend___(setting, expected_classnames)#
Test that backends are loaded as expected.
- test_default_config()#
We need to keep the same unconfigured default for now.
- test_import_failure(mock_log)#
Test that backends that can’t be imported are ignored, with warning.
- test_newrelic_package(mock_log)#
Test that New Relic backend is skipped if package not present.
- test_type()#
Test that we detect the misuse of a string instead of a list.
- test_wrong_class(mock_log)#
Test that backend classes of an unexpected ancestor are ignored, with warning.
- class edx_django_utils.monitoring.tests.test_backends.TestBackendsFanOut(methodName='runTest')#
Bases:
TestCaseTest that certain utility functions fan out to the backends.
- test_record_exception(mock_dd_span, mock_otel_record_exception, mock_nr_record_exception)#
- test_set_custom_attribute(mock_dd_root_span, mock_otel_set_attribute, mock_nr_add_custom_parameter)#
edx_django_utils.monitoring.tests.test_middleware module#
edx_django_utils.monitoring.tests.test_monitoring_support module#
Tests for MonitoringSupportMiddleware and associated utilities.
Note: See test_middleware.py for the rest of the middleware tests.
- class edx_django_utils.monitoring.tests.test_monitoring_support.TestMonitoringSupportMiddleware(methodName='runTest')#
Bases:
TestCaseTest the monitoring_utils middleware and helpers
- catch_signal(signal)#
Catch django signal and return the mocked handler.
- setUp()#
Hook method for setting up the test fixture before exercising it.
- test_accumulate_and_increment_1(cached_monitoring_middleware_class, is_deprecated, middleware_method_name, mock_newrelic_agent)#
Test normal usage of collecting custom attributes and reporting to New Relic
- test_accumulate_and_increment_2(cached_monitoring_middleware_class, is_deprecated, middleware_method_name, mock_newrelic_agent)#
Test normal usage of collecting custom attributes and reporting to New Relic
- test_accumulate_and_increment_3(cached_monitoring_middleware_class, is_deprecated, middleware_method_name, mock_newrelic_agent)#
Test normal usage of collecting custom attributes and reporting to New Relic
- test_accumulate_with_illegal_value_1(cached_monitoring_middleware_class, is_deprecated, mock_newrelic_agent)#
Test monitoring accumulate with illegal value that can’t be added.
- test_accumulate_with_illegal_value_2(cached_monitoring_middleware_class, is_deprecated, mock_newrelic_agent)#
Test monitoring accumulate with illegal value that can’t be added.
- test_deprecated_accumulate(mock_accumulate)#
- test_deprecated_increment(mock_increment)#
- test_deprecated_set_custom_attribute(mock_set_custom_attribute)#
- test_deprecated_set_custom_attributes_for_course_key(mock_set_custom_attributes_for_course_key)#
- test_error_tagging(mock_get_root_span)#
- test_process_exception_signal()#
Test middleware sends process exception signal.
- test_process_request_signal()#
Test middleware sends process request signal.
- test_process_response_signal()#
Test middleware sends process response signal.