Skip to content

Commit

Permalink
chore: rename package to data-factory-testing-framework
Browse files Browse the repository at this point in the history
  • Loading branch information
arjendev committed Dec 8, 2023
1 parent 75dc76e commit 224d730
Show file tree
Hide file tree
Showing 94 changed files with 231 additions and 232 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
id-token: write
environment:
name: pypi
url: https://pypi.org/p/azure-data-factory-testing-framework
url: https://pypi.org/p/data-factory-testing-framework
steps:
#----------------------------------------------
# check-out repo and set-up python
Expand Down Expand Up @@ -66,7 +66,6 @@ jobs:
poetry version 0.0.0.alpha${{ github.run_number}}
poetry build
- name: Publish package distributions to PyPI
if: github.ref == 'refs/heads/main'
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: ./dist
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ Data Factory does not support unit testing out of the box. The only way to valid

1. Set up an empty Python project with your favorite testing library
2. Install the package using your preferred package manager:
* Pip: `pip install azure-data-factory-testing-framework`
* Poetry: `poetry add azure-data-factory-testing-framework`
* Pip: `pip install data-factory-testing-framework`
* Poetry: `poetry add data-factory-testing-framework`
3. Start writing tests

## Features - Examples
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import pytest
from azure_data_factory_testing_framework.state import RunParameterType
from azure_data_factory_testing_framework.state.run_parameter import RunParameter
from azure_data_factory_testing_framework.test_framework import TestFramework, TestFrameworkType
from data_factory_testing_framework.state import RunParameterType
from data_factory_testing_framework.state.run_parameter import RunParameter
from data_factory_testing_framework.test_framework import TestFramework, TestFrameworkType


def test_batch_job_pipeline(request: pytest.FixtureRequest) -> None:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# flake8: noqa: E501
import pytest
from azure_data_factory_testing_framework.models.pipeline import Pipeline
from azure_data_factory_testing_framework.state import (
from data_factory_testing_framework.models.pipeline import Pipeline
from data_factory_testing_framework.state import (
PipelineRunState,
PipelineRunVariable,
RunParameter,
RunParameterType,
)
from azure_data_factory_testing_framework.test_framework import TestFramework, TestFrameworkType
from data_factory_testing_framework.test_framework import TestFramework, TestFrameworkType


@pytest.fixture
Expand Down
6 changes: 3 additions & 3 deletions examples/fabric/batch_job/test_fabric_batchjob_functional.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import pytest
from azure_data_factory_testing_framework.state import RunParameterType
from azure_data_factory_testing_framework.state.run_parameter import RunParameter
from azure_data_factory_testing_framework.test_framework import TestFramework, TestFrameworkType
from data_factory_testing_framework.state import RunParameterType
from data_factory_testing_framework.state.run_parameter import RunParameter
from data_factory_testing_framework.test_framework import TestFramework, TestFrameworkType


def test_batch_job_pipeline(request: pytest.FixtureRequest) -> None:
Expand Down
6 changes: 3 additions & 3 deletions examples/fabric/batch_job/test_fabric_batchjob_unit.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# flake8: noqa: E501
import pytest
from azure_data_factory_testing_framework.models.pipeline import Pipeline
from azure_data_factory_testing_framework.state import (
from data_factory_testing_framework.models.pipeline import Pipeline
from data_factory_testing_framework.state import (
PipelineRunState,
PipelineRunVariable,
RunParameter,
RunParameterType,
)
from azure_data_factory_testing_framework.test_framework import TestFramework, TestFrameworkType
from data_factory_testing_framework.test_framework import TestFramework, TestFrameworkType


@pytest.fixture
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tool.poetry]
name = "azure-data-factory-testing-framework"
name = "data-factory-testing-framework"
version = "0.0.0"
description = "A unit test framework that allows you to write unit and functional tests for Data Factory pipelines against the git integrated json resource files."
authors = ["Arjen Kroezen <arjenkroezen@microsoft.com>", "Yennifer Santos <ysantos@microsoft.com>", "Jaya Kumar <kumarjaya@microsoft.com>", "Leonard Herold <lherold@microsoft.com>"]
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from azure_data_factory_testing_framework.deserializers.shared._activity_deserializer import (
from data_factory_testing_framework.deserializers.shared._activity_deserializer import (
_get_activity_from_activity_data,
)
from azure_data_factory_testing_framework.deserializers.shared._data_factory_element_replacer import (
from data_factory_testing_framework.deserializers.shared._data_factory_element_replacer import (
_find_and_replace_expressions_in_dict,
)
from azure_data_factory_testing_framework.models.pipeline import Pipeline
from data_factory_testing_framework.models.pipeline import Pipeline


def _parse_pipeline_from_json(name: str, json_data: dict) -> Pipeline:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import json

from azure_data_factory_testing_framework.deserializers._deserializer_base import _parse_pipeline_from_json
from azure_data_factory_testing_framework.models.pipeline import Pipeline
from data_factory_testing_framework.deserializers._deserializer_base import _parse_pipeline_from_json
from data_factory_testing_framework.models.pipeline import Pipeline


def parse_data_factory_pipeline_from_pipeline_json(pipeline_json: str) -> Pipeline:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import json

from azure_data_factory_testing_framework.deserializers._deserializer_base import _parse_pipeline_from_json
from azure_data_factory_testing_framework.models.pipeline import Pipeline
from data_factory_testing_framework.deserializers._deserializer_base import _parse_pipeline_from_json
from data_factory_testing_framework.models.pipeline import Pipeline


def parse_fabric_pipeline_from_pipeline_json_files(metadata_json: str, pipeline_json: str) -> Pipeline:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
from typing import List

from azure_data_factory_testing_framework.models.activities.activity import Activity
from azure_data_factory_testing_framework.models.activities.append_variable_activity import AppendVariableActivity
from azure_data_factory_testing_framework.models.activities.execute_pipeline_activity import ExecutePipelineActivity
from azure_data_factory_testing_framework.models.activities.fail_activity import FailActivity
from azure_data_factory_testing_framework.models.activities.filter_activity import FilterActivity
from azure_data_factory_testing_framework.models.activities.for_each_activity import ForEachActivity
from azure_data_factory_testing_framework.models.activities.if_condition_activity import IfConditionActivity
from azure_data_factory_testing_framework.models.activities.set_variable_activity import SetVariableActivity
from azure_data_factory_testing_framework.models.activities.switch_activity import SwitchActivity
from azure_data_factory_testing_framework.models.activities.until_activity import UntilActivity
from data_factory_testing_framework.models.activities.activity import Activity
from data_factory_testing_framework.models.activities.append_variable_activity import AppendVariableActivity
from data_factory_testing_framework.models.activities.execute_pipeline_activity import ExecutePipelineActivity
from data_factory_testing_framework.models.activities.fail_activity import FailActivity
from data_factory_testing_framework.models.activities.filter_activity import FilterActivity
from data_factory_testing_framework.models.activities.for_each_activity import ForEachActivity
from data_factory_testing_framework.models.activities.if_condition_activity import IfConditionActivity
from data_factory_testing_framework.models.activities.set_variable_activity import SetVariableActivity
from data_factory_testing_framework.models.activities.switch_activity import SwitchActivity
from data_factory_testing_framework.models.activities.until_activity import UntilActivity


def _get_activity_from_activity_data(activity_data: dict) -> Activity:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from typing import Any

from azure_data_factory_testing_framework.models.data_factory_element import DataFactoryElement
from data_factory_testing_framework.models.data_factory_element import DataFactoryElement


def _find_and_replace_expressions_in_dict(obj: any, visited: list = None) -> None:
Expand Down
5 changes: 5 additions & 0 deletions src/data_factory_testing_framework/functions/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from data_factory_testing_framework.functions.functions_repository import FunctionsRepository

__all__ = [
"FunctionsRepository",
]
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,30 @@
from lark import Discard, Token, Transformer
from lxml.etree import _Element

from azure_data_factory_testing_framework.exceptions.activity_not_found_error import ActivityNotFoundError
from azure_data_factory_testing_framework.exceptions.activity_output_field_not_found_error import (
from data_factory_testing_framework.exceptions.activity_not_found_error import ActivityNotFoundError
from data_factory_testing_framework.exceptions.activity_output_field_not_found_error import (
ActivityOutputFieldNotFoundError,
)
from azure_data_factory_testing_framework.exceptions.dataset_parameter_not_found_error import (
from data_factory_testing_framework.exceptions.dataset_parameter_not_found_error import (
DatasetParameterNotFoundError,
)
from azure_data_factory_testing_framework.exceptions.expression_evaluation_error import (
from data_factory_testing_framework.exceptions.expression_evaluation_error import (
ExpressionEvaluationError,
)
from azure_data_factory_testing_framework.exceptions.expression_parameter_not_found_error import (
from data_factory_testing_framework.exceptions.expression_parameter_not_found_error import (
ExpressionParameterNotFoundError,
)
from azure_data_factory_testing_framework.exceptions.linked_service_parameter_not_found_error import (
from data_factory_testing_framework.exceptions.linked_service_parameter_not_found_error import (
LinkedServiceParameterNotFoundError,
)
from azure_data_factory_testing_framework.exceptions.state_iteration_item_not_set_error import (
from data_factory_testing_framework.exceptions.state_iteration_item_not_set_error import (
StateIterationItemNotSetError,
)
from azure_data_factory_testing_framework.exceptions.variable_not_found_error import VariableNotFoundError
from azure_data_factory_testing_framework.functions.functions_repository import FunctionsRepository
from azure_data_factory_testing_framework.state.pipeline_run_state import PipelineRunState
from azure_data_factory_testing_framework.state.run_parameter import RunParameter
from azure_data_factory_testing_framework.state.run_parameter_type import RunParameterType
from data_factory_testing_framework.exceptions.variable_not_found_error import VariableNotFoundError
from data_factory_testing_framework.functions.functions_repository import FunctionsRepository
from data_factory_testing_framework.state.pipeline_run_state import PipelineRunState
from data_factory_testing_framework.state.run_parameter import RunParameter
from data_factory_testing_framework.state.run_parameter_type import RunParameterType


class ExpressionTransformer(Transformer):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
from lark import Lark, Token, Tree, UnexpectedCharacters
from lark.exceptions import VisitError

from azure_data_factory_testing_framework.exceptions.expression_parsing_error import ExpressionParsingError
from azure_data_factory_testing_framework.functions._expression_transformer import ExpressionTransformer
from azure_data_factory_testing_framework.functions.functions_repository import FunctionsRepository
from azure_data_factory_testing_framework.state.pipeline_run_state import PipelineRunState
from data_factory_testing_framework.exceptions.expression_parsing_error import ExpressionParsingError
from data_factory_testing_framework.functions._expression_transformer import ExpressionTransformer
from data_factory_testing_framework.functions.functions_repository import FunctionsRepository
from data_factory_testing_framework.state.pipeline_run_state import PipelineRunState


class ExpressionEvaluator:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from typing import Callable, Dict

import azure_data_factory_testing_framework.functions.functions_collection_implementation as collection_functions
import azure_data_factory_testing_framework.functions.functions_conversion_implementation as conversion_functions
import azure_data_factory_testing_framework.functions.functions_date_implementation as date_functions
import azure_data_factory_testing_framework.functions.functions_logical_implementation as logical_functions
import azure_data_factory_testing_framework.functions.functions_math_implementation as math_functions
import azure_data_factory_testing_framework.functions.functions_string_implementation as string_functions
import data_factory_testing_framework.functions.functions_collection_implementation as collection_functions
import data_factory_testing_framework.functions.functions_conversion_implementation as conversion_functions
import data_factory_testing_framework.functions.functions_date_implementation as date_functions
import data_factory_testing_framework.functions.functions_logical_implementation as logical_functions
import data_factory_testing_framework.functions.functions_math_implementation as math_functions
import data_factory_testing_framework.functions.functions_string_implementation as string_functions


class FunctionsRepository:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from typing import Any, List

from azure_data_factory_testing_framework.models.activities.activity_dependency import (
from data_factory_testing_framework.models.activities.activity_dependency import (
ActivityDependency,
)
from azure_data_factory_testing_framework.models.data_factory_element import DataFactoryElement
from azure_data_factory_testing_framework.state import PipelineRunState
from azure_data_factory_testing_framework.state.dependency_condition import DependencyCondition
from data_factory_testing_framework.models.data_factory_element import DataFactoryElement
from data_factory_testing_framework.state import PipelineRunState
from data_factory_testing_framework.state.dependency_condition import DependencyCondition


class Activity:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from typing import List, Union

from azure_data_factory_testing_framework.state.dependency_condition import DependencyCondition
from data_factory_testing_framework.state.dependency_condition import DependencyCondition


class ActivityDependency:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from typing import Any

from azure_data_factory_testing_framework.models.activities.control_activity import ControlActivity
from azure_data_factory_testing_framework.models.data_factory_element import DataFactoryElement
from azure_data_factory_testing_framework.state import PipelineRunState
from data_factory_testing_framework.models.activities.control_activity import ControlActivity
from data_factory_testing_framework.models.data_factory_element import DataFactoryElement
from data_factory_testing_framework.state import PipelineRunState


class AppendVariableActivity(ControlActivity):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from typing import Any, Callable, Iterator, List

from azure_data_factory_testing_framework.models.activities.activity import Activity
from azure_data_factory_testing_framework.state import PipelineRunState
from data_factory_testing_framework.models.activities.activity import Activity
from data_factory_testing_framework.state import PipelineRunState


class ControlActivity(Activity):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from typing import Any, Callable, Iterator, List

from azure_data_factory_testing_framework.models.activities.activity import Activity
from azure_data_factory_testing_framework.models.activities.control_activity import ControlActivity
from azure_data_factory_testing_framework.models.data_factory_element import DataFactoryElement
from azure_data_factory_testing_framework.models.pipeline import Pipeline
from azure_data_factory_testing_framework.state import PipelineRunState, RunParameterType
from azure_data_factory_testing_framework.state.run_parameter import RunParameter
from data_factory_testing_framework.models.activities.activity import Activity
from data_factory_testing_framework.models.activities.control_activity import ControlActivity
from data_factory_testing_framework.models.data_factory_element import DataFactoryElement
from data_factory_testing_framework.models.pipeline import Pipeline
from data_factory_testing_framework.state import PipelineRunState, RunParameterType
from data_factory_testing_framework.state.run_parameter import RunParameter


class ExecutePipelineActivity(ControlActivity):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from typing import Any

from azure_data_factory_testing_framework.models.activities.control_activity import ControlActivity
from azure_data_factory_testing_framework.state import PipelineRunState
from azure_data_factory_testing_framework.state.dependency_condition import DependencyCondition
from data_factory_testing_framework.models.activities.control_activity import ControlActivity
from data_factory_testing_framework.state import PipelineRunState
from data_factory_testing_framework.state.dependency_condition import DependencyCondition


class FailActivity(ControlActivity):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from typing import Any

from azure_data_factory_testing_framework.models.activities.control_activity import ControlActivity
from azure_data_factory_testing_framework.models.data_factory_element import DataFactoryElement
from azure_data_factory_testing_framework.state import PipelineRunState
from azure_data_factory_testing_framework.state.dependency_condition import DependencyCondition
from data_factory_testing_framework.models.activities.control_activity import ControlActivity
from data_factory_testing_framework.models.data_factory_element import DataFactoryElement
from data_factory_testing_framework.state import PipelineRunState
from data_factory_testing_framework.state.dependency_condition import DependencyCondition


class FilterActivity(ControlActivity):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from typing import Any, Callable, Iterator, List

from azure_data_factory_testing_framework.models.activities.activity import Activity
from azure_data_factory_testing_framework.models.activities.control_activity import ControlActivity
from azure_data_factory_testing_framework.models.data_factory_element import DataFactoryElement
from azure_data_factory_testing_framework.state import PipelineRunState
from data_factory_testing_framework.models.activities.activity import Activity
from data_factory_testing_framework.models.activities.control_activity import ControlActivity
from data_factory_testing_framework.models.data_factory_element import DataFactoryElement
from data_factory_testing_framework.state import PipelineRunState


class ForEachActivity(ControlActivity):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from typing import Any, Callable, Iterator, List

from azure_data_factory_testing_framework.models.activities.activity import Activity
from azure_data_factory_testing_framework.models.activities.control_activity import ControlActivity
from azure_data_factory_testing_framework.models.data_factory_element import DataFactoryElement
from azure_data_factory_testing_framework.state import PipelineRunState
from data_factory_testing_framework.models.activities.activity import Activity
from data_factory_testing_framework.models.activities.control_activity import ControlActivity
from data_factory_testing_framework.models.data_factory_element import DataFactoryElement
from data_factory_testing_framework.state import PipelineRunState


class IfConditionActivity(ControlActivity):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from typing import Any

from azure_data_factory_testing_framework.models.activities.control_activity import ControlActivity
from azure_data_factory_testing_framework.models.data_factory_element import DataFactoryElement
from azure_data_factory_testing_framework.state import PipelineRunState
from data_factory_testing_framework.models.activities.control_activity import ControlActivity
from data_factory_testing_framework.models.data_factory_element import DataFactoryElement
from data_factory_testing_framework.state import PipelineRunState


class SetVariableActivity(ControlActivity):
Expand Down
Loading

0 comments on commit 224d730

Please sign in to comment.