openmodule 14.0.2__tar.gz → 14.0.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {openmodule-14.0.2 → openmodule-14.0.3}/ChangeLog +5 -6
- {openmodule-14.0.2/openmodule.egg-info → openmodule-14.0.3}/PKG-INFO +1 -1
- {openmodule-14.0.2 → openmodule-14.0.3}/openmodule/sentry.py +23 -15
- {openmodule-14.0.2 → openmodule-14.0.3}/openmodule/utils/kv_store.py +21 -7
- {openmodule-14.0.2 → openmodule-14.0.3/openmodule.egg-info}/PKG-INFO +1 -1
- openmodule-14.0.3/openmodule.egg-info/pbr.json +1 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/test_sentry.py +44 -12
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/test_utils_kv_store.py +28 -5
- openmodule-14.0.2/openmodule.egg-info/pbr.json +0 -1
- {openmodule-14.0.2 → openmodule-14.0.3}/.gitlab-ci.yml +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/AUTHORS +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/LICENSE +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/README.md +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/docs/access_service.md +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/docs/anonymization.md +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/docs/cleanup.md +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/docs/coding_standard.md +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/docs/commands.md +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/docs/connection_status_listener.md +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/docs/csv_export.md +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/docs/database.md +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/docs/deprecated.md +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/docs/deprecated_code/README.md +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/docs/deprecated_code/access_service/openmodule/models/access_service.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/docs/deprecated_code/access_service/openmodule/utils/access_service.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/docs/deprecated_code/access_service/openmodule_test/access_service.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/docs/deprecated_code/access_service/tests/test_utils_access_service.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/docs/deprecated_code/api/openmodule/utils/api.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/docs/deprecated_code/api/openmodule_test/api.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/docs/deprecated_code/api/tests/test_utils_api.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/docs/deprecated_code/package_reader/openmodule/utils/package_reader.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/docs/deprecated_code/package_reader/openmodule_test/fake_package_creator.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/docs/deprecated_code/package_reader/tests/test_package_reader.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/docs/event_sending.md +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/docs/getting_started.md +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/docs/health.md +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/docs/images/broker.drawio.png +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/docs/known_issues.md +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/docs/migrations.md +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/docs/package_reader.md +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/docs/rpc.md +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/docs/sentry.md +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/docs/settings.md +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/docs/settings_provider.md +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/docs/testing.md +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/docs/translation.md +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/docs/utils.md +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/openmodule/__init__.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/openmodule/alert.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/openmodule/config.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/openmodule/connection_status.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/openmodule/core.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/openmodule/database/custom_types.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/openmodule/database/database.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/openmodule/database/env.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/openmodule/database/migration.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/openmodule/dispatcher.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/openmodule/health.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/openmodule/logging.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/openmodule/messaging.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/openmodule/models/__init__.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/openmodule/models/access_service.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/openmodule/models/alert.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/openmodule/models/base.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/openmodule/models/io.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/openmodule/models/kv_store.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/openmodule/models/presence.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/openmodule/models/privacy.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/openmodule/models/rpc.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/openmodule/models/settings.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/openmodule/models/validation.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/openmodule/models/vehicle.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/openmodule/rpc/__init__.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/openmodule/rpc/client.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/openmodule/rpc/common.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/openmodule/rpc/server.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/openmodule/threading.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/openmodule/utils/__init__.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/openmodule/utils/access_service.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/openmodule/utils/charset.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/openmodule/utils/cleanup.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/openmodule/utils/csv_export.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/openmodule/utils/databox.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/openmodule/utils/db_helper.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/openmodule/utils/eventlog.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/openmodule/utils/io.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/openmodule/utils/matching.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/openmodule/utils/misc_functions.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/openmodule/utils/package_reader.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/openmodule/utils/presence.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/openmodule/utils/schema.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/openmodule/utils/settings.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/openmodule/utils/translation.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/openmodule/utils/validation.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/openmodule.egg-info/SOURCES.txt +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/openmodule.egg-info/dependency_links.txt +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/openmodule.egg-info/not-zip-safe +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/openmodule.egg-info/requires.txt +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/openmodule.egg-info/top_level.txt +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/openmodule_commands/__init__.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/openmodule_commands/setup.cfg +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/openmodule_commands/setup.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/openmodule_commands/translate.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/openmodule_test/__init__.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/openmodule_test/alert.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/openmodule_test/connection_status.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/openmodule_test/core.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/openmodule_test/database.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/openmodule_test/eventlistener.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/openmodule_test/files.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/openmodule_test/gate.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/openmodule_test/health.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/openmodule_test/interrupt.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/openmodule_test/io_simulator.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/openmodule_test/package_reader.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/openmodule_test/presence.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/openmodule_test/requirements.txt +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/openmodule_test/rpc.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/openmodule_test/sentry.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/openmodule_test/settings.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/openmodule_test/setup.cfg +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/openmodule_test/setup.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/openmodule_test/utils.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/openmodule_test/zeromq.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/requirements.txt +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/setup.cfg +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/setup.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/test-requirements.txt +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/__init__.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/config.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/database_models_migration.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/database_models_test.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/invalid_database/alembic/README +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/invalid_database/alembic/__init__.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/invalid_database/alembic/env.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/invalid_database/alembic/script.py.mako +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/invalid_database/alembic/versions/ff26e54332f9_datetime_models.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/invalid_database/alembic.ini +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/invalid_database/makemigration.sh +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/migration_double_column_delete_error/alembic/__init__.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/migration_double_column_delete_error/alembic/env.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/migration_double_column_delete_error/alembic/script.py.mako +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/migration_double_column_delete_error/alembic/versions/812a3e5b8517_initial.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/migration_double_column_delete_error/alembic/versions/a7ea100a784f_key_error.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/migration_double_column_delete_error/alembic.ini +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/migration_double_column_delete_error/makemigration.sh +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/migration_no_such_table_error/alembic/__init__.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/migration_no_such_table_error/alembic/env.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/migration_no_such_table_error/alembic/script.py.mako +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/migration_no_such_table_error/alembic/versions/812a3e5b8517_initial.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/migration_no_such_table_error/alembic/versions/a7ea100a784f_no_such_table_error.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/migration_no_such_table_error/alembic.ini +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/migration_no_such_table_error/makemigration.sh +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/migration_test_database/__init__.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/migration_test_database/alembic/__init__.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/migration_test_database/alembic/env.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/migration_test_database/alembic/script.py.mako +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/migration_test_database/alembic/versions/19789aa5361c_initial.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/migration_test_database/alembic/versions/19d887929ae7_alter.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/migration_test_database/alembic/versions/__init__.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/migration_test_database/alembic.ini +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/migration_test_database/alembic_migration_test_database.sqlite3 +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/migration_test_database/makemigration.sh +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/resources/configs/config.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/resources/configs/test_config.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/resources/configs/test_config_1.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/resources/standard_schemes/DEFAULT-10.yml +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/resources/standard_schemes/DEFAULT-20.yml +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/resources/standard_schemes/LEGACY-0.yml +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/resources/translation/locale/de/LC_MESSAGES/translation.mo +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/resources/translation/locale/de/LC_MESSAGES/translation.po +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/resources/translation/locale/en/LC_MESSAGES/translation.mo +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/resources/translation/locale/en/LC_MESSAGES/translation.po +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/resources/translation/locale/translation.pot +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/resources/translation/translate.sh +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/resources/utils_matching/A-10.yml +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/resources/utils_matching/A-20.yml +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/resources/utils_matching/DEFAULT-10.yml +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/resources/utils_matching/DEFAULT-20.yml +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/resources/utils_matching/DEFAULT-30.yml +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/resources/utils_matching/LEGACY-0.yml +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/resources/utils_matching/TEST-10.yml +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/resources/utils_matching/TEST-20.yml +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/resources/utils_matching/TEST-30.yml +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/resources/utils_matching/TEST-40.yml +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/sentry_main.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/test_access_service_database/alembic/__init__.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/test_access_service_database/alembic/env.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/test_access_service_database/alembic/script.py.mako +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/test_access_service_database/alembic/versions/7bd4fcd38fde_removed_nfc_and_pin.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/test_access_service_database/alembic/versions/9ca98a2e5674_added_parksettings_id.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/test_access_service_database/alembic/versions/c821971f9230_initial.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/test_access_service_database/alembic.ini +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/test_access_service_database/makemigration.sh +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/test_alembic_migrations.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/test_alert.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/test_checks.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/test_config.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/test_connection_status.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/test_core.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/test_database/alembic/__init__.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/test_database/alembic/env.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/test_database/alembic/script.py.mako +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/test_database/alembic/versions/32b8c728abbf_initial.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/test_database/alembic.ini +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/test_database/makemigration.sh +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/test_database.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/test_dispatcher.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/test_health.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/test_interrupt.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/test_io_listen.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/test_kv_store_database/alembic/__init__.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/test_kv_store_database/alembic/env.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/test_kv_store_database/alembic/script.py.mako +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/test_kv_store_database/alembic/versions/9c5c944221f4_deprecated_kv_entry_example.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/test_kv_store_database/alembic/versions/c55a69026a25_initial.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/test_kv_store_database/alembic.ini +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/test_kv_store_database/makemigration.sh +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/test_kv_store_multiple_database/alembic/README +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/test_kv_store_multiple_database/alembic/__init__.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/test_kv_store_multiple_database/alembic/env.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/test_kv_store_multiple_database/alembic/script.py.mako +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/test_kv_store_multiple_database/alembic/versions/cdb3214131a9_initial.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/test_kv_store_multiple_database/alembic.ini +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/test_kv_store_multiple_database/makemigration.sh +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/test_logging.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/test_messaging.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/test_mockrpcclient.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/test_model.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/test_rpc.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/test_schema.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/test_test_alert.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/test_test_gate.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/test_test_zeromq.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/test_utils_access_service.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/test_utils_charset.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/test_utils_cleanup.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/test_utils_csv_export.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/test_utils_databox.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/test_utils_eventlog.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/test_utils_kv_store_multiple.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/test_utils_matching.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/test_utils_misc_functions.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/test_utils_package_reader.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/test_utils_presence.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/test_utils_settings.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/test_utils_validation.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tests/test_utils_vehicle.py +0 -0
- {openmodule-14.0.2 → openmodule-14.0.3}/tox.ini +0 -0
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
CHANGES
|
|
2
2
|
=======
|
|
3
3
|
|
|
4
|
+
v14.0.3
|
|
5
|
+
-------
|
|
6
|
+
|
|
7
|
+
* OM-941 Sentry Bugfix
|
|
8
|
+
|
|
4
9
|
v14.0.2
|
|
5
10
|
-------
|
|
6
11
|
|
|
@@ -166,7 +171,6 @@ v12.0.0.rc0
|
|
|
166
171
|
* settings models update
|
|
167
172
|
* made gate\_control/day\_mode have no scope
|
|
168
173
|
* schedule exports utility
|
|
169
|
-
* SettingsProvider docs
|
|
170
174
|
|
|
171
175
|
v11.1.1
|
|
172
176
|
-------
|
|
@@ -201,8 +205,3 @@ v10.0.5
|
|
|
201
205
|
-------
|
|
202
206
|
|
|
203
207
|
* fixed problem in presence listener
|
|
204
|
-
* README for settings + backend
|
|
205
|
-
|
|
206
|
-
v10.0.4
|
|
207
|
-
-------
|
|
208
|
-
|
|
@@ -36,8 +36,6 @@ def continue_trace_zmq_message_receive(topic: str, message: dict, **kwargs):
|
|
|
36
36
|
:param topic: The topic of the message (as received from the ZMQ socket and decoded)
|
|
37
37
|
:param message: The ZMQMessage as a dict (as received from the ZMQ socket and json loaded)
|
|
38
38
|
"""
|
|
39
|
-
if topic in _topics_to_ignore:
|
|
40
|
-
return noop_context()
|
|
41
39
|
return _continue_trace_zmq_message(topic, message, "topic.receive", **kwargs)
|
|
42
40
|
|
|
43
41
|
|
|
@@ -59,6 +57,7 @@ def trace(
|
|
|
59
57
|
op: Union[sentry_sdk.consts.OP, str] = sentry_sdk.consts.OP.FUNCTION,
|
|
60
58
|
trace_headers: Optional[dict] = None,
|
|
61
59
|
force_new_transaction: bool = False,
|
|
60
|
+
force_no_trace: bool = False,
|
|
62
61
|
**span_kwargs) -> Callable[[Callable], Callable]:
|
|
63
62
|
...
|
|
64
63
|
|
|
@@ -69,6 +68,7 @@ def trace(
|
|
|
69
68
|
op: Union[sentry_sdk.consts.OP, str] = sentry_sdk.consts.OP.FUNCTION,
|
|
70
69
|
trace_headers: Optional[dict] = None,
|
|
71
70
|
force_new_transaction: bool = False,
|
|
71
|
+
force_no_trace: bool = False,
|
|
72
72
|
**span_kwargs) -> Union[Callable, Generator[sentry_sdk.tracing.Span, None, None]]:
|
|
73
73
|
...
|
|
74
74
|
|
|
@@ -79,6 +79,7 @@ def trace(
|
|
|
79
79
|
op: Union[sentry_sdk.consts.OP, str] = sentry_sdk.consts.OP.FUNCTION,
|
|
80
80
|
trace_headers: Optional[dict] = None,
|
|
81
81
|
force_new_transaction: bool = False,
|
|
82
|
+
force_no_trace: bool = False,
|
|
82
83
|
**span_kwargs) -> Callable:
|
|
83
84
|
...
|
|
84
85
|
|
|
@@ -88,6 +89,7 @@ def trace(
|
|
|
88
89
|
op: Union[sentry_sdk.consts.OP, str] = sentry_sdk.consts.OP.FUNCTION,
|
|
89
90
|
trace_headers: Optional[dict] = None,
|
|
90
91
|
force_new_transaction: bool = False,
|
|
92
|
+
force_no_trace: bool = False,
|
|
91
93
|
**span_kwargs):
|
|
92
94
|
"""
|
|
93
95
|
Trace a function or a block of code.
|
|
@@ -97,6 +99,7 @@ def trace(
|
|
|
97
99
|
span_kwargs["op"] = op
|
|
98
100
|
span_kwargs["trace_headers"] = trace_headers
|
|
99
101
|
span_kwargs["force_new_transaction"] = force_new_transaction
|
|
102
|
+
span_kwargs["force_no_trace"] = force_no_trace
|
|
100
103
|
if name is None:
|
|
101
104
|
return _Trace(**span_kwargs)
|
|
102
105
|
elif callable(name):
|
|
@@ -125,7 +128,7 @@ def get_trace_headers(empty_if_not_sampled: bool = False) -> dict:
|
|
|
125
128
|
span = sentry_sdk.get_current_span()
|
|
126
129
|
if span and not span.sampled:
|
|
127
130
|
return {}
|
|
128
|
-
return {"sentry-trace":
|
|
131
|
+
return {"sentry-trace": get_traceparent(), "baggage": get_baggage()}
|
|
129
132
|
|
|
130
133
|
|
|
131
134
|
class _Trace:
|
|
@@ -137,9 +140,11 @@ class _Trace:
|
|
|
137
140
|
force_new_transaction: bool
|
|
138
141
|
ctx: Any
|
|
139
142
|
|
|
140
|
-
def __init__(self, *, trace_headers: Optional[dict] = None, force_new_transaction: bool = False,
|
|
143
|
+
def __init__(self, *, trace_headers: Optional[dict] = None, force_new_transaction: bool = False,
|
|
144
|
+
force_no_trace: bool = False, **span_kwargs):
|
|
141
145
|
self.trace_headers = trace_headers
|
|
142
146
|
self.force_new_transaction = force_new_transaction
|
|
147
|
+
self.force_no_trace = force_no_trace
|
|
143
148
|
self.span_kwargs = span_kwargs
|
|
144
149
|
|
|
145
150
|
@contextmanager
|
|
@@ -149,9 +154,7 @@ class _Trace:
|
|
|
149
154
|
Otherwise, start a new span.
|
|
150
155
|
If given a trace_headers dict, it will continue the trace with the given headers.
|
|
151
156
|
"""
|
|
152
|
-
|
|
153
|
-
yield
|
|
154
|
-
return
|
|
157
|
+
force_no_trace = self.force_no_trace or self.span_kwargs.get("name") in _functions_to_ignore
|
|
155
158
|
|
|
156
159
|
def set_context():
|
|
157
160
|
for key, value in extras.items():
|
|
@@ -166,15 +169,19 @@ class _Trace:
|
|
|
166
169
|
span = sentry_sdk.get_current_span()
|
|
167
170
|
if span is None or self.force_new_transaction:
|
|
168
171
|
with sentry_sdk.isolation_scope():
|
|
169
|
-
|
|
170
|
-
if self.trace_headers and "sentry-trace" in self.trace_headers:
|
|
171
|
-
transaction = sentry_sdk.continue_trace(self.trace_headers, **self.span_kwargs)
|
|
172
|
-
with sentry_sdk.start_transaction(transaction=transaction, **self.span_kwargs) as transaction:
|
|
173
|
-
if transaction:
|
|
174
|
-
transaction.description = transaction.name
|
|
172
|
+
if force_no_trace:
|
|
175
173
|
set_context()
|
|
176
174
|
yield
|
|
177
|
-
|
|
175
|
+
else:
|
|
176
|
+
transaction: Optional[sentry_sdk.tracing.Transaction] = None
|
|
177
|
+
if self.trace_headers and "sentry-trace" in self.trace_headers:
|
|
178
|
+
transaction = sentry_sdk.continue_trace(self.trace_headers, **self.span_kwargs)
|
|
179
|
+
with sentry_sdk.start_transaction(transaction=transaction, **self.span_kwargs) as transaction:
|
|
180
|
+
if transaction:
|
|
181
|
+
transaction.description = transaction.name
|
|
182
|
+
set_context()
|
|
183
|
+
yield
|
|
184
|
+
elif not force_no_trace and span.sampled:
|
|
178
185
|
self.span_kwargs.pop("source", None)
|
|
179
186
|
with sentry_sdk.start_span(**self.span_kwargs):
|
|
180
187
|
set_context()
|
|
@@ -217,7 +224,8 @@ class _Trace:
|
|
|
217
224
|
|
|
218
225
|
def _continue_trace_zmq_message(topic: str, message: dict, op: str, **kwargs):
|
|
219
226
|
name = f"{topic}/{message.get('type', '')}"
|
|
220
|
-
return _Trace(trace_headers=message, op=op, name=name, source="zmq", origin="auto.zmq",
|
|
227
|
+
return _Trace(trace_headers=message, op=op, name=name, source="zmq", origin="auto.zmq",
|
|
228
|
+
force_no_trace=topic in _topics_to_ignore, **kwargs)
|
|
221
229
|
|
|
222
230
|
|
|
223
231
|
class StoringTransport(sentry_sdk.transport.HttpTransport):
|
|
@@ -3,6 +3,7 @@ import logging
|
|
|
3
3
|
import random
|
|
4
4
|
import threading
|
|
5
5
|
import time
|
|
6
|
+
import uuid
|
|
6
7
|
import warnings
|
|
7
8
|
from typing import Type, Optional, List, Union, Dict
|
|
8
9
|
|
|
@@ -193,7 +194,7 @@ class KVStore:
|
|
|
193
194
|
additional_kvs = current_kvs
|
|
194
195
|
return KVSyncResponse(additions=additional_kvs, changes=changed_kvs, missing=missing_kvs)
|
|
195
196
|
|
|
196
|
-
def _log_sync_rpc_response(self, rpc_entry: RPCClient.RPCEntry) -> bool:
|
|
197
|
+
def _log_sync_rpc_response(self, rpc_entry: RPCClient.RPCEntry, conn_id: str) -> bool:
|
|
197
198
|
"""
|
|
198
199
|
Waits for the RPC to finish and logs the response
|
|
199
200
|
:return: if successful
|
|
@@ -203,11 +204,22 @@ class KVStore:
|
|
|
203
204
|
rpc_entry.result(ServerSyncResponse)
|
|
204
205
|
return True
|
|
205
206
|
except RPCClient.TimeoutError:
|
|
206
|
-
|
|
207
|
+
if core().connection_listener.changed(conn_id):
|
|
208
|
+
self.log.warning("Connection loss during sync")
|
|
209
|
+
else:
|
|
210
|
+
self.log.error("Timeout syncing kvs")
|
|
207
211
|
except RPCClient.CancelError:
|
|
208
|
-
|
|
212
|
+
if core().connection_listener.changed(conn_id):
|
|
213
|
+
self.log.warning("Connection loss during sync")
|
|
214
|
+
else:
|
|
215
|
+
self.log.error("Cancelled waiting for result of syncing kvs")
|
|
209
216
|
except RPCClient.ValidationError:
|
|
210
217
|
self.log.exception("Error parsing sync response")
|
|
218
|
+
except RPCClient.RPCServerError as e:
|
|
219
|
+
if len(e.args) > 0 and e.args[0] == "request_timeout" and core().connection_listener.changed(conn_id):
|
|
220
|
+
self.log.warning("Connection loss during sync")
|
|
221
|
+
else:
|
|
222
|
+
self.log.exception("Error on server side in sync")
|
|
211
223
|
except (RPCClient.ServerHandlerError, RPCClient.ServerValidationError, RPCClient.ServerFilterError):
|
|
212
224
|
self.log.exception("Error on server side in sync")
|
|
213
225
|
except Exception:
|
|
@@ -215,9 +227,9 @@ class KVStore:
|
|
|
215
227
|
return False
|
|
216
228
|
|
|
217
229
|
@sentry.trace
|
|
218
|
-
def sync(self) -> bool:
|
|
230
|
+
def sync(self, conn_id: str) -> bool:
|
|
219
231
|
self.sync_rpc_entry = self.sync_with_server()
|
|
220
|
-
success = self._log_sync_rpc_response(self.sync_rpc_entry)
|
|
232
|
+
success = self._log_sync_rpc_response(self.sync_rpc_entry, conn_id)
|
|
221
233
|
self.sync_rpc_entry = None
|
|
222
234
|
if success: # if sync was successful cancel retries
|
|
223
235
|
return True
|
|
@@ -291,6 +303,7 @@ class KVStoreHandler:
|
|
|
291
303
|
|
|
292
304
|
def run(self):
|
|
293
305
|
"""We only sync on startup and on reconnect"""
|
|
306
|
+
conn_id = uuid.uuid4().hex
|
|
294
307
|
try:
|
|
295
308
|
while self.running:
|
|
296
309
|
if self._wait_for_change_to_online():
|
|
@@ -305,7 +318,8 @@ class KVStoreHandler:
|
|
|
305
318
|
ConnectionStatus.online):
|
|
306
319
|
# cancel trying to sync if offline
|
|
307
320
|
break
|
|
308
|
-
|
|
321
|
+
core().connection_listener.changed(conn_id)
|
|
322
|
+
if store.sync(conn_id):
|
|
309
323
|
# if sync was successful cancel retries
|
|
310
324
|
break
|
|
311
325
|
# we try again as long we are still alive
|
|
@@ -347,7 +361,7 @@ class KVStoreWithChangedNotification(KVStore):
|
|
|
347
361
|
changed += list(old_values.keys())
|
|
348
362
|
return changed
|
|
349
363
|
|
|
350
|
-
def _send_changed_notification(self, new_values: Dict[str, str], old_values: Dict[str, str]):
|
|
364
|
+
def _send_changed_notification(self, new_values: Dict[str, str], old_values: Dict[str, str]): # pragma: no cover
|
|
351
365
|
"""
|
|
352
366
|
consider using self._find_changed_kvs when implementing this
|
|
353
367
|
also make sure your db model has a meaningful `comparison_value` method
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"git_version": "03b80ec", "is_release": true}
|
|
@@ -173,7 +173,6 @@ class SentryInitTestCase(ZMQTestMixin):
|
|
|
173
173
|
self.assertEqual(sentry._topics_to_ignore, ["io"])
|
|
174
174
|
self.assertEqual(sentry._functions_to_ignore, ["message_handler.openmodule.utils.io.IoListener._on_io_message"])
|
|
175
175
|
|
|
176
|
-
|
|
177
176
|
@override_settings(NAME="test")
|
|
178
177
|
def test_service_name_generation(self):
|
|
179
178
|
settings.NAME = "om_service_test_1"
|
|
@@ -449,6 +448,7 @@ class SentryTestCase(SentryTestMixin):
|
|
|
449
448
|
self.assertEqual(len(envelopes[0].items), 1)
|
|
450
449
|
self.assertEqual(envelopes[0].items[0].payload.json["transaction"], "not-test-ignore")
|
|
451
450
|
|
|
451
|
+
|
|
452
452
|
class SentryInDispatcherTestCase(SentryTestMixin):
|
|
453
453
|
def setUp(self):
|
|
454
454
|
super().setUp()
|
|
@@ -488,6 +488,15 @@ class SentryInDispatcherTestCase(SentryTestMixin):
|
|
|
488
488
|
with self.assertRaises(TimeoutError):
|
|
489
489
|
self.get_sent_envelopes()
|
|
490
490
|
|
|
491
|
+
def test_io_topic_creates_scope(self):
|
|
492
|
+
scope = sentry_sdk.get_isolation_scope()
|
|
493
|
+
with sentry.continue_trace_zmq_message_receive(
|
|
494
|
+
"io", {"sentry-trace": "e6b4de069f9a4e03b7012bb1eec1af08-a7d7309ad4ccc9ec-1"}):
|
|
495
|
+
self.assertNotEqual(scope, sentry_sdk.get_isolation_scope())
|
|
496
|
+
self.assertEqual(scope, sentry_sdk.get_isolation_scope())
|
|
497
|
+
with self.assertRaises(TimeoutError):
|
|
498
|
+
self.get_sent_envelopes()
|
|
499
|
+
|
|
491
500
|
def test_multi_worker_dispatcher(self):
|
|
492
501
|
def handler(*_):
|
|
493
502
|
envelopes_got.wait(1)
|
|
@@ -759,7 +768,7 @@ class SentryTraceCpuUsageTestCase(TestCase):
|
|
|
759
768
|
import psutil
|
|
760
769
|
helper = SentryTraceHelper(self.execution_count, self.sleep_time)
|
|
761
770
|
|
|
762
|
-
self.processes.append(multiprocessing.Process(target=helper.
|
|
771
|
+
self.processes.append(multiprocessing.Process(target=helper.sentry_io))
|
|
763
772
|
self.processes.append(multiprocessing.Process(target=helper.fake))
|
|
764
773
|
for process in self.processes:
|
|
765
774
|
process.start()
|
|
@@ -809,21 +818,45 @@ class SentryTraceHelper:
|
|
|
809
818
|
sentry_sdk.start_transaction = self.fake_trace
|
|
810
819
|
self.sentry()
|
|
811
820
|
|
|
821
|
+
@staticmethod
|
|
822
|
+
def make_core(traces_sample_rate=0.001):
|
|
823
|
+
settings.LOG_LEVEL = "WARNING"
|
|
824
|
+
settings.TESTING = True
|
|
825
|
+
settings.DEBUG = False
|
|
826
|
+
sentry_sdk.utils.logger.setLevel(logging.WARNING)
|
|
827
|
+
logging.basicConfig(level=logging.WARNING)
|
|
828
|
+
return init_openmodule(settings, wait_for_broker=False, traces_sample_rate=traces_sample_rate,
|
|
829
|
+
sentry=True, dsn="http://test@test/1")
|
|
830
|
+
|
|
812
831
|
def trace_all(self):
|
|
813
832
|
self.sentry(traces_sample_rate=1.0)
|
|
814
833
|
|
|
834
|
+
@staticmethod
|
|
835
|
+
def _sentry_traceparent(traces_sample_rate=0.001):
|
|
836
|
+
return f"e6b4de069f9a4e03b7012bb1eec1af08-a7d7309ad4ccc9ec-{int(random.random() < traces_sample_rate)}"
|
|
837
|
+
|
|
838
|
+
def sentry_io(self, traces_sample_rate=0.001):
|
|
839
|
+
core = None
|
|
840
|
+
try:
|
|
841
|
+
core = self.make_core(traces_sample_rate)
|
|
842
|
+
IoListener(core.messages)
|
|
843
|
+
for _ in range(self.execution_count):
|
|
844
|
+
message = {"edge": 1, "gateway": {"gate": "test", "direction": "in"}, "type": "io", "pin": "1",
|
|
845
|
+
"value": 1, "sentry-trace": self._sentry_traceparent(traces_sample_rate)}
|
|
846
|
+
with sentry.continue_trace_zmq_message_receive("io", message):
|
|
847
|
+
core.messages.dispatch("io", message)
|
|
848
|
+
time.sleep(self.sleep_time)
|
|
849
|
+
finally:
|
|
850
|
+
if core:
|
|
851
|
+
shutdown_openmodule()
|
|
852
|
+
|
|
815
853
|
def sentry(self, traces_sample_rate=0.001):
|
|
854
|
+
from openmodule.models.base import CostEntryData
|
|
855
|
+
|
|
816
856
|
rpc_server = None
|
|
817
857
|
core = None
|
|
818
858
|
try:
|
|
819
|
-
|
|
820
|
-
settings.LOG_LEVEL = "WARNING"
|
|
821
|
-
settings.TESTING = True
|
|
822
|
-
settings.DEBUG = False
|
|
823
|
-
sentry_sdk.utils.logger.setLevel(logging.WARNING)
|
|
824
|
-
logging.basicConfig(level=logging.WARNING)
|
|
825
|
-
core = init_openmodule(settings, wait_for_broker=False, traces_sample_rate=traces_sample_rate,
|
|
826
|
-
sentry=True, dsn="http://test@test/1")
|
|
859
|
+
core = self.make_core(traces_sample_rate)
|
|
827
860
|
sentry_sdk.get_client().transport.envelope_store = "/tmp/envelope_store"
|
|
828
861
|
rpc_server = RPCServer(core.context)
|
|
829
862
|
rpc_server.register_handler("test", "test", CostEntryData, CostEntryData, self.fake_handler,
|
|
@@ -831,8 +864,7 @@ class SentryTraceHelper:
|
|
|
831
864
|
for _ in range(self.execution_count):
|
|
832
865
|
# noinspection PyProtectedMember
|
|
833
866
|
rpc_server._process_rpc_message("rpc-req-test", {
|
|
834
|
-
"sentry-trace":
|
|
835
|
-
f"{int(random.random() < traces_sample_rate)}",
|
|
867
|
+
"sentry-trace": self._sentry_traceparent(traces_sample_rate),
|
|
836
868
|
"rpc_id": "ef9a5e77-bc95-404c-94de-9cf7b326c4d5", "resource": settings.RESOURCE, "type": "test",
|
|
837
869
|
"request": {"entry_type": "rate_change", "value": "test1", "group": "test", "account_id": "test"}})
|
|
838
870
|
time.sleep(self.sleep_time)
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import threading
|
|
2
2
|
import time
|
|
3
|
+
import uuid
|
|
3
4
|
from typing import List, Dict
|
|
4
5
|
|
|
5
6
|
from sqlalchemy import Column, String
|
|
@@ -7,7 +8,7 @@ from sqlalchemy.exc import SQLAlchemyError
|
|
|
7
8
|
from sqlalchemy.ext.declarative import declarative_base
|
|
8
9
|
|
|
9
10
|
from openmodule.config import settings
|
|
10
|
-
from openmodule.connection_status import ConnectionStatus
|
|
11
|
+
from openmodule.connection_status import ConnectionStatus, ConnectionStatusMessage
|
|
11
12
|
from openmodule.core import core
|
|
12
13
|
from openmodule.models.kv_store import KVSetRequest, KVSetRequestKV, KVSyncRequest, KVSetResponse, KVSyncResponse, \
|
|
13
14
|
ServerSyncResponse
|
|
@@ -317,8 +318,10 @@ class KVStoreRPCTestCase(SQLiteTestMixin, RPCServerTestMixin, OpenModuleCoreTest
|
|
|
317
318
|
session.commit()
|
|
318
319
|
|
|
319
320
|
self.kv_store.rpc_client = MockRPCClient(responses={("rpc-websocket", "server_rpc"): start_sync()})
|
|
321
|
+
conn_id = uuid.uuid4().hex
|
|
322
|
+
self.core.connection_listener.changed(conn_id)
|
|
320
323
|
entry = self.kv_store.sync_with_server()
|
|
321
|
-
self.kv_store._log_sync_rpc_response(entry)
|
|
324
|
+
self.kv_store._log_sync_rpc_response(entry, conn_id)
|
|
322
325
|
|
|
323
326
|
def test_sync_errors(self):
|
|
324
327
|
def raise_error(*_):
|
|
@@ -327,31 +330,51 @@ class KVStoreRPCTestCase(SQLiteTestMixin, RPCServerTestMixin, OpenModuleCoreTest
|
|
|
327
330
|
def wrong_response(*_):
|
|
328
331
|
return {}
|
|
329
332
|
|
|
333
|
+
conn_id = uuid.uuid4().hex
|
|
334
|
+
|
|
330
335
|
# status error
|
|
336
|
+
self.core.connection_listener.changed(conn_id)
|
|
331
337
|
self.rpc_server.register_handler("rpc-websocket", "server_rpc", ServerRPCRequest, ServerSyncResponse,
|
|
332
338
|
raise_error, register_schema=False)
|
|
333
339
|
entry = self.kv_store.sync_with_server()
|
|
334
340
|
with self.assertLogs() as cm:
|
|
335
|
-
success = self.kv_store._log_sync_rpc_response(entry)
|
|
341
|
+
success = self.kv_store._log_sync_rpc_response(entry, conn_id)
|
|
336
342
|
self.assertIn("Error on server side in sync", str(cm.output))
|
|
337
343
|
self.assertFalse(success)
|
|
338
344
|
|
|
339
345
|
# Un-parseable response
|
|
346
|
+
self.core.connection_listener.changed(conn_id)
|
|
340
347
|
entry = RPCClient.RPCEntry(0)
|
|
341
348
|
entry.response = "test"
|
|
342
349
|
with self.assertLogs() as cm:
|
|
343
|
-
success = self.kv_store._log_sync_rpc_response(entry)
|
|
350
|
+
success = self.kv_store._log_sync_rpc_response(entry, conn_id)
|
|
344
351
|
self.assertIn("Unexpected exception in sync response", str(cm.output))
|
|
345
352
|
self.assertFalse(success)
|
|
346
353
|
|
|
347
354
|
# timeout
|
|
355
|
+
self.core.connection_listener.changed(conn_id)
|
|
348
356
|
del self.rpc_server.handlers[("rpc-websocket", "server_rpc")]
|
|
349
357
|
entry = self.kv_store.sync_with_server()
|
|
350
358
|
with self.assertLogs() as cm:
|
|
351
|
-
success = self.kv_store._log_sync_rpc_response(entry)
|
|
359
|
+
success = self.kv_store._log_sync_rpc_response(entry, conn_id)
|
|
352
360
|
self.assertIn("Timeout syncing kvs", str(cm.output))
|
|
353
361
|
self.assertFalse(success)
|
|
354
362
|
|
|
363
|
+
def test_connection_loss_warning(self):
|
|
364
|
+
conn_id = uuid.uuid4().hex
|
|
365
|
+
self.core.connection_listener._process_connection_status(
|
|
366
|
+
ConnectionStatusMessage(connected=ConnectionStatus.online))
|
|
367
|
+
self.core.connection_listener.changed(conn_id)
|
|
368
|
+
self.core.connection_listener._process_connection_status(
|
|
369
|
+
ConnectionStatusMessage(connected=ConnectionStatus.shutdown))
|
|
370
|
+
entry = self.kv_store.sync_with_server()
|
|
371
|
+
with self.assertLogs() as cm:
|
|
372
|
+
success = self.kv_store._log_sync_rpc_response(entry, conn_id)
|
|
373
|
+
self.assertIn("Connection loss during sync", str(cm.output))
|
|
374
|
+
self.assertEqual(len(cm.output), 1)
|
|
375
|
+
self.assertFalse(success)
|
|
376
|
+
|
|
377
|
+
|
|
355
378
|
|
|
356
379
|
class KVStoreSyncTriggerTestCase(OpenModuleCoreTestMixin):
|
|
357
380
|
def setUp(self) -> None:
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"git_version": "3399243", "is_release": true}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|