From 339c6082d31d44148c53c0236a406da9ebf543e2 Mon Sep 17 00:00:00 2001 From: Ant Date: Wed, 15 Oct 2025 12:12:36 -0400 Subject: [PATCH 01/20] #387 - Testing do not pull into main! --- src/senzing_core/szabstractfactory.py | 56 +++++++++++++++++++++------ 1 file changed, 44 insertions(+), 12 deletions(-) diff --git a/src/senzing_core/szabstractfactory.py b/src/senzing_core/szabstractfactory.py index 915dd257..92830e54 100644 --- a/src/senzing_core/szabstractfactory.py +++ b/src/senzing_core/szabstractfactory.py @@ -96,6 +96,32 @@ class SzAbstractFactoryCore(SzAbstractFactory): _engine_instances = weakref.WeakValueDictionary() # type: ignore[var-annotated] _factory_instances = weakref.WeakValueDictionary() # type: ignore[var-annotated] + # TODO - + # def __new__( + # cls, + # instance_name: str = "", + # settings: Union[str, Dict[Any, Any]] = "", + # config_id: int = 0, + # verbose_logging: int = 0, + # ) -> SzAbstractFactoryCore: + + # with cls._constructor_lock: + # args_hash = cls._create_args_hash(instance_name, settings, config_id, verbose_logging) + # instance = super().__new__(cls) + # instance._args_hash = args_hash # type: ignore[attr-defined] + + # if cls not in cls._factory_instances.keys(): + # cls._factory_instances[cls] = instance + # else: + # if args_hash == cls._factory_instances[cls]._args_hash: + # instance = cls._factory_instances[cls] + + # if args_hash != cls._factory_instances[cls]._args_hash: + # raise SzSdkError( + # "an abstract factory instance exists with different arguments, to use new arguments destroy the active instance first (NOTE: This will destroy Senzing objects created by the active instance!)" + # ) + + # return instance def __new__( cls, instance_name: str = "", @@ -106,21 +132,27 @@ def __new__( with cls._constructor_lock: args_hash = cls._create_args_hash(instance_name, settings, config_id, verbose_logging) - instance = super().__new__(cls) - instance._args_hash = args_hash # type: ignore[attr-defined] + # instance = super().__new__(cls) + # instance._args_hash = args_hash # type: ignore[attr-defined] if cls not in cls._factory_instances.keys(): - cls._factory_instances[cls] = instance - else: - if args_hash == cls._factory_instances[cls]._args_hash: - instance = cls._factory_instances[cls] + # cls._factory_instances[cls] = instance + new_instance = super().__new__(cls) + new_instance._args_hash = args_hash # type: ignore[attr-defined] + cls._factory_instances[cls] = new_instance + return new_instance + + # else: + if args_hash == cls._factory_instances[cls]._args_hash: + current_instance: SzAbstractFactoryCore = cls._factory_instances[cls] + # return cls._factory_instances[cls] + return current_instance + # else: + # if args_hash != cls._factory_instances[cls]._args_hash: - if args_hash != cls._factory_instances[cls]._args_hash: - raise SzSdkError( - "an abstract factory instance exists with different arguments, to use new arguments destroy the active instance first (NOTE: This will destroy Senzing objects created by the active instance!)" - ) - - return instance + raise SzSdkError( + "an abstract factory instance exists with different arguments, to use new arguments destroy the active instance first (NOTE: This will destroy Senzing objects created by the active instance!)" + ) def __init__( self, From 3eb89d9114102026421aba69a585668a17847777 Mon Sep 17 00:00:00 2001 From: Ant Date: Wed, 15 Oct 2025 13:03:38 -0400 Subject: [PATCH 02/20] #387 - Testing do not pull into main! --- src/senzing_core/szabstractfactory.py | 25 + tests/{helpers_test.py => helpers_.py} | 0 tests/szabstractfactory_test.py | 922 +++++++++--------- tests/{szconfig_test.py => szconfig_.py} | 0 ...figmanager_test.py => szconfigmanager_.py} | 0 ...{szdiagnostic_test.py => szdiagnostic_.py} | 0 tests/{szengine_test.py => szengine_.py} | 0 tests/{szproduct_test.py => szproduct_.py} | 0 8 files changed, 486 insertions(+), 461 deletions(-) rename tests/{helpers_test.py => helpers_.py} (100%) rename tests/{szconfig_test.py => szconfig_.py} (100%) rename tests/{szconfigmanager_test.py => szconfigmanager_.py} (100%) rename tests/{szdiagnostic_test.py => szdiagnostic_.py} (100%) rename tests/{szengine_test.py => szengine_.py} (100%) rename tests/{szproduct_test.py => szproduct_.py} (100%) diff --git a/src/senzing_core/szabstractfactory.py b/src/senzing_core/szabstractfactory.py index 92830e54..48cc0fbf 100644 --- a/src/senzing_core/szabstractfactory.py +++ b/src/senzing_core/szabstractfactory.py @@ -131,11 +131,15 @@ def __new__( ) -> SzAbstractFactoryCore: with cls._constructor_lock: + # TODO - + print("\nIn factory __new__...", flush=True) args_hash = cls._create_args_hash(instance_name, settings, config_id, verbose_logging) # instance = super().__new__(cls) # instance._args_hash = args_hash # type: ignore[attr-defined] if cls not in cls._factory_instances.keys(): + # TODO - + print("\tCreating new factory", flush=True) # cls._factory_instances[cls] = instance new_instance = super().__new__(cls) new_instance._args_hash = args_hash # type: ignore[attr-defined] @@ -144,12 +148,16 @@ def __new__( # else: if args_hash == cls._factory_instances[cls]._args_hash: + # TODO - + print("\tReturning current factory", flush=True) current_instance: SzAbstractFactoryCore = cls._factory_instances[cls] # return cls._factory_instances[cls] return current_instance # else: # if args_hash != cls._factory_instances[cls]._args_hash: + # TODO - + print("\tRaising SzSdkError", flush=True) raise SzSdkError( "an abstract factory instance exists with different arguments, to use new arguments destroy the active instance first (NOTE: This will destroy Senzing objects created by the active instance!)" ) @@ -257,20 +265,31 @@ def create_product(self) -> SzProduct: @_check_is_destroyed @_method_lock def destroy(self) -> None: + # TODO - + print("\nIn destroy() calling finalizer", flush=True) self._finalizer() @staticmethod def _do_destroy() -> None: + # TODO - + print("\nIn _do_destroy()", flush=True) + with suppress(KeyError, SzSdkError): for engine_object in SzAbstractFactoryCore._engine_instances.values(): + # TODO - + print(f"\tDestroying engine instance in _engine_instances: {engine_object}", flush=True) engine_object._destroy() # pylint: disable=protected-access engine_object._is_destroyed = True # pylint: disable=protected-access SzAbstractFactoryCore._engine_instances.clear() + # TODO - + print("\nStarting to destroy real engine objects...", flush=True) sz_destroy_configmanager = SzConfigManagerCore() while True: try: + # TODO - + print("\tSzConfigManagerCore", flush=True) sz_destroy_configmanager._internal_only_destroy() # pylint: disable=protected-access except SzNotInitializedError: break @@ -278,6 +297,8 @@ def _do_destroy() -> None: sz_destroy_diagnostic = SzDiagnosticCore() while True: try: + # TODO - + print("\rSzDiagnosticCore", flush=True) sz_destroy_diagnostic._internal_only_destroy() # pylint: disable=protected-access except SzNotInitializedError: break @@ -285,6 +306,8 @@ def _do_destroy() -> None: sz_destroy_engine = SzEngineCore() while True: try: + # TODO - + print("\tSzEngineCore", flush=True) sz_destroy_engine._internal_only_destroy() # pylint: disable=protected-access except SzNotInitializedError: break @@ -292,6 +315,8 @@ def _do_destroy() -> None: sz_destroy_product = SzProductCore() while True: try: + # TODO - + print("\tSzProductCore", flush=True) sz_destroy_product._internal_only_destroy() # pylint: disable=protected-access except SzNotInitializedError: break diff --git a/tests/helpers_test.py b/tests/helpers_.py similarity index 100% rename from tests/helpers_test.py rename to tests/helpers_.py diff --git a/tests/szabstractfactory_test.py b/tests/szabstractfactory_test.py index 8e281571..f033658b 100755 --- a/tests/szabstractfactory_test.py +++ b/tests/szabstractfactory_test.py @@ -55,536 +55,521 @@ def test_create_configmanager(sz_abstractfactory: SzAbstractFactory) -> None: assert isinstance(actual, SzConfigManager) -def test_create_diagnostic(sz_abstractfactory: SzAbstractFactory) -> None: - """Test SzAbstractFactory.create_diagnostic().""" - actual = sz_abstractfactory.create_diagnostic() - assert isinstance(actual, SzDiagnostic) +# def test_create_diagnostic(sz_abstractfactory: SzAbstractFactory) -> None: +# """Test SzAbstractFactory.create_diagnostic().""" +# actual = sz_abstractfactory.create_diagnostic() +# assert isinstance(actual, SzDiagnostic) -def test_create_engine(sz_abstractfactory: SzAbstractFactory) -> None: - """Test SzAbstractFactory.create_engine().""" - actual = sz_abstractfactory.create_engine() - assert isinstance(actual, SzEngine) +# def test_create_engine(sz_abstractfactory: SzAbstractFactory) -> None: +# """Test SzAbstractFactory.create_engine().""" +# actual = sz_abstractfactory.create_engine() +# assert isinstance(actual, SzEngine) -def test_create_product(sz_abstractfactory: SzAbstractFactory) -> None: - """Test SzAbstractFactory.create_product().""" - actual = sz_abstractfactory.create_product() - assert isinstance(actual, SzProduct) +# def test_create_product(sz_abstractfactory: SzAbstractFactory) -> None: +# """Test SzAbstractFactory.create_product().""" +# actual = sz_abstractfactory.create_product() +# assert isinstance(actual, SzProduct) -def test_help_1(sz_abstractfactory: SzAbstractFactory) -> None: - """Test SzAbstractFactory.help().""" - sz_abstractfactory.help() +# def test_help_1(sz_abstractfactory: SzAbstractFactory) -> None: +# """Test SzAbstractFactory.help().""" +# sz_abstractfactory.help() -def test_help_2(sz_abstractfactory: SzAbstractFactory) -> None: - """Test SzAbstractFactory.help(...).""" - sz_abstractfactory.help("create_configmanager") +# def test_help_2(sz_abstractfactory: SzAbstractFactory) -> None: +# """Test SzAbstractFactory.help(...).""" +# sz_abstractfactory.help("create_configmanager") -def test_reinitialize(sz_abstractfactory: SzAbstractFactory) -> None: - """Test SzAbstractFactory.reinitialize().""" - datasource = "TEST_FACTORY_REINIT" +# def test_reinitialize(sz_abstractfactory: SzAbstractFactory) -> None: +# """Test SzAbstractFactory.reinitialize().""" +# datasource = "TEST_FACTORY_REINIT" - # Create Senzing objects. - sz_diagnostic = sz_abstractfactory.create_diagnostic() - sz_engine = sz_abstractfactory.create_engine() - sz_configmanager = sz_abstractfactory.create_configmanager() - current_config_id = sz_configmanager.get_default_config_id() - sz_config = sz_configmanager.create_config_from_config_id(current_config_id) +# # Create Senzing objects. +# sz_diagnostic = sz_abstractfactory.create_diagnostic() +# sz_engine = sz_abstractfactory.create_engine() +# sz_configmanager = sz_abstractfactory.create_configmanager() +# current_config_id = sz_configmanager.get_default_config_id() +# sz_config = sz_configmanager.create_config_from_config_id(current_config_id) - # Use engines - _ = sz_diagnostic.get_repository_info() - _ = sz_engine.add_record("TEST", "787B", '{"NAME_FULL":"Testy McTester"}') - active_id_1 = sz_engine.get_active_config_id() +# # Use engines +# _ = sz_diagnostic.get_repository_info() +# _ = sz_engine.add_record("TEST", "787B", '{"NAME_FULL":"Testy McTester"}') +# active_id_1 = sz_engine.get_active_config_id() - # Add DataSources to Senzing configuration. - sz_config.register_data_source(datasource) +# # Add DataSources to Senzing configuration. +# sz_config.register_data_source(datasource) - # Persist new Senzing configuration. - config_definition = sz_config.export() - new_config_id = sz_configmanager.register_config(config_definition, "Test") - sz_configmanager.replace_default_config_id(current_config_id, new_config_id) +# # Persist new Senzing configuration. +# config_definition = sz_config.export() +# new_config_id = sz_configmanager.register_config(config_definition, "Test") +# sz_configmanager.replace_default_config_id(current_config_id, new_config_id) - # Update other Senzing objects. - sz_abstractfactory.reinitialize(new_config_id) +# # Update other Senzing objects. +# sz_abstractfactory.reinitialize(new_config_id) - # # Use engines - _ = sz_diagnostic.get_repository_info() - _ = sz_engine.add_record(datasource, "767B", '{"NAME_FULL":"McTester Testy"}') - active_id_2 = sz_engine.get_active_config_id() +# # # Use engines +# _ = sz_diagnostic.get_repository_info() +# _ = sz_engine.add_record(datasource, "767B", '{"NAME_FULL":"McTester Testy"}') +# active_id_2 = sz_engine.get_active_config_id() - assert active_id_1 != active_id_2 +# assert active_id_1 != active_id_2 -# NOTE - ignore is for https://github.com/python/mypy/issues/1465 -def test_property_instance_name(sz_abstractfactory: SzAbstractFactory) -> None: - """Test SzAbstractFactory.instance_name.""" - actual = sz_abstractfactory.instance_name # type: ignore[attr-defined] - assert isinstance(actual, str) +# # NOTE - ignore is for https://github.com/python/mypy/issues/1465 +# def test_property_instance_name(sz_abstractfactory: SzAbstractFactory) -> None: +# """Test SzAbstractFactory.instance_name.""" +# actual = sz_abstractfactory.instance_name # type: ignore[attr-defined] +# assert isinstance(actual, str) -def test_property_is_destroyed(sz_abstractfactory: SzAbstractFactory) -> None: - """Test SzAbstractFactory.is_destroyed.""" - actual = sz_abstractfactory.is_destroyed # type: ignore[attr-defined] - assert isinstance(actual, bool) +# def test_property_is_destroyed(sz_abstractfactory: SzAbstractFactory) -> None: +# """Test SzAbstractFactory.is_destroyed.""" +# actual = sz_abstractfactory.is_destroyed # type: ignore[attr-defined] +# assert isinstance(actual, bool) -def test_property_settings(sz_abstractfactory: SzAbstractFactory) -> None: - """Test SzAbstractFactory.settings.""" - actual = sz_abstractfactory.settings # type: ignore[attr-defined] - assert isinstance(actual, (str, dict)) +# def test_property_settings(sz_abstractfactory: SzAbstractFactory) -> None: +# """Test SzAbstractFactory.settings.""" +# actual = sz_abstractfactory.settings # type: ignore[attr-defined] +# assert isinstance(actual, (str, dict)) -def test_property_config_id(sz_abstractfactory: SzAbstractFactory) -> None: - """Test SzAbstractFactory.config_id.""" - actual = sz_abstractfactory.config_id # type: ignore[attr-defined] - assert isinstance(actual, int) +# def test_property_config_id(sz_abstractfactory: SzAbstractFactory) -> None: +# """Test SzAbstractFactory.config_id.""" +# actual = sz_abstractfactory.config_id # type: ignore[attr-defined] +# assert isinstance(actual, int) -def test_property_verbose_logging(sz_abstractfactory: SzAbstractFactory) -> None: - """Test SzAbstractFactory.verbose_logging.""" - actual = sz_abstractfactory.verbose_logging # type: ignore[attr-defined] - assert isinstance(actual, int) +# def test_property_verbose_logging(sz_abstractfactory: SzAbstractFactory) -> None: +# """Test SzAbstractFactory.verbose_logging.""" +# actual = sz_abstractfactory.verbose_logging # type: ignore[attr-defined] +# assert isinstance(actual, int) -def test_delete_factory(engine_vars: Dict[Any, Any]) -> None: - """Test delete on SzAbstractFactory doesn't allow use""" - factory_parameters = {"instance_name": "Example_1", "settings": engine_vars.get("SETTINGS_DICT", {})} - sz_factory = SzAbstractFactoryCore(**factory_parameters) - sz_configmanager = sz_factory.create_configmanager() - sz_diagnostic = sz_factory.create_diagnostic() - sz_engine = sz_factory.create_engine() - sz_product = sz_factory.create_product() - del sz_factory +# def test_delete_factory(engine_vars: Dict[Any, Any]) -> None: +# """Test delete on SzAbstractFactory doesn't allow use""" +# factory_parameters = {"instance_name": "Example_1", "settings": engine_vars.get("SETTINGS_DICT", {})} +# sz_factory = SzAbstractFactoryCore(**factory_parameters) +# sz_configmanager = sz_factory.create_configmanager() +# sz_diagnostic = sz_factory.create_diagnostic() +# sz_engine = sz_factory.create_engine() +# sz_product = sz_factory.create_product() +# del sz_factory - with pytest.raises(SzSdkError): - sz_configmanager.get_default_config_id() +# with pytest.raises(SzSdkError): +# sz_configmanager.get_default_config_id() - with pytest.raises(SzSdkError): - sz_diagnostic.get_repository_info() +# with pytest.raises(SzSdkError): +# sz_diagnostic.get_repository_info() - with pytest.raises(SzSdkError): - sz_engine.get_active_config_id() +# with pytest.raises(SzSdkError): +# sz_engine.get_active_config_id() - with pytest.raises(SzSdkError): - sz_product.get_version() +# with pytest.raises(SzSdkError): +# sz_product.get_version() -def test_is_destroyed(sz_abstractfactory: SzAbstractFactory) -> None: - """Test destroying SzAbstractFactory also marks factory as destroyed""" - sz_abstractfactory.destroy() - assert sz_abstractfactory._is_destroyed # type: ignore [attr-defined] +# def test_is_destroyed(sz_abstractfactory: SzAbstractFactory) -> None: +# """Test destroying SzAbstractFactory also marks factory as destroyed""" +# sz_abstractfactory.destroy() +# assert sz_abstractfactory._is_destroyed # type: ignore [attr-defined] -def test_destroy_empty_weakref_dicts(sz_abstractfactory: SzAbstractFactory) -> None: - """Test destroying SzAbstractFactory resets class variables for weak references""" - sz_abstractfactory.destroy() - assert len(SzAbstractFactoryCore._engine_instances) == 0 - assert len(SzAbstractFactoryCore._factory_instances) == 0 +# def test_destroy_empty_weakref_dicts(sz_abstractfactory: SzAbstractFactory) -> None: +# """Test destroying SzAbstractFactory resets class variables for weak references""" +# sz_abstractfactory.destroy() +# assert len(SzAbstractFactoryCore._engine_instances) == 0 +# assert len(SzAbstractFactoryCore._factory_instances) == 0 -def test_destroy_method_calls(sz_abstractfactory: SzAbstractFactory) -> None: - """Test destroying SzAbstractFactory doesn't allow method use""" - sz_abstractfactory.destroy() - with pytest.raises(SzSdkError): - sz_abstractfactory.create_engine() +# def test_destroy_method_calls(sz_abstractfactory: SzAbstractFactory) -> None: +# """Test destroying SzAbstractFactory doesn't allow method use""" +# sz_abstractfactory.destroy() +# with pytest.raises(SzSdkError): +# sz_abstractfactory.create_engine() -def test_destroy_create_new_factory(engine_vars: Dict[Any, Any]) -> None: - """Test destroying SzAbstractFactory allows a new factory""" - factory_parameters = {"instance_name": "Example_1", "settings": engine_vars.get("SETTINGS_DICT", {})} - factory_1 = SzAbstractFactoryCore(**factory_parameters) - factory_1.destroy() - factory_2 = SzAbstractFactoryCore(**factory_parameters) - assert not factory_2.is_destroyed +# def test_destroy_create_new_factory(engine_vars: Dict[Any, Any]) -> None: +# """Test destroying SzAbstractFactory allows a new factory""" +# factory_parameters = {"instance_name": "Example_1", "settings": engine_vars.get("SETTINGS_DICT", {})} +# factory_1 = SzAbstractFactoryCore(**factory_parameters) +# factory_1.destroy() +# factory_2 = SzAbstractFactoryCore(**factory_parameters) +# assert not factory_2.is_destroyed -def test_destroy_create_new_factory_different_arguments(engine_vars: Dict[Any, Any]) -> None: - """Test destroying SzAbstractFactory allows a new factory with different arguments""" - factory_parameters_1 = {"instance_name": "Example_1", "settings": engine_vars.get("SETTINGS_DICT", {})} - factory_parameters_2 = {"instance_name": "Example_2", "settings": engine_vars.get("SETTINGS_DICT", {})} - factory_1 = SzAbstractFactoryCore(**factory_parameters_1) - factory_1.destroy() - factory_2 = SzAbstractFactoryCore(**factory_parameters_2) - assert not factory_2.is_destroyed +# def test_destroy_create_new_factory_different_arguments(engine_vars: Dict[Any, Any]) -> None: +# """Test destroying SzAbstractFactory allows a new factory with different arguments""" +# factory_parameters_1 = {"instance_name": "Example_1", "settings": engine_vars.get("SETTINGS_DICT", {})} +# factory_parameters_2 = {"instance_name": "Example_2", "settings": engine_vars.get("SETTINGS_DICT", {})} +# factory_1 = SzAbstractFactoryCore(**factory_parameters_1) +# factory_1.destroy() +# factory_2 = SzAbstractFactoryCore(**factory_parameters_2) +# assert not factory_2.is_destroyed -def test_destroy_create_new_factory_with_work(engine_vars: Dict[Any, Any]) -> None: - """Test destroying SzAbstractFactory allows a new factory with work""" - factory_parameters_1 = {"instance_name": "Example_1", "settings": engine_vars.get("SETTINGS_DICT", {})} - factory_parameters_2 = {"instance_name": "Example_2", "settings": engine_vars.get("SETTINGS_DICT", {})} - factory_1 = SzAbstractFactoryCore(**factory_parameters_1) - sz_engine_1 = factory_1.create_engine() - _ = sz_engine_1.add_record("TEST", "TEST787B", '{"NAME_FULL": "Mr Test McTesting"}') - factory_1.destroy() +# def test_destroy_create_new_factory_with_work(engine_vars: Dict[Any, Any]) -> None: +# """Test destroying SzAbstractFactory allows a new factory with work""" +# factory_parameters_1 = {"instance_name": "Example_1", "settings": engine_vars.get("SETTINGS_DICT", {})} +# factory_parameters_2 = {"instance_name": "Example_2", "settings": engine_vars.get("SETTINGS_DICT", {})} +# factory_1 = SzAbstractFactoryCore(**factory_parameters_1) +# sz_engine_1 = factory_1.create_engine() +# _ = sz_engine_1.add_record("TEST", "TEST787B", '{"NAME_FULL": "Mr Test McTesting"}') +# factory_1.destroy() - factory_2 = SzAbstractFactoryCore(**factory_parameters_2) - sz_engine_2 = factory_2.create_engine() - _ = sz_engine_2.add_record("TEST", "TEST767B", '{"NAME_FULL": "Mr McTesting TEST"}') +# factory_2 = SzAbstractFactoryCore(**factory_parameters_2) +# sz_engine_2 = factory_2.create_engine() +# _ = sz_engine_2.add_record("TEST", "TEST767B", '{"NAME_FULL": "Mr McTesting TEST"}') - assert factory_1.is_destroyed - assert factory_1 != factory_2 +# assert factory_1.is_destroyed +# assert factory_1 != factory_2 -def test_destroy_szconfigmanager_is_destroyed(sz_abstractfactory: SzAbstractFactory) -> None: - """Test destroying SzAbstractFactory doesn't allow use of szconfigmanager""" - sz_configmanager = sz_abstractfactory.create_configmanager() - _ = sz_configmanager.get_default_config_id() - sz_abstractfactory.destroy() - with pytest.raises(SzSdkError): - sz_configmanager.get_default_config_id() +# def test_destroy_szconfigmanager_is_destroyed(sz_abstractfactory: SzAbstractFactory) -> None: +# """Test destroying SzAbstractFactory doesn't allow use of szconfigmanager""" +# sz_configmanager = sz_abstractfactory.create_configmanager() +# _ = sz_configmanager.get_default_config_id() +# sz_abstractfactory.destroy() +# with pytest.raises(SzSdkError): +# sz_configmanager.get_default_config_id() -def test_destroy_szdiagnostic_is_destroyed(sz_abstractfactory: SzAbstractFactory) -> None: - """Test destroying SzAbstractFactory doesn't allow use of szdiagnostic""" - sz_diagnostic = sz_abstractfactory.create_diagnostic() - _ = sz_diagnostic.get_repository_info() - sz_abstractfactory.destroy() - with pytest.raises(SzSdkError): - sz_diagnostic.get_repository_info() +# def test_destroy_szdiagnostic_is_destroyed(sz_abstractfactory: SzAbstractFactory) -> None: +# """Test destroying SzAbstractFactory doesn't allow use of szdiagnostic""" +# sz_diagnostic = sz_abstractfactory.create_diagnostic() +# _ = sz_diagnostic.get_repository_info() +# sz_abstractfactory.destroy() +# with pytest.raises(SzSdkError): +# sz_diagnostic.get_repository_info() -def test_destroy_szengine_is_destroyed(sz_abstractfactory: SzAbstractFactory) -> None: - """Test destroying SzAbstractFactory doesn't allow use of szengine""" - sz_engine = sz_abstractfactory.create_engine() - _ = sz_engine.get_active_config_id() - sz_abstractfactory.destroy() - with pytest.raises(SzSdkError): - sz_engine.get_active_config_id() +# def test_destroy_szengine_is_destroyed(sz_abstractfactory: SzAbstractFactory) -> None: +# """Test destroying SzAbstractFactory doesn't allow use of szengine""" +# sz_engine = sz_abstractfactory.create_engine() +# _ = sz_engine.get_active_config_id() +# sz_abstractfactory.destroy() +# with pytest.raises(SzSdkError): +# sz_engine.get_active_config_id() -def test_destroy_szproduct_is_destroyed(sz_abstractfactory: SzAbstractFactory) -> None: - """Test destroying SzAbstractFactory doesn't allow use of szproduct""" - sz_product = sz_abstractfactory.create_product() - _ = sz_product.get_version() - sz_abstractfactory.destroy() - with pytest.raises(SzSdkError): - sz_product.get_version() +# def test_destroy_szproduct_is_destroyed(sz_abstractfactory: SzAbstractFactory) -> None: +# """Test destroying SzAbstractFactory doesn't allow use of szproduct""" +# sz_product = sz_abstractfactory.create_product() +# _ = sz_product.get_version() +# sz_abstractfactory.destroy() +# with pytest.raises(SzSdkError): +# sz_product.get_version() -def test_destroy_all_engines_are_destroyed(sz_abstractfactory: SzAbstractFactory) -> None: - """Test destroying SzAbstractFactory doesn't allow use of any engines""" - sz_configmanager = sz_abstractfactory.create_configmanager() - sz_diagnostic = sz_abstractfactory.create_diagnostic() - sz_engine = sz_abstractfactory.create_engine() - sz_product = sz_abstractfactory.create_product() - sz_abstractfactory.destroy() +# def test_destroy_all_engines_are_destroyed(sz_abstractfactory: SzAbstractFactory) -> None: +# """Test destroying SzAbstractFactory doesn't allow use of any engines""" +# sz_configmanager = sz_abstractfactory.create_configmanager() +# sz_diagnostic = sz_abstractfactory.create_diagnostic() +# sz_engine = sz_abstractfactory.create_engine() +# sz_product = sz_abstractfactory.create_product() +# sz_abstractfactory.destroy() - with pytest.raises(SzSdkError): - sz_configmanager.get_default_config_id() +# with pytest.raises(SzSdkError): +# sz_configmanager.get_default_config_id() - with pytest.raises(SzSdkError): - sz_diagnostic.get_repository_info() +# with pytest.raises(SzSdkError): +# sz_diagnostic.get_repository_info() - with pytest.raises(SzSdkError): - sz_engine.get_active_config_id() +# with pytest.raises(SzSdkError): +# sz_engine.get_active_config_id() - with pytest.raises(SzSdkError): - sz_product.get_version() +# with pytest.raises(SzSdkError): +# sz_product.get_version() -def test_destroy_all_engines_are_destroyed_multiple(sz_abstractfactory: SzAbstractFactory) -> None: - """Test destroying SzAbstractFactory doesn't allow use of szproduct""" - sz_configmanager_1 = sz_abstractfactory.create_configmanager() - sz_configmanager_2 = sz_abstractfactory.create_configmanager() - sz_diagnostic_1 = sz_abstractfactory.create_diagnostic() - sz_diagnostic_2 = sz_abstractfactory.create_diagnostic() - sz_engine_1 = sz_abstractfactory.create_engine() - sz_engine_2 = sz_abstractfactory.create_engine() - sz_product_1 = sz_abstractfactory.create_product() - sz_product_2 = sz_abstractfactory.create_product() - sz_abstractfactory.destroy() +# def test_destroy_all_engines_are_destroyed_multiple(sz_abstractfactory: SzAbstractFactory) -> None: +# """Test destroying SzAbstractFactory doesn't allow use of szproduct""" +# sz_configmanager_1 = sz_abstractfactory.create_configmanager() +# sz_configmanager_2 = sz_abstractfactory.create_configmanager() +# sz_diagnostic_1 = sz_abstractfactory.create_diagnostic() +# sz_diagnostic_2 = sz_abstractfactory.create_diagnostic() +# sz_engine_1 = sz_abstractfactory.create_engine() +# sz_engine_2 = sz_abstractfactory.create_engine() +# sz_product_1 = sz_abstractfactory.create_product() +# sz_product_2 = sz_abstractfactory.create_product() +# sz_abstractfactory.destroy() - with pytest.raises(SzSdkError): - sz_configmanager_1.get_default_config_id() +# with pytest.raises(SzSdkError): +# sz_configmanager_1.get_default_config_id() - with pytest.raises(SzSdkError): - sz_configmanager_2.get_default_config_id() +# with pytest.raises(SzSdkError): +# sz_configmanager_2.get_default_config_id() - with pytest.raises(SzSdkError): - sz_diagnostic_1.get_repository_info() +# with pytest.raises(SzSdkError): +# sz_diagnostic_1.get_repository_info() - with pytest.raises(SzSdkError): - sz_diagnostic_2.get_repository_info() +# with pytest.raises(SzSdkError): +# sz_diagnostic_2.get_repository_info() - with pytest.raises(SzSdkError): - sz_engine_1.get_active_config_id() - - with pytest.raises(SzSdkError): - sz_engine_2.get_active_config_id() +# with pytest.raises(SzSdkError): +# sz_engine_1.get_active_config_id() - with pytest.raises(SzSdkError): - sz_product_1.get_version() - - with pytest.raises(SzSdkError): - sz_product_2.get_version() - - -def test_create_args_hash(engine_vars: Dict[Any, Any]) -> None: - """Test SzAbstractFactory _create_args_hash""" - factory_parameters = { - "instance_name": "Example", - "settings": engine_vars.get("SETTINGS_DICT", {}), - "config_id": 0, - "verbose_logging": 0, - } - sz_factory = SzAbstractFactoryCore(**factory_parameters) - actual = sz_factory._create_args_hash( - factory_parameters["instance_name"], - factory_parameters["settings"], - factory_parameters["config_id"], - factory_parameters["verbose_logging"], - ) - assert isinstance(actual, str) - - -def test_create_args_hash_remove_whitespace() -> None: - """Test SzAbstractFactory _create_args_hash removing whitespace""" - factory_parameters_1 = { - "instance_name": "Example", - "settings": '{"PIPELINE":{"CONFIGPATH":"/etc/opt/senzing","RESOURCEPATH":"/opt/senzing/er/resources","SUPPORTPATH":"/opt/senzing/data"},"SQL":{"CONNECTION":"sqlite3://na:na@/tmp/sqlite/G2C.db"}}', - "config_id": 0, - "verbose_logging": 0, - } - factory_parameters_2 = { - "instance_name": " Example ", - "settings": ' {"PIPELINE": {"CONFIGPATH": "/etc/opt/senzing", "RESOURCEPATH": "/opt/senzing/er/resources", "SUPPORTPATH": "/opt/senzing/data"}, "SQL" : {"CONNECTION": "sqlite3://na:na@/tmp/sqlite/G2C.db"}} ', - "config_id": 0, - "verbose_logging": 0, - } - sz_factory = SzAbstractFactoryCore(**factory_parameters_1) # type: ignore - factory_1 = sz_factory._create_args_hash( - factory_parameters_1["instance_name"], # type: ignore - factory_parameters_1["settings"], # type: ignore - factory_parameters_1["config_id"], # type: ignore - factory_parameters_1["verbose_logging"], # type: ignore - ) - factory_2 = sz_factory._create_args_hash( - factory_parameters_2["instance_name"], # type: ignore - factory_parameters_2["settings"], # type: ignore - factory_parameters_2["config_id"], # type: ignore - factory_parameters_2["verbose_logging"], # type: ignore - ) - assert factory_1 == factory_2 - - -def test_create_args_hash_bad_type(engine_vars: Dict[Any, Any]) -> None: - """Test SzAbstractFactory _create_args_hash with a bad type""" - factory_parameters = { - "instance_name": "Example", - "settings": engine_vars.get("SETTINGS_DICT", {}), - "config_id": 0, - "verbose_logging": ["bad", "type"], - } - with pytest.raises(SzSdkError): - SzAbstractFactoryCore(**factory_parameters) - - -def test_create_args_hash_different_ordered_strings() -> None: - """Test SzAbstractFactory _create_args_hash ordering""" - instance_name_1 = "Example" - settings_1 = '{"PIPELINE":{"CONFIGPATH":"/etc/opt/senzing","RESOURCEPATH":"/opt/senzing/er/resources","SUPPORTPATH":"/opt/senzing/data"},"SQL":{"CONNECTION":"sqlite3://na:na@/tmp/sqlite/G2C.db"}}' - config_id_1 = 0 - verbose_logging_1 = 0 - instance_name_2 = "Example" - settings_2 = '{"SQL":{"CONNECTION":"sqlite3://na:na@/tmp/sqlite/G2C.db"},"PIPELINE":{"CONFIGPATH":"/etc/opt/senzing","RESOURCEPATH":"/opt/senzing/er/resources","SUPPORTPATH":"/opt/senzing/data"}}' - config_id_2 = 0 - verbose_logging_2 = 0 - - hash_1 = SzAbstractFactoryCore._create_args_hash(instance_name_1, settings_1, config_id_1, verbose_logging_1) - hash_2 = SzAbstractFactoryCore._create_args_hash(instance_name_2, settings_2, config_id_2, verbose_logging_2) - assert hash_1 == hash_2 - - -def test_create_args_hash_different_ordered_strings_whitespace() -> None: - """Test SzAbstractFactory _create_args_hash ordering""" - instance_name_1 = "Example" - settings_1 = '{"PIPELINE":{"CONFIGPATH":"/etc/opt/senzing","RESOURCEPATH":"/opt/senzing/er/resources","SUPPORTPATH":"/opt/senzing/data"},"SQL":{"CONNECTION":"sqlite3://na:na@/tmp/sqlite/G2C.db"}}' - config_id_1 = 0 - verbose_logging_1 = 0 - instance_name_2 = " Example " - settings_2 = '{"SQL ":{" CONNECTION":"sqlite3://na:na@/tmp/sqlite/G2C.db "},"PIPELINE":{"CONFIGPATH": "/etc/opt/senzing","RESOURCEPATH":"/opt/senzing/er/resources","SUPPORTPATH":"/opt/senzing/data" } } ' - config_id_2 = 0 - verbose_logging_2 = 0 - - hash_1 = SzAbstractFactoryCore._create_args_hash(instance_name_1, settings_1, config_id_1, verbose_logging_1) - hash_2 = SzAbstractFactoryCore._create_args_hash(instance_name_2, settings_2, config_id_2, verbose_logging_2) - assert hash_1 == hash_2 - - -def test_create_args_hash_different_ordered_dicts() -> None: - """Test SzAbstractFactory _create_args_hash ordering""" - factory_parameters_1 = { - "instance_name": "Example", - "settings": { - "PIPELINE": { - "CONFIGPATH": "/etc/opt/senzing", - "RESOURCEPATH": "/opt/senzing/er/resources", - "SUPPORTPATH": "/opt/senzing/data", - }, - "SQL": {"CONNECTION": "sqlite3://na:na@/tmp/sqlite/G2C.db"}, - }, - "config_id": 0, - "verbose_logging": 0, - } - factory_parameters_2 = { - "instance_name": "Example", - "settings": { - "SQL": {"CONNECTION": "sqlite3://na:na@/tmp/sqlite/G2C.db"}, - "PIPELINE": { - "SUPPORTPATH": "/opt/senzing/data", - "CONFIGPATH": "/etc/opt/senzing", - "RESOURCEPATH": "/opt/senzing/er/resources", - }, - }, - "config_id": 0, - "verbose_logging": 0, - } +# with pytest.raises(SzSdkError): +# sz_engine_2.get_active_config_id() - hash_1 = SzAbstractFactoryCore._create_args_hash( - factory_parameters_1["instance_name"], # type: ignore - factory_parameters_1["settings"], # type: ignore - factory_parameters_1["config_id"], # type: ignore - factory_parameters_1["verbose_logging"], # type: ignore - ) - hash_2 = SzAbstractFactoryCore._create_args_hash( - factory_parameters_2["instance_name"], # type: ignore - factory_parameters_2["settings"], # type: ignore - factory_parameters_2["config_id"], # type: ignore - factory_parameters_2["verbose_logging"], # type: ignore - ) - assert hash_1 == hash_2 - - -def test_create_args_hash_different_ordered_strings_and_dict() -> None: - """Test SzAbstractFactory _create_args_hash ordering""" - instance_name = "Example" - settings = '{"SQL ":{" CONNECTION":"sqlite3://na:na@/tmp/sqlite/G2C.db "},"PIPELINE":{"CONFIGPATH": "/etc/opt/senzing","RESOURCEPATH":"/opt/senzing/er/resources","SUPPORTPATH":"/opt/senzing/data" } } ' - config_id = 0 - verbose_logging = 0 +# with pytest.raises(SzSdkError): +# sz_product_1.get_version() - factory_parameters = { - "instance_name": "Example", - "settings": { - "SQL": {"CONNECTION": "sqlite3://na:na@/tmp/sqlite/G2C.db"}, - "PIPELINE": { - "SUPPORTPATH": "/opt/senzing/data", - "CONFIGPATH": "/etc/opt/senzing", - "RESOURCEPATH": "/opt/senzing/er/resources", - }, - }, - "config_id": 0, - "verbose_logging": 0, - } +# with pytest.raises(SzSdkError): +# sz_product_2.get_version() - hash_1 = SzAbstractFactoryCore._create_args_hash(instance_name, settings, config_id, verbose_logging) - hash_2 = SzAbstractFactoryCore._create_args_hash( - factory_parameters["instance_name"], # type: ignore - factory_parameters["settings"], # type: ignore - factory_parameters["config_id"], # type: ignore - factory_parameters["verbose_logging"], # type: ignore - ) - assert hash_1 == hash_2 - - -def test_is_destroyed_szconfigmanager_all_methods(sz_abstractfactory: SzAbstractFactory) -> None: - """Test destroying SzAbstractFactory doesn't allow use of any methods""" - methods = [ - m - for m in dir(SzConfigManagerCore) - if callable(getattr(SzConfigManagerCore, m)) - and not (m.startswith("__") or m in ("_destroy", "help", "_internal_only_destroy")) - ] - sz_configmanager = sz_abstractfactory.create_configmanager() - sz_configmanager._is_destroyed = True # type: ignore - - for method in methods: - with pytest.raises(SzSdkError): - getattr(SzConfigManagerCore, method)(sz_configmanager) - - -def test_is_destroyed_szdiagnostic_all_methods(sz_abstractfactory: SzAbstractFactory) -> None: - """Test destroying SzAbstractFactory doesn't allow use of any methods""" - methods = [ - m - for m in dir(SzDiagnosticCore) - if callable(getattr(SzDiagnosticCore, m)) - and not (m.startswith("__") or m in ("_destroy", "help", "_internal_only_destroy")) - ] - sz_diagnostic = sz_abstractfactory.create_diagnostic() - sz_diagnostic._is_destroyed = True # type: ignore - - for method in methods: - with pytest.raises(SzSdkError): - getattr(SzDiagnosticCore, method)(sz_diagnostic) - - -def test_is_destroyed_szengine_all_methods(sz_abstractfactory: SzAbstractFactory) -> None: - """Test destroying SzAbstractFactory doesn't allow use of any methods""" - methods = [ - m - for m in dir(SzEngineCore) - if callable(getattr(SzEngineCore, m)) - and not (m.startswith("__") or m in ("_destroy", "help", "_internal_only_destroy")) - ] - sz_engine = sz_abstractfactory.create_engine() - sz_engine._is_destroyed = True # type: ignore - - for method in methods: - with pytest.raises(SzSdkError): - getattr(SzEngineCore, method)(sz_engine) - - -def test_is_destroyed_szproduct_all_methods(sz_abstractfactory: SzAbstractFactory) -> None: - """Test destroying SzAbstractFactory doesn't allow use of any methods""" - methods = [ - m - for m in dir(SzProductCore) - if callable(getattr(SzProductCore, m)) - and not (m.startswith("__") or m in ("_destroy", "help", "_internal_only_destroy")) - ] - sz_product = sz_abstractfactory.create_product() - sz_product._is_destroyed = True # type: ignore - - for method in methods: - with pytest.raises(SzSdkError): - getattr(SzProductCore, method)(sz_product) - - -def test_is_destroyed_factory_all_methods(sz_abstractfactory: SzAbstractFactory) -> None: - """Test destroying SzAbstractFactory doesn't allow use of any methods""" - methods = [ - m - for m in dir(SzAbstractFactoryCore) - if callable(getattr(SzAbstractFactoryCore, m)) - and not (m.startswith("__") or m in ("_destroy", "help", "_create_args_hash", "_do_destroy")) - ] - sz_abstractfactory.destroy() - - for method in methods: - with pytest.raises(SzSdkError): - getattr(SzAbstractFactoryCore, method)(sz_abstractfactory) - - -def test_method_chain(engine_vars: Dict[Any, Any]) -> None: - """Test SzAbstractFactory engine destruction on method chain""" - factory_parameters = { - "instance_name": "Example", - "settings": engine_vars.get("SETTINGS_DICT", {}), - "config_id": 0, - "verbose_logging": 0, - } +# def test_create_args_hash(engine_vars: Dict[Any, Any]) -> None: +# """Test SzAbstractFactory _create_args_hash""" +# factory_parameters = { +# "instance_name": "Example", +# "settings": engine_vars.get("SETTINGS_DICT", {}), +# "config_id": 0, +# "verbose_logging": 0, +# } +# sz_factory = SzAbstractFactoryCore(**factory_parameters) +# actual = sz_factory._create_args_hash( +# factory_parameters["instance_name"], +# factory_parameters["settings"], +# factory_parameters["config_id"], +# factory_parameters["verbose_logging"], +# ) +# assert isinstance(actual, str) + + +# def test_create_args_hash_remove_whitespace() -> None: +# """Test SzAbstractFactory _create_args_hash removing whitespace""" +# factory_parameters_1 = { +# "instance_name": "Example", +# "settings": '{"PIPELINE":{"CONFIGPATH":"/etc/opt/senzing","RESOURCEPATH":"/opt/senzing/er/resources","SUPPORTPATH":"/opt/senzing/data"},"SQL":{"CONNECTION":"sqlite3://na:na@/tmp/sqlite/G2C.db"}}', +# "config_id": 0, +# "verbose_logging": 0, +# } +# factory_parameters_2 = { +# "instance_name": " Example ", +# "settings": ' {"PIPELINE": {"CONFIGPATH": "/etc/opt/senzing", "RESOURCEPATH": "/opt/senzing/er/resources", "SUPPORTPATH": "/opt/senzing/data"}, "SQL" : {"CONNECTION": "sqlite3://na:na@/tmp/sqlite/G2C.db"}} ', +# "config_id": 0, +# "verbose_logging": 0, +# } +# sz_factory = SzAbstractFactoryCore(**factory_parameters_1) # type: ignore +# factory_1 = sz_factory._create_args_hash( +# factory_parameters_1["instance_name"], # type: ignore +# factory_parameters_1["settings"], # type: ignore +# factory_parameters_1["config_id"], # type: ignore +# factory_parameters_1["verbose_logging"], # type: ignore +# ) +# factory_2 = sz_factory._create_args_hash( +# factory_parameters_2["instance_name"], # type: ignore +# factory_parameters_2["settings"], # type: ignore +# factory_parameters_2["config_id"], # type: ignore +# factory_parameters_2["verbose_logging"], # type: ignore +# ) +# assert factory_1 == factory_2 + + +# def test_create_args_hash_bad_type(engine_vars: Dict[Any, Any]) -> None: +# """Test SzAbstractFactory _create_args_hash with a bad type""" +# factory_parameters = { +# "instance_name": "Example", +# "settings": engine_vars.get("SETTINGS_DICT", {}), +# "config_id": 0, +# "verbose_logging": ["bad", "type"], +# } +# with pytest.raises(SzSdkError): +# SzAbstractFactoryCore(**factory_parameters) + + +# def test_create_args_hash_different_ordered_strings() -> None: +# """Test SzAbstractFactory _create_args_hash ordering""" +# instance_name_1 = "Example" +# settings_1 = '{"PIPELINE":{"CONFIGPATH":"/etc/opt/senzing","RESOURCEPATH":"/opt/senzing/er/resources","SUPPORTPATH":"/opt/senzing/data"},"SQL":{"CONNECTION":"sqlite3://na:na@/tmp/sqlite/G2C.db"}}' +# config_id_1 = 0 +# verbose_logging_1 = 0 +# instance_name_2 = "Example" +# settings_2 = '{"SQL":{"CONNECTION":"sqlite3://na:na@/tmp/sqlite/G2C.db"},"PIPELINE":{"CONFIGPATH":"/etc/opt/senzing","RESOURCEPATH":"/opt/senzing/er/resources","SUPPORTPATH":"/opt/senzing/data"}}' +# config_id_2 = 0 +# verbose_logging_2 = 0 + +# hash_1 = SzAbstractFactoryCore._create_args_hash(instance_name_1, settings_1, config_id_1, verbose_logging_1) +# hash_2 = SzAbstractFactoryCore._create_args_hash(instance_name_2, settings_2, config_id_2, verbose_logging_2) +# assert hash_1 == hash_2 + + +# def test_create_args_hash_different_ordered_strings_whitespace() -> None: +# """Test SzAbstractFactory _create_args_hash ordering""" +# instance_name_1 = "Example" +# settings_1 = '{"PIPELINE":{"CONFIGPATH":"/etc/opt/senzing","RESOURCEPATH":"/opt/senzing/er/resources","SUPPORTPATH":"/opt/senzing/data"},"SQL":{"CONNECTION":"sqlite3://na:na@/tmp/sqlite/G2C.db"}}' +# config_id_1 = 0 +# verbose_logging_1 = 0 +# instance_name_2 = " Example " +# settings_2 = '{"SQL ":{" CONNECTION":"sqlite3://na:na@/tmp/sqlite/G2C.db "},"PIPELINE":{"CONFIGPATH": "/etc/opt/senzing","RESOURCEPATH":"/opt/senzing/er/resources","SUPPORTPATH":"/opt/senzing/data" } } ' +# config_id_2 = 0 +# verbose_logging_2 = 0 + +# hash_1 = SzAbstractFactoryCore._create_args_hash(instance_name_1, settings_1, config_id_1, verbose_logging_1) +# hash_2 = SzAbstractFactoryCore._create_args_hash(instance_name_2, settings_2, config_id_2, verbose_logging_2) +# assert hash_1 == hash_2 + + +# def test_create_args_hash_different_ordered_dicts() -> None: +# """Test SzAbstractFactory _create_args_hash ordering""" +# factory_parameters_1 = { +# "instance_name": "Example", +# "settings": { +# "PIPELINE": { +# "CONFIGPATH": "/etc/opt/senzing", +# "RESOURCEPATH": "/opt/senzing/er/resources", +# "SUPPORTPATH": "/opt/senzing/data", +# }, +# "SQL": {"CONNECTION": "sqlite3://na:na@/tmp/sqlite/G2C.db"}, +# }, +# "config_id": 0, +# "verbose_logging": 0, +# } +# factory_parameters_2 = { +# "instance_name": "Example", +# "settings": { +# "SQL": {"CONNECTION": "sqlite3://na:na@/tmp/sqlite/G2C.db"}, +# "PIPELINE": { +# "SUPPORTPATH": "/opt/senzing/data", +# "CONFIGPATH": "/etc/opt/senzing", +# "RESOURCEPATH": "/opt/senzing/er/resources", +# }, +# }, +# "config_id": 0, +# "verbose_logging": 0, +# } - sz_engine = SzAbstractFactoryCore(**factory_parameters).create_engine() - with pytest.raises(SzSdkError): - sz_engine.get_active_config_id() +# hash_1 = SzAbstractFactoryCore._create_args_hash( +# factory_parameters_1["instance_name"], # type: ignore +# factory_parameters_1["settings"], # type: ignore +# factory_parameters_1["config_id"], # type: ignore +# factory_parameters_1["verbose_logging"], # type: ignore +# ) +# hash_2 = SzAbstractFactoryCore._create_args_hash( +# factory_parameters_2["instance_name"], # type: ignore +# factory_parameters_2["settings"], # type: ignore +# factory_parameters_2["config_id"], # type: ignore +# factory_parameters_2["verbose_logging"], # type: ignore +# ) +# assert hash_1 == hash_2 + + +# def test_create_args_hash_different_ordered_strings_and_dict() -> None: +# """Test SzAbstractFactory _create_args_hash ordering""" +# instance_name = "Example" +# settings = '{"SQL ":{" CONNECTION":"sqlite3://na:na@/tmp/sqlite/G2C.db "},"PIPELINE":{"CONFIGPATH": "/etc/opt/senzing","RESOURCEPATH":"/opt/senzing/er/resources","SUPPORTPATH":"/opt/senzing/data" } } ' +# config_id = 0 +# verbose_logging = 0 +# factory_parameters = { +# "instance_name": "Example", +# "settings": { +# "SQL": {"CONNECTION": "sqlite3://na:na@/tmp/sqlite/G2C.db"}, +# "PIPELINE": { +# "SUPPORTPATH": "/opt/senzing/data", +# "CONFIGPATH": "/etc/opt/senzing", +# "RESOURCEPATH": "/opt/senzing/er/resources", +# }, +# }, +# "config_id": 0, +# "verbose_logging": 0, +# } -# def test_context_manager(engine_vars: Dict[Any, Any]) -> None: -# """Test SzAbstractFactory context manager""" +# hash_1 = SzAbstractFactoryCore._create_args_hash(instance_name, settings, config_id, verbose_logging) +# hash_2 = SzAbstractFactoryCore._create_args_hash( +# factory_parameters["instance_name"], # type: ignore +# factory_parameters["settings"], # type: ignore +# factory_parameters["config_id"], # type: ignore +# factory_parameters["verbose_logging"], # type: ignore +# ) +# assert hash_1 == hash_2 + + +# def test_is_destroyed_szconfigmanager_all_methods(sz_abstractfactory: SzAbstractFactory) -> None: +# """Test destroying SzAbstractFactory doesn't allow use of any methods""" +# methods = [ +# m +# for m in dir(SzConfigManagerCore) +# if callable(getattr(SzConfigManagerCore, m)) +# and not (m.startswith("__") or m in ("_destroy", "help", "_internal_only_destroy")) +# ] +# sz_configmanager = sz_abstractfactory.create_configmanager() +# sz_configmanager._is_destroyed = True # type: ignore + +# for method in methods: +# with pytest.raises(SzSdkError): +# getattr(SzConfigManagerCore, method)(sz_configmanager) + + +# def test_is_destroyed_szdiagnostic_all_methods(sz_abstractfactory: SzAbstractFactory) -> None: +# """Test destroying SzAbstractFactory doesn't allow use of any methods""" +# methods = [ +# m +# for m in dir(SzDiagnosticCore) +# if callable(getattr(SzDiagnosticCore, m)) +# and not (m.startswith("__") or m in ("_destroy", "help", "_internal_only_destroy")) +# ] +# sz_diagnostic = sz_abstractfactory.create_diagnostic() +# sz_diagnostic._is_destroyed = True # type: ignore + +# for method in methods: +# with pytest.raises(SzSdkError): +# getattr(SzDiagnosticCore, method)(sz_diagnostic) + + +# def test_is_destroyed_szengine_all_methods(sz_abstractfactory: SzAbstractFactory) -> None: +# """Test destroying SzAbstractFactory doesn't allow use of any methods""" +# methods = [ +# m +# for m in dir(SzEngineCore) +# if callable(getattr(SzEngineCore, m)) +# and not (m.startswith("__") or m in ("_destroy", "help", "_internal_only_destroy")) +# ] +# sz_engine = sz_abstractfactory.create_engine() +# sz_engine._is_destroyed = True # type: ignore + +# for method in methods: +# with pytest.raises(SzSdkError): +# getattr(SzEngineCore, method)(sz_engine) + + +# def test_is_destroyed_szproduct_all_methods(sz_abstractfactory: SzAbstractFactory) -> None: +# """Test destroying SzAbstractFactory doesn't allow use of any methods""" +# methods = [ +# m +# for m in dir(SzProductCore) +# if callable(getattr(SzProductCore, m)) +# and not (m.startswith("__") or m in ("_destroy", "help", "_internal_only_destroy")) +# ] +# sz_product = sz_abstractfactory.create_product() +# sz_product._is_destroyed = True # type: ignore + +# for method in methods: +# with pytest.raises(SzSdkError): +# getattr(SzProductCore, method)(sz_product) + + +# def test_is_destroyed_factory_all_methods(sz_abstractfactory: SzAbstractFactory) -> None: +# """Test destroying SzAbstractFactory doesn't allow use of any methods""" +# methods = [ +# m +# for m in dir(SzAbstractFactoryCore) +# if callable(getattr(SzAbstractFactoryCore, m)) +# and not (m.startswith("__") or m in ("_destroy", "help", "_create_args_hash", "_do_destroy")) +# ] +# sz_abstractfactory.destroy() + +# for method in methods: +# with pytest.raises(SzSdkError): +# getattr(SzAbstractFactoryCore, method)(sz_abstractfactory) + + +# def test_method_chain(engine_vars: Dict[Any, Any]) -> None: +# """Test SzAbstractFactory engine destruction on method chain""" # factory_parameters = { # "instance_name": "Example", @@ -593,13 +578,28 @@ def test_method_chain(engine_vars: Dict[Any, Any]) -> None: # "verbose_logging": 0, # } -# # fmt: off -# # pylint: disable=not-context-manager -# with pytest.raises(AttributeError, TypeError): # type: ignore -# with SzAbstractFactoryCore(**factory_parameters) as sz_factory: # type: ignore -# sz_factory.create_engine() -# # pylint: enable=not-context-manager -# # fmt: on +# sz_engine = SzAbstractFactoryCore(**factory_parameters).create_engine() +# with pytest.raises(SzSdkError): +# sz_engine.get_active_config_id() + + +# # def test_context_manager(engine_vars: Dict[Any, Any]) -> None: +# # """Test SzAbstractFactory context manager""" + +# # factory_parameters = { +# # "instance_name": "Example", +# # "settings": engine_vars.get("SETTINGS_DICT", {}), +# # "config_id": 0, +# # "verbose_logging": 0, +# # } + +# # # fmt: off +# # # pylint: disable=not-context-manager +# # with pytest.raises(AttributeError, TypeError): # type: ignore +# # with SzAbstractFactoryCore(**factory_parameters) as sz_factory: # type: ignore +# # sz_factory.create_engine() +# # # pylint: enable=not-context-manager +# # # fmt: on # ----------------------------------------------------------------------------- diff --git a/tests/szconfig_test.py b/tests/szconfig_.py similarity index 100% rename from tests/szconfig_test.py rename to tests/szconfig_.py diff --git a/tests/szconfigmanager_test.py b/tests/szconfigmanager_.py similarity index 100% rename from tests/szconfigmanager_test.py rename to tests/szconfigmanager_.py diff --git a/tests/szdiagnostic_test.py b/tests/szdiagnostic_.py similarity index 100% rename from tests/szdiagnostic_test.py rename to tests/szdiagnostic_.py diff --git a/tests/szengine_test.py b/tests/szengine_.py similarity index 100% rename from tests/szengine_test.py rename to tests/szengine_.py diff --git a/tests/szproduct_test.py b/tests/szproduct_.py similarity index 100% rename from tests/szproduct_test.py rename to tests/szproduct_.py From c996be26a3eb943d2b27985c3b6796031c0a7e83 Mon Sep 17 00:00:00 2001 From: Ant Date: Wed, 15 Oct 2025 13:10:50 -0400 Subject: [PATCH 03/20] #387 - Testing do not pull into main! --- src/senzing_core/szabstractfactory.py | 2 +- tests/szabstractfactory_test.py | 35 +++++++++++++++++---------- 2 files changed, 23 insertions(+), 14 deletions(-) diff --git a/src/senzing_core/szabstractfactory.py b/src/senzing_core/szabstractfactory.py index 48cc0fbf..6f524b74 100644 --- a/src/senzing_core/szabstractfactory.py +++ b/src/senzing_core/szabstractfactory.py @@ -298,7 +298,7 @@ def _do_destroy() -> None: while True: try: # TODO - - print("\rSzDiagnosticCore", flush=True) + print("\tSzDiagnosticCore", flush=True) sz_destroy_diagnostic._internal_only_destroy() # pylint: disable=protected-access except SzNotInitializedError: break diff --git a/tests/szabstractfactory_test.py b/tests/szabstractfactory_test.py index f033658b..88b89e18 100755 --- a/tests/szabstractfactory_test.py +++ b/tests/szabstractfactory_test.py @@ -49,8 +49,17 @@ def test_create_with_different_settings(engine_vars: Dict[Any, Any]) -> None: SzAbstractFactoryCore(**factory_parameters_2) -def test_create_configmanager(sz_abstractfactory: SzAbstractFactory) -> None: +# TODO - +# def test_create_configmanager(sz_abstractfactory: SzAbstractFactory) -> None: +# """Test SzAbstractFactory.create_configmanager().""" +# actual = sz_abstractfactory.create_configmanager() +# assert isinstance(actual, SzConfigManager) + + +def test_create_configmanager(engine_vars: Dict[Any, Any]) -> None: """Test SzAbstractFactory.create_configmanager().""" + factory_parameters_1 = {"instance_name": "Example_1", "settings": engine_vars.get("SETTINGS_DICT", {})} + sz_abstractfactory = SzAbstractFactoryCore(**factory_parameters_1) # pylint: disable=unused-variable # noqa: F841 actual = sz_abstractfactory.create_configmanager() assert isinstance(actual, SzConfigManager) @@ -611,19 +620,19 @@ def test_create_configmanager(sz_abstractfactory: SzAbstractFactory) -> None: # Fixtures # ----------------------------------------------------------------------------- +# TODO - +# @pytest.fixture(name="sz_abstractfactory", scope="function") +# def szabstractfactory_fixture(engine_vars: Dict[Any, Any]) -> SzAbstractFactory: +# """ +# SzAbstractFactory object to use for all tests. +# """ -@pytest.fixture(name="sz_abstractfactory", scope="function") -def szabstractfactory_fixture(engine_vars: Dict[Any, Any]) -> SzAbstractFactory: - """ - SzAbstractFactory object to use for all tests. - """ - - factory_parameters = { - "instance_name": "Example", - "settings": engine_vars.get("SETTINGS_DICT", {}), - } - result = SzAbstractFactoryCore(**factory_parameters) - return result +# factory_parameters = { +# "instance_name": "Example", +# "settings": engine_vars.get("SETTINGS_DICT", {}), +# } +# result = SzAbstractFactoryCore(**factory_parameters) +# return result # ----------------------------------------------------------------------------- From 1c5e11cf432efe21cabb3e7f7280c0efd6cf7f10 Mon Sep 17 00:00:00 2001 From: Ant Date: Wed, 15 Oct 2025 13:18:23 -0400 Subject: [PATCH 04/20] #387 - Testing do not pull into main! --- src/senzing_core/szabstractfactory.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/senzing_core/szabstractfactory.py b/src/senzing_core/szabstractfactory.py index 6f524b74..829de687 100644 --- a/src/senzing_core/szabstractfactory.py +++ b/src/senzing_core/szabstractfactory.py @@ -133,6 +133,7 @@ def __new__( with cls._constructor_lock: # TODO - print("\nIn factory __new__...", flush=True) + print(f"\t{settings}", flush=True) args_hash = cls._create_args_hash(instance_name, settings, config_id, verbose_logging) # instance = super().__new__(cls) # instance._args_hash = args_hash # type: ignore[attr-defined] From 2a353e2bc2f5d4c7bd4e9ca293a988063e8db695 Mon Sep 17 00:00:00 2001 From: Ant Date: Wed, 15 Oct 2025 13:19:11 -0400 Subject: [PATCH 05/20] #387 - Testing do not pull into main! --- src/senzing_core/szabstractfactory.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/senzing_core/szabstractfactory.py b/src/senzing_core/szabstractfactory.py index 829de687..d24054ca 100644 --- a/src/senzing_core/szabstractfactory.py +++ b/src/senzing_core/szabstractfactory.py @@ -133,7 +133,10 @@ def __new__( with cls._constructor_lock: # TODO - print("\nIn factory __new__...", flush=True) + print(f"\t{instance_name}", flush=True) print(f"\t{settings}", flush=True) + print(f"\t{config_id}", flush=True) + print(f"\t{verbose_logging}", flush=True) args_hash = cls._create_args_hash(instance_name, settings, config_id, verbose_logging) # instance = super().__new__(cls) # instance._args_hash = args_hash # type: ignore[attr-defined] From f1367f4e32bd50c13136d9213686d128f2dde4be Mon Sep 17 00:00:00 2001 From: Ant Date: Wed, 15 Oct 2025 13:29:44 -0400 Subject: [PATCH 06/20] #387 - Testing do not pull into main! --- tests/szabstractfactory_test.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/tests/szabstractfactory_test.py b/tests/szabstractfactory_test.py index 88b89e18..00806e03 100755 --- a/tests/szabstractfactory_test.py +++ b/tests/szabstractfactory_test.py @@ -55,11 +55,22 @@ def test_create_with_different_settings(engine_vars: Dict[Any, Any]) -> None: # actual = sz_abstractfactory.create_configmanager() # assert isinstance(actual, SzConfigManager) +# TODO - +# def test_create_configmanager(engine_vars: Dict[Any, Any]) -> None: +# """Test SzAbstractFactory.create_configmanager().""" +# factory_parameters_1 = {"instance_name": "Example_1", "settings": engine_vars.get("SETTINGS_DICT", {})} +# sz_abstractfactory = SzAbstractFactoryCore(**factory_parameters_1) # pylint: disable=unused-variable # noqa: F841 +# actual = sz_abstractfactory.create_configmanager() +# assert isinstance(actual, SzConfigManager) + def test_create_configmanager(engine_vars: Dict[Any, Any]) -> None: """Test SzAbstractFactory.create_configmanager().""" - factory_parameters_1 = {"instance_name": "Example_1", "settings": engine_vars.get("SETTINGS_DICT", {})} - sz_abstractfactory = SzAbstractFactoryCore(**factory_parameters_1) # pylint: disable=unused-variable # noqa: F841 + instance_name = "AntTest" + settings = "{'PIPELINE': {'CONFIGPATH': '/Users/runner/senzing/er/etc', 'RESOURCEPATH': '/Users/runner/senzing/er/resources', 'SUPPORTPATH': '/Users/runner/senzing/data'}, 'SQL': {'CONNECTION': 'sqlite3://na:na@/tmp/sqlite/G2C.db'}}" + sz_abstractfactory = SzAbstractFactoryCore( + instance_name=instance_name, settings=settings + ) # pylint: disable=unused-variable # noqa: F841 actual = sz_abstractfactory.create_configmanager() assert isinstance(actual, SzConfigManager) From 4ee92bbfcfa88aee768cc9f3588ae97b438378a3 Mon Sep 17 00:00:00 2001 From: Ant Date: Wed, 15 Oct 2025 13:44:47 -0400 Subject: [PATCH 07/20] #387 - Testing do not pull into main! --- tests/szabstractfactory_test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/szabstractfactory_test.py b/tests/szabstractfactory_test.py index 00806e03..ad741370 100755 --- a/tests/szabstractfactory_test.py +++ b/tests/szabstractfactory_test.py @@ -64,10 +64,10 @@ def test_create_with_different_settings(engine_vars: Dict[Any, Any]) -> None: # assert isinstance(actual, SzConfigManager) -def test_create_configmanager(engine_vars: Dict[Any, Any]) -> None: +def test_create_configmanager() -> None: """Test SzAbstractFactory.create_configmanager().""" instance_name = "AntTest" - settings = "{'PIPELINE': {'CONFIGPATH': '/Users/runner/senzing/er/etc', 'RESOURCEPATH': '/Users/runner/senzing/er/resources', 'SUPPORTPATH': '/Users/runner/senzing/data'}, 'SQL': {'CONNECTION': 'sqlite3://na:na@/tmp/sqlite/G2C.db'}}" + settings = '{"PIPELINE": {"CONFIGPATH": "/Users/runner/senzing/er/etc", "RESOURCEPATH": "/Users/runner/senzing/er/resources", "SUPPORTPATH": "/Users/runner/senzing/data"}, "SQL": {"CONNECTION": "sqlite3://na:na@/tmp/sqlite/G2C.db"}}' sz_abstractfactory = SzAbstractFactoryCore( instance_name=instance_name, settings=settings ) # pylint: disable=unused-variable # noqa: F841 From 2b1cfd03ef3406215707818499ecf560c7aac706 Mon Sep 17 00:00:00 2001 From: Ant Date: Wed, 15 Oct 2025 15:06:13 -0400 Subject: [PATCH 08/20] #387 - Testing do not pull into main! --- src/senzing_core/szconfigmanager.py | 10 ++++++ tests/szabstractfactory_test.py | 54 +++++++++++++++-------------- 2 files changed, 38 insertions(+), 26 deletions(-) diff --git a/src/senzing_core/szconfigmanager.py b/src/senzing_core/szconfigmanager.py index 7ec7fabf..1d008b02 100644 --- a/src/senzing_core/szconfigmanager.py +++ b/src/senzing_core/szconfigmanager.py @@ -264,6 +264,16 @@ def _initialize( self.instance_name = instance_name self.settings = as_str(settings) self.verbose_logging = verbose_logging + # TODO - + print("\nSzConfigManager -> _initialize...", flush=True) + print(f"{self.instance_name = }", flush=True) + print(f"{self.settings = }", flush=True) + print(f"{self.verbose_logging = }", flush=True) + instance_name_c_char_p = as_c_char_p(instance_name) + settings_c_char_p = as_c_char_p(as_str(settings)) + print(f"{instance_name_c_char_p = }", flush=True) + print(f"{settings_c_char_p = }", flush=True) + result = self._library_handle.SzConfigMgr_init( as_c_char_p(instance_name), as_c_char_p(as_str(settings)), diff --git a/tests/szabstractfactory_test.py b/tests/szabstractfactory_test.py index ad741370..2e7442b7 100755 --- a/tests/szabstractfactory_test.py +++ b/tests/szabstractfactory_test.py @@ -50,10 +50,11 @@ def test_create_with_different_settings(engine_vars: Dict[Any, Any]) -> None: # TODO - -# def test_create_configmanager(sz_abstractfactory: SzAbstractFactory) -> None: -# """Test SzAbstractFactory.create_configmanager().""" -# actual = sz_abstractfactory.create_configmanager() -# assert isinstance(actual, SzConfigManager) +def test_create_configmanager(sz_abstractfactory: SzAbstractFactory) -> None: + """Test SzAbstractFactory.create_configmanager().""" + actual = sz_abstractfactory.create_configmanager() + assert isinstance(actual, SzConfigManager) + # TODO - # def test_create_configmanager(engine_vars: Dict[Any, Any]) -> None: @@ -63,16 +64,16 @@ def test_create_with_different_settings(engine_vars: Dict[Any, Any]) -> None: # actual = sz_abstractfactory.create_configmanager() # assert isinstance(actual, SzConfigManager) - -def test_create_configmanager() -> None: - """Test SzAbstractFactory.create_configmanager().""" - instance_name = "AntTest" - settings = '{"PIPELINE": {"CONFIGPATH": "/Users/runner/senzing/er/etc", "RESOURCEPATH": "/Users/runner/senzing/er/resources", "SUPPORTPATH": "/Users/runner/senzing/data"}, "SQL": {"CONNECTION": "sqlite3://na:na@/tmp/sqlite/G2C.db"}}' - sz_abstractfactory = SzAbstractFactoryCore( - instance_name=instance_name, settings=settings - ) # pylint: disable=unused-variable # noqa: F841 - actual = sz_abstractfactory.create_configmanager() - assert isinstance(actual, SzConfigManager) +# TODO - +# def test_create_configmanager() -> None: +# """Test SzAbstractFactory.create_configmanager().""" +# instance_name = "AntTest" +# settings = '{"PIPELINE": {"CONFIGPATH": "/Users/runner/senzing/er/etc", "RESOURCEPATH": "/Users/runner/senzing/er/resources", "SUPPORTPATH": "/Users/runner/senzing/data"}, "SQL": {"CONNECTION": "sqlite3://na:na@/tmp/sqlite/G2C.db"}}' +# sz_abstractfactory = SzAbstractFactoryCore( +# instance_name=instance_name, settings=settings +# ) # pylint: disable=unused-variable # noqa: F841 +# actual = sz_abstractfactory.create_configmanager() +# assert isinstance(actual, SzConfigManager) # def test_create_diagnostic(sz_abstractfactory: SzAbstractFactory) -> None: @@ -631,19 +632,20 @@ def test_create_configmanager() -> None: # Fixtures # ----------------------------------------------------------------------------- -# TODO - -# @pytest.fixture(name="sz_abstractfactory", scope="function") -# def szabstractfactory_fixture(engine_vars: Dict[Any, Any]) -> SzAbstractFactory: -# """ -# SzAbstractFactory object to use for all tests. -# """ -# factory_parameters = { -# "instance_name": "Example", -# "settings": engine_vars.get("SETTINGS_DICT", {}), -# } -# result = SzAbstractFactoryCore(**factory_parameters) -# return result +# TODO - +@pytest.fixture(name="sz_abstractfactory", scope="function") +def szabstractfactory_fixture(engine_vars: Dict[Any, Any]) -> SzAbstractFactory: + """ + SzAbstractFactory object to use for all tests. + """ + + factory_parameters = { + "instance_name": "Example", + "settings": engine_vars.get("SETTINGS_DICT", {}), + } + result = SzAbstractFactoryCore(**factory_parameters) + return result # ----------------------------------------------------------------------------- From fee0256127a80296be32f4d14dcc5e6b6b14af00 Mon Sep 17 00:00:00 2001 From: Ant Date: Wed, 15 Oct 2025 15:21:46 -0400 Subject: [PATCH 09/20] #387 - Testing do not pull into main! --- .github/workflows/pytest-darwin.yaml | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pytest-darwin.yaml b/.github/workflows/pytest-darwin.yaml index 9cfcd4d4..d5835db7 100644 --- a/.github/workflows/pytest-darwin.yaml +++ b/.github/workflows/pytest-darwin.yaml @@ -29,6 +29,18 @@ jobs: senzingsdk-version: [production-v4, staging-v4] steps: + - name: Test enabling cores + run: | + ulimit -c + ulimit -c unlimited + ulimit -c + + - name: Test access to core dump directory + run: | + sudo touch /cores/test + ls /cores + sudo rm /cores/test + - name: Checkout repository uses: actions/checkout@v5 with: @@ -81,7 +93,13 @@ jobs: - name: Run pytest run: | source ./venv/bin/activate - pytest tests/ --verbose --capture=no --cov=src + ulimit -c unlimited + sudo pytest tests/ --verbose --capture=no --cov=src + sudo chmod -R +rwx /cores/* + - uses: actions/upload-artifact@v4 + with: + name: crashes + path: /cores - name: Rename coverage file env: From 8609bb21eed417d8ffe054cdb8b2b9ef06ac8c8f Mon Sep 17 00:00:00 2001 From: Ant Date: Wed, 15 Oct 2025 15:43:41 -0400 Subject: [PATCH 10/20] #387 - Testing do not pull into main! --- .github/workflows/pytest-darwin.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pytest-darwin.yaml b/.github/workflows/pytest-darwin.yaml index d5835db7..23fea3b1 100644 --- a/.github/workflows/pytest-darwin.yaml +++ b/.github/workflows/pytest-darwin.yaml @@ -94,7 +94,7 @@ jobs: run: | source ./venv/bin/activate ulimit -c unlimited - sudo pytest tests/ --verbose --capture=no --cov=src + sudo --preserve-env=GITHUB_ENV pytest tests/ --verbose --capture=no --cov=src sudo chmod -R +rwx /cores/* - uses: actions/upload-artifact@v4 with: From 414d5940e3b7581d0e2eb45c21050b1e2cc55b9b Mon Sep 17 00:00:00 2001 From: Ant Date: Wed, 15 Oct 2025 16:05:45 -0400 Subject: [PATCH 11/20] #387 - Testing do not pull into main! --- .github/workflows/pytest-darwin.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pytest-darwin.yaml b/.github/workflows/pytest-darwin.yaml index 23fea3b1..18061fc4 100644 --- a/.github/workflows/pytest-darwin.yaml +++ b/.github/workflows/pytest-darwin.yaml @@ -93,8 +93,8 @@ jobs: - name: Run pytest run: | source ./venv/bin/activate - ulimit -c unlimited - sudo --preserve-env=GITHUB_ENV pytest tests/ --verbose --capture=no --cov=src + sudo ulimit -c unlimited + sudo -E pytest tests/ --verbose --capture=no --cov=src sudo chmod -R +rwx /cores/* - uses: actions/upload-artifact@v4 with: From aa0efa7ea5b09923d0164c4c78f3a190df3f51e5 Mon Sep 17 00:00:00 2001 From: Ant Date: Wed, 15 Oct 2025 16:10:24 -0400 Subject: [PATCH 12/20] #387 - Testing do not pull into main! --- .github/workflows/pytest-darwin.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pytest-darwin.yaml b/.github/workflows/pytest-darwin.yaml index 18061fc4..3cc64894 100644 --- a/.github/workflows/pytest-darwin.yaml +++ b/.github/workflows/pytest-darwin.yaml @@ -93,7 +93,7 @@ jobs: - name: Run pytest run: | source ./venv/bin/activate - sudo ulimit -c unlimited + sudo ulimit -c unlimited sudo -E pytest tests/ --verbose --capture=no --cov=src sudo chmod -R +rwx /cores/* - uses: actions/upload-artifact@v4 From 2e2a5242430f891181092013ffd03ba8d7af61e7 Mon Sep 17 00:00:00 2001 From: Ant Date: Wed, 15 Oct 2025 16:13:18 -0400 Subject: [PATCH 13/20] #387 - Testing do not pull into main! --- .github/workflows/pytest-darwin.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pytest-darwin.yaml b/.github/workflows/pytest-darwin.yaml index 3cc64894..a3266d77 100644 --- a/.github/workflows/pytest-darwin.yaml +++ b/.github/workflows/pytest-darwin.yaml @@ -94,7 +94,7 @@ jobs: run: | source ./venv/bin/activate sudo ulimit -c unlimited - sudo -E pytest tests/ --verbose --capture=no --cov=src + sudo -E -c bash 'pytest tests/ --verbose --capture=no --cov=src' sudo chmod -R +rwx /cores/* - uses: actions/upload-artifact@v4 with: From 34c4b9669b12ba753606200e01d02ddacd49107e Mon Sep 17 00:00:00 2001 From: Ant Date: Wed, 15 Oct 2025 16:19:06 -0400 Subject: [PATCH 14/20] #387 - Testing do not pull into main! --- .github/workflows/pytest-darwin.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pytest-darwin.yaml b/.github/workflows/pytest-darwin.yaml index a3266d77..f33f44ae 100644 --- a/.github/workflows/pytest-darwin.yaml +++ b/.github/workflows/pytest-darwin.yaml @@ -94,7 +94,7 @@ jobs: run: | source ./venv/bin/activate sudo ulimit -c unlimited - sudo -E -c bash 'pytest tests/ --verbose --capture=no --cov=src' + sudo -E bash -c 'pytest tests/ --verbose --capture=no --cov=src' sudo chmod -R +rwx /cores/* - uses: actions/upload-artifact@v4 with: From cac65056cd44f2b277af591d1452db836df8fd56 Mon Sep 17 00:00:00 2001 From: Ant Date: Wed, 15 Oct 2025 16:22:51 -0400 Subject: [PATCH 15/20] #387 - Testing do not pull into main! --- .github/workflows/pytest-darwin.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pytest-darwin.yaml b/.github/workflows/pytest-darwin.yaml index f33f44ae..484cca2a 100644 --- a/.github/workflows/pytest-darwin.yaml +++ b/.github/workflows/pytest-darwin.yaml @@ -92,8 +92,9 @@ jobs: - name: Run pytest run: | - source ./venv/bin/activate + sudo source ./venv/bin/activate sudo ulimit -c unlimited + sudo ulimit -c sudo -E bash -c 'pytest tests/ --verbose --capture=no --cov=src' sudo chmod -R +rwx /cores/* - uses: actions/upload-artifact@v4 From 393409a5fa6c914d32ba815750828c068c49f9cd Mon Sep 17 00:00:00 2001 From: Ant Date: Wed, 15 Oct 2025 16:26:52 -0400 Subject: [PATCH 16/20] #387 - Testing do not pull into main! --- .github/workflows/pytest-darwin.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pytest-darwin.yaml b/.github/workflows/pytest-darwin.yaml index 484cca2a..59f372c5 100644 --- a/.github/workflows/pytest-darwin.yaml +++ b/.github/workflows/pytest-darwin.yaml @@ -92,7 +92,7 @@ jobs: - name: Run pytest run: | - sudo source ./venv/bin/activate + source ./venv/bin/activate sudo ulimit -c unlimited sudo ulimit -c sudo -E bash -c 'pytest tests/ --verbose --capture=no --cov=src' From 4962ef1bcfb99fa7c6788bb1666ee550ee7f47d0 Mon Sep 17 00:00:00 2001 From: Ant Date: Wed, 15 Oct 2025 16:37:48 -0400 Subject: [PATCH 17/20] #387 - Testing do not pull into main! --- .github/workflows/pytest-darwin.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/pytest-darwin.yaml b/.github/workflows/pytest-darwin.yaml index 59f372c5..2902e82b 100644 --- a/.github/workflows/pytest-darwin.yaml +++ b/.github/workflows/pytest-darwin.yaml @@ -94,7 +94,10 @@ jobs: run: | source ./venv/bin/activate sudo ulimit -c unlimited + echo "sudo ulimit -c" sudo ulimit -c + echo "sudo env:" + sudo -E bash -c 'env' sudo -E bash -c 'pytest tests/ --verbose --capture=no --cov=src' sudo chmod -R +rwx /cores/* - uses: actions/upload-artifact@v4 From 26759c584506e26a060f679f9f63ce6ed7a4c013 Mon Sep 17 00:00:00 2001 From: Ant Date: Wed, 15 Oct 2025 16:43:24 -0400 Subject: [PATCH 18/20] #387 - Testing do not pull into main! --- .github/workflows/pytest-darwin.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pytest-darwin.yaml b/.github/workflows/pytest-darwin.yaml index 2902e82b..535b29db 100644 --- a/.github/workflows/pytest-darwin.yaml +++ b/.github/workflows/pytest-darwin.yaml @@ -98,7 +98,7 @@ jobs: sudo ulimit -c echo "sudo env:" sudo -E bash -c 'env' - sudo -E bash -c 'pytest tests/ --verbose --capture=no --cov=src' + sudo -E bash -c 'export PYTHONPATH="/Users/runner/work/sz-sdk-python-core/sz-sdk-python-core/src"; pytest tests/ --verbose --capture=no --cov=src' sudo chmod -R +rwx /cores/* - uses: actions/upload-artifact@v4 with: From f410171176012d211b2e4e3d93cf77c807bbbc4c Mon Sep 17 00:00:00 2001 From: Ant Date: Wed, 15 Oct 2025 16:50:13 -0400 Subject: [PATCH 19/20] #387 - Testing do not pull into main! --- .github/workflows/pytest-darwin.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pytest-darwin.yaml b/.github/workflows/pytest-darwin.yaml index 535b29db..6d24b6d7 100644 --- a/.github/workflows/pytest-darwin.yaml +++ b/.github/workflows/pytest-darwin.yaml @@ -98,7 +98,7 @@ jobs: sudo ulimit -c echo "sudo env:" sudo -E bash -c 'env' - sudo -E bash -c 'export PYTHONPATH="/Users/runner/work/sz-sdk-python-core/sz-sdk-python-core/src"; pytest tests/ --verbose --capture=no --cov=src' + sudo -E bash -c 'export PYTHONPATH="/Users/runner/work/sz-sdk-python-core/sz-sdk-python-core/src"; export LD_LIBRARY_PATH="/Users/runner/senzing/er/lib:/Users/runner/senzing/er/lib/macos"; export DYLD_LIBRARY_PATH="/Users/runner/senzing/er/lib:/Users/runner/senzing/er/lib/macos"; sudo ulimit -c unlimited; sudo pytest tests/ --verbose --capture=no --cov=src' sudo chmod -R +rwx /cores/* - uses: actions/upload-artifact@v4 with: From 688042e080a1aae3c5f5a1f862f7e2aa68a7df90 Mon Sep 17 00:00:00 2001 From: Ant Date: Wed, 15 Oct 2025 17:01:15 -0400 Subject: [PATCH 20/20] #387 - Testing do not pull into main! --- .github/workflows/pytest-darwin.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pytest-darwin.yaml b/.github/workflows/pytest-darwin.yaml index 6d24b6d7..0bd8ea5e 100644 --- a/.github/workflows/pytest-darwin.yaml +++ b/.github/workflows/pytest-darwin.yaml @@ -98,7 +98,7 @@ jobs: sudo ulimit -c echo "sudo env:" sudo -E bash -c 'env' - sudo -E bash -c 'export PYTHONPATH="/Users/runner/work/sz-sdk-python-core/sz-sdk-python-core/src"; export LD_LIBRARY_PATH="/Users/runner/senzing/er/lib:/Users/runner/senzing/er/lib/macos"; export DYLD_LIBRARY_PATH="/Users/runner/senzing/er/lib:/Users/runner/senzing/er/lib/macos"; sudo ulimit -c unlimited; sudo pytest tests/ --verbose --capture=no --cov=src' + sudo -E bash -c 'export PYTHONPATH="/Users/runner/work/sz-sdk-python-core/sz-sdk-python-core/src"; export LD_LIBRARY_PATH="/Users/runner/senzing/er/lib:/Users/runner/senzing/er/lib/macos"; export DYLD_LIBRARY_PATH="/Users/runner/senzing/er/lib:/Users/runner/senzing/er/lib/macos"; ulimit -c unlimited; ulimit -c; pytest tests/ --verbose --capture=no --cov=src; env' sudo chmod -R +rwx /cores/* - uses: actions/upload-artifact@v4 with: