diff --git a/src/data_factory_testing_framework/_test_framework.py b/src/data_factory_testing_framework/_test_framework.py index 36c0a57f..ea2deb1f 100644 --- a/src/data_factory_testing_framework/_test_framework.py +++ b/src/data_factory_testing_framework/_test_framework.py @@ -60,13 +60,11 @@ def __init__( self._repository = FabricRepositoryFactory().parse_from_folder(root_folder_path) else: self._repository = DataFactoryRepository([]) - elif self._framework_type == TestFrameworkType.DataFactory: + elif self._framework_type == TestFrameworkType.DataFactory or self._framework_type == TestFrameworkType.Synapse: if root_folder_path is not None: self._repository = DataFactoryRepositoryFactory().parse_from_folder(root_folder_path) else: self._repository = DataFactoryRepository([]) - elif self._framework_type == TestFrameworkType.Synapse: - raise NotImplementedError("Synapse test framework is not implemented yet.") self._should_evaluate_child_pipelines = should_evaluate_child_pipelines diff --git a/tests/functional/execute_child_pipeline_data_factory/pipeline/child.json b/tests/functional/execute_child_pipeline/pipeline/child.json similarity index 100% rename from tests/functional/execute_child_pipeline_data_factory/pipeline/child.json rename to tests/functional/execute_child_pipeline/pipeline/child.json diff --git a/tests/functional/execute_child_pipeline_data_factory/pipeline/main.json b/tests/functional/execute_child_pipeline/pipeline/main.json similarity index 100% rename from tests/functional/execute_child_pipeline_data_factory/pipeline/main.json rename to tests/functional/execute_child_pipeline/pipeline/main.json diff --git a/tests/functional/execute_child_pipeline_data_factory/test_execute_pipeline_activity_data_factory.py b/tests/functional/execute_child_pipeline/test_execute_child_pipeline_activity.py similarity index 81% rename from tests/functional/execute_child_pipeline_data_factory/test_execute_pipeline_activity_data_factory.py rename to tests/functional/execute_child_pipeline/test_execute_child_pipeline_activity.py index a2ff2c74..6d5e8817 100644 --- a/tests/functional/execute_child_pipeline_data_factory/test_execute_pipeline_activity_data_factory.py +++ b/tests/functional/execute_child_pipeline/test_execute_child_pipeline_activity.py @@ -3,11 +3,13 @@ from data_factory_testing_framework.exceptions import PipelineNotFoundError from data_factory_testing_framework.state import RunParameter, RunParameterType - -def test_execute_pipeline_activity_child_activities_executed(request: pytest.FixtureRequest) -> None: +@pytest.mark.parametrize( + "framework_type", [TestFrameworkType.DataFactory, TestFrameworkType.Synapse] +) +def test_execute_pipeline_activity_child_activities_executed(framework_type: str, request: pytest.FixtureRequest) -> None: # Arrange test_framework = TestFramework( - framework_type=TestFrameworkType.DataFactory, + framework_type=framework_type, root_folder_path=request.fspath.dirname, should_evaluate_child_pipelines=True, ) @@ -32,13 +34,15 @@ def test_execute_pipeline_activity_child_activities_executed(request: pytest.Fix with pytest.raises(StopIteration): next(activities) - +@pytest.mark.parametrize( + "framework_type", [TestFrameworkType.DataFactory, TestFrameworkType.Synapse] +) def test_execute_pipeline_activity_evaluate_child_pipelines_child_pipeline_not_known_exception_thrown( - request: pytest.FixtureRequest, + framework_type: str, request: pytest.FixtureRequest, ) -> None: # Arrange test_framework = TestFramework( - framework_type=TestFrameworkType.DataFactory, + framework_type=framework_type, root_folder_path=request.fspath.dirname, should_evaluate_child_pipelines=True, ) diff --git a/tests/functional/filter_activity_pipeline/.platform b/tests/functional/filter_activity_pipeline_fabric/.platform similarity index 100% rename from tests/functional/filter_activity_pipeline/.platform rename to tests/functional/filter_activity_pipeline_fabric/.platform diff --git a/tests/functional/filter_activity_pipeline/pipeline-content.json b/tests/functional/filter_activity_pipeline_fabric/pipeline-content.json similarity index 100% rename from tests/functional/filter_activity_pipeline/pipeline-content.json rename to tests/functional/filter_activity_pipeline_fabric/pipeline-content.json diff --git a/tests/functional/filter_activity_pipeline/test_filter_activity_pipeline.py b/tests/functional/filter_activity_pipeline_fabric/test_filter_activity_pipeline_fabric.py similarity index 91% rename from tests/functional/filter_activity_pipeline/test_filter_activity_pipeline.py rename to tests/functional/filter_activity_pipeline_fabric/test_filter_activity_pipeline_fabric.py index a81a82f4..a9527ab7 100644 --- a/tests/functional/filter_activity_pipeline/test_filter_activity_pipeline.py +++ b/tests/functional/filter_activity_pipeline_fabric/test_filter_activity_pipeline_fabric.py @@ -15,7 +15,7 @@ ([-1, 3, 4], [-1, 3]), ], ) -def test_filter_activity(input_values: [], expected_filtered_values: [], request: pytest.FixtureRequest) -> None: +def test_filter_activity_pipeline_fabric(input_values: [], expected_filtered_values: [], request: pytest.FixtureRequest) -> None: # Arrange test_framework = TestFramework( framework_type=TestFrameworkType.Fabric, diff --git a/tests/functional/switch_activity_data_factory/pipeline/switch-empty-default.json b/tests/functional/switch_activity_pipeline/pipeline/switch-empty-default.json similarity index 100% rename from tests/functional/switch_activity_data_factory/pipeline/switch-empty-default.json rename to tests/functional/switch_activity_pipeline/pipeline/switch-empty-default.json diff --git a/tests/functional/switch_activity_pipeline/test_switch_activity_pipeline.py b/tests/functional/switch_activity_pipeline/test_switch_activity_pipeline.py index d3723a85..9766eae3 100644 --- a/tests/functional/switch_activity_pipeline/test_switch_activity_pipeline.py +++ b/tests/functional/switch_activity_pipeline/test_switch_activity_pipeline.py @@ -3,24 +3,21 @@ from data_factory_testing_framework.state import RunParameter, RunParameterType +@pytest.mark.parametrize( + "framework_type", [TestFrameworkType.DataFactory, TestFrameworkType.Synapse] +) @pytest.mark.parametrize( "on_value,expected_outcome", - [ - ("case_1", "case_1_hit"), - ("case_2", "case_2_hit"), - ("case_3", "default_hit"), - ("case_4", "default_hit"), - ("case_anything", "default_hit"), - ], + [("case_1", "case_1_hit"), ("case_2", "case_2_hit")], ) -def test_switch_activity(on_value: str, expected_outcome: str, request: pytest.FixtureRequest) -> None: +def test_switch_activity(framework_type: str, on_value: str, expected_outcome: str, request: pytest.FixtureRequest) -> None: # Arrange test_framework = TestFramework( - framework_type=TestFrameworkType.Fabric, + framework_type=framework_type, root_folder_path=request.fspath.dirname, should_evaluate_child_pipelines=True, ) - pipeline = test_framework.get_pipeline_by_name("switchtest") + pipeline = test_framework.get_pipeline_by_name("switch-empty-default") # Act activities = test_framework.evaluate_pipeline( diff --git a/tests/functional/switch_activity_pipeline/.platform b/tests/functional/switch_activity_pipeline_fabric/.platform similarity index 100% rename from tests/functional/switch_activity_pipeline/.platform rename to tests/functional/switch_activity_pipeline_fabric/.platform diff --git a/tests/functional/switch_activity_pipeline/pipeline-content.json b/tests/functional/switch_activity_pipeline_fabric/pipeline-content.json similarity index 100% rename from tests/functional/switch_activity_pipeline/pipeline-content.json rename to tests/functional/switch_activity_pipeline_fabric/pipeline-content.json diff --git a/tests/functional/switch_activity_data_factory/test_switch_activity_data_factory.py b/tests/functional/switch_activity_pipeline_fabric/test_switch_activity_pipeline_fabric.py similarity index 62% rename from tests/functional/switch_activity_data_factory/test_switch_activity_data_factory.py rename to tests/functional/switch_activity_pipeline_fabric/test_switch_activity_pipeline_fabric.py index cfb3458e..c771e697 100644 --- a/tests/functional/switch_activity_data_factory/test_switch_activity_data_factory.py +++ b/tests/functional/switch_activity_pipeline_fabric/test_switch_activity_pipeline_fabric.py @@ -5,16 +5,22 @@ @pytest.mark.parametrize( "on_value,expected_outcome", - [("case_1", "case_1_hit"), ("case_2", "case_2_hit")], + [ + ("case_1", "case_1_hit"), + ("case_2", "case_2_hit"), + ("case_3", "default_hit"), + ("case_4", "default_hit"), + ("case_anything", "default_hit"), + ], ) -def test_switch_activity(on_value: str, expected_outcome: str, request: pytest.FixtureRequest) -> None: +def test_switch_activity_pipeline_fabric(on_value: str, expected_outcome: str, request: pytest.FixtureRequest) -> None: # Arrange test_framework = TestFramework( - framework_type=TestFrameworkType.DataFactory, + framework_type=TestFrameworkType.Fabric, root_folder_path=request.fspath.dirname, should_evaluate_child_pipelines=True, ) - pipeline = test_framework.get_pipeline_by_name("switch-empty-default") + pipeline = test_framework.get_pipeline_by_name("switchtest") # Act activities = test_framework.evaluate_pipeline( diff --git a/tests/functional/variables_default_value/test_variables_default.py b/tests/functional/variables_default_value/test_variables_default.py index 6d5cec81..8fce1a93 100644 --- a/tests/functional/variables_default_value/test_variables_default.py +++ b/tests/functional/variables_default_value/test_variables_default.py @@ -2,10 +2,13 @@ from data_factory_testing_framework import TestFramework, TestFrameworkType -def test_string_default_variables(request: pytest.FixtureRequest) -> None: +@pytest.mark.parametrize( + "framework_type", [TestFrameworkType.DataFactory, TestFrameworkType.Synapse] +) +def test_string_default_variables(framework_type: str, request: pytest.FixtureRequest) -> None: # Arrange test_framework = TestFramework( - framework_type=TestFrameworkType.DataFactory, root_folder_path=request.fspath.dirname + framework_type=framework_type, root_folder_path=request.fspath.dirname ) pipeline = test_framework.get_pipeline_by_name("default_variables") diff --git a/tests/functional/xml/test_xml.py b/tests/functional/xml/test_xml.py index 1317d1eb..24284039 100644 --- a/tests/functional/xml/test_xml.py +++ b/tests/functional/xml/test_xml.py @@ -3,11 +3,13 @@ import pytest from data_factory_testing_framework import TestFramework, TestFrameworkType - -def test_batch_job_pipeline(request: pytest.FixtureRequest) -> None: +@pytest.mark.parametrize( + "framework_type",[TestFrameworkType.DataFactory, TestFrameworkType.Synapse] +) +def test_batch_job_pipeline(framework_type: str, request: pytest.FixtureRequest) -> None: # Arrange test_framework = TestFramework( - framework_type=TestFrameworkType.DataFactory, root_folder_path=request.fspath.dirname + framework_type=framework_type, root_folder_path=request.fspath.dirname ) pipeline = test_framework.get_pipeline_by_name("xpath_example_08_a")