diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index daab3152..74868dbc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,24 +47,20 @@ jobs: #---------------------------------------------- - name: Install dependencies if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' - working-directory: ./src run: poetry install --no-interaction --no-root #---------------------------------------------- # install your root project, if required #---------------------------------------------- - name: Install project - working-directory: ./src run: poetry install --no-interaction #---------------------------------------------- # run test suite #---------------------------------------------- - name: Run tests - working-directory: ./src run: | source .venv/bin/activate - pytest tests + pytest . - name: Set build version and build package - working-directory: ./src run: | source .venv/bin/activate poetry version 0.0.0.alpha${{ github.run_number}} @@ -72,4 +68,4 @@ jobs: - name: Publish package distributions to PyPI uses: pypa/gh-action-pypi-publish@release/v1 with: - packages-dir: ./src/dist \ No newline at end of file + packages-dir: ./dist \ No newline at end of file diff --git a/.gitignore b/.gitignore index 45739b38..6b630e15 100644 --- a/.gitignore +++ b/.gitignore @@ -326,6 +326,7 @@ paket-files/ # Python Tools for Visual Studio (PTVS) __pycache__/ *.pyc +.pytest_cache # Cake - Uncomment if you are using it # tools/** @@ -396,4 +397,7 @@ FodyWeavers.xsd # JetBrains Rider *.sln.iml -.idea \ No newline at end of file +.idea + +# Distributions / Releases +dist diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2589043c..aae231f3 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,9 +3,9 @@ repos: rev: 1.6.1 hooks: - id: poetry-check - args: ["-C", "./src"] + args: [] - id: poetry-lock - args: ["-C", "./src", "--no-update"] + args: ["--no-update"] - repo: https://github.com/astral-sh/ruff-pre-commit rev: v0.1.5 hooks: @@ -16,7 +16,7 @@ repos: hooks: - id: pytest name: pytest - entry: poetry -C src run pytest src + entry: poetry -C src run pytest . language: system types: [python] require_serial: true diff --git a/src/README.md b/DEVELOPMENT.md similarity index 100% rename from src/README.md rename to DEVELOPMENT.md diff --git a/src/examples/data_factory/batch_job/pipeline/batch_job.json b/examples/data_factory/batch_job/pipeline/batch_job.json similarity index 100% rename from src/examples/data_factory/batch_job/pipeline/batch_job.json rename to examples/data_factory/batch_job/pipeline/batch_job.json diff --git a/src/examples/data_factory/batch_job/test_data_factory_batchjob_functional.py b/examples/data_factory/batch_job/test_data_factory_batchjob_functional.py similarity index 99% rename from src/examples/data_factory/batch_job/test_data_factory_batchjob_functional.py rename to examples/data_factory/batch_job/test_data_factory_batchjob_functional.py index 30fb6b2e..e488b8f3 100644 --- a/src/examples/data_factory/batch_job/test_data_factory_batchjob_functional.py +++ b/examples/data_factory/batch_job/test_data_factory_batchjob_functional.py @@ -1,5 +1,4 @@ import pytest - from azure_data_factory_testing_framework.models.activities.activity import Activity from azure_data_factory_testing_framework.state import RunParameterType from azure_data_factory_testing_framework.state.run_parameter import RunParameter diff --git a/src/examples/data_factory/batch_job/test_data_factory_batchjob_unit.py b/examples/data_factory/batch_job/test_data_factory_batchjob_unit.py similarity index 99% rename from src/examples/data_factory/batch_job/test_data_factory_batchjob_unit.py rename to examples/data_factory/batch_job/test_data_factory_batchjob_unit.py index 8508b28b..0d324a92 100644 --- a/src/examples/data_factory/batch_job/test_data_factory_batchjob_unit.py +++ b/examples/data_factory/batch_job/test_data_factory_batchjob_unit.py @@ -1,6 +1,5 @@ # flake8: noqa: E501 import pytest - from azure_data_factory_testing_framework.models.activities.activity import Activity from azure_data_factory_testing_framework.models.pipeline import Pipeline from azure_data_factory_testing_framework.state import ( diff --git a/src/examples/fabric/batch_job/item.metadata.json b/examples/fabric/batch_job/item.metadata.json similarity index 100% rename from src/examples/fabric/batch_job/item.metadata.json rename to examples/fabric/batch_job/item.metadata.json diff --git a/src/examples/fabric/batch_job/pipeline-content.json b/examples/fabric/batch_job/pipeline-content.json similarity index 100% rename from src/examples/fabric/batch_job/pipeline-content.json rename to examples/fabric/batch_job/pipeline-content.json diff --git a/src/examples/fabric/batch_job/test_fabric_batchjob_functional.py b/examples/fabric/batch_job/test_fabric_batchjob_functional.py similarity index 99% rename from src/examples/fabric/batch_job/test_fabric_batchjob_functional.py rename to examples/fabric/batch_job/test_fabric_batchjob_functional.py index 1f79de10..caaceed8 100644 --- a/src/examples/fabric/batch_job/test_fabric_batchjob_functional.py +++ b/examples/fabric/batch_job/test_fabric_batchjob_functional.py @@ -1,5 +1,4 @@ import pytest - from azure_data_factory_testing_framework.models.activities.activity import Activity from azure_data_factory_testing_framework.state import RunParameterType from azure_data_factory_testing_framework.state.run_parameter import RunParameter diff --git a/src/examples/fabric/batch_job/test_fabric_batchjob_unit.py b/examples/fabric/batch_job/test_fabric_batchjob_unit.py similarity index 99% rename from src/examples/fabric/batch_job/test_fabric_batchjob_unit.py rename to examples/fabric/batch_job/test_fabric_batchjob_unit.py index bd7c2375..659afad7 100644 --- a/src/examples/fabric/batch_job/test_fabric_batchjob_unit.py +++ b/examples/fabric/batch_job/test_fabric_batchjob_unit.py @@ -1,6 +1,5 @@ # flake8: noqa: E501 import pytest - from azure_data_factory_testing_framework.models.pipeline import Pipeline from azure_data_factory_testing_framework.state import ( PipelineRunState, diff --git a/src/poetry.lock b/poetry.lock similarity index 100% rename from src/poetry.lock rename to poetry.lock diff --git a/src/pyproject.toml b/pyproject.toml similarity index 86% rename from src/pyproject.toml rename to pyproject.toml index e1959247..4836a4d5 100644 --- a/src/pyproject.toml +++ b/pyproject.toml @@ -2,9 +2,10 @@ name = "azure-data-factory-testing-framework" version = "0.0.0" description = "" -authors = ["Arjen Kroezen "] -readme = "../README.md" +authors = ["Arjen Kroezen ", "Yennifer Santos ", "Jaya Kumar ", "Leonard Herold "] +readme = "README.md" license = "MIT" +include = [ "README.md", "LICENSE" ] [tool.poetry.dependencies] python = "^3.9" @@ -24,6 +25,7 @@ pre-commit = "^3.5.0" requires = ["poetry-core"] build-backend = "poetry.core.masonry.api" + [tool.ruff] select = [ "A", # flake8 builtins diff --git a/src/.gitignore b/src/.gitignore deleted file mode 100644 index 3d6b9e1b..00000000 --- a/src/.gitignore +++ /dev/null @@ -1 +0,0 @@ -.pytest_cache \ No newline at end of file diff --git a/src/tests/unit/models/activities/base/__init__.py b/tests/__init__.py similarity index 100% rename from src/tests/unit/models/activities/base/__init__.py rename to tests/__init__.py diff --git a/src/tests/unit/models/activities/control_activities/__init__.py b/tests/functional/__init__.py similarity index 100% rename from src/tests/unit/models/activities/control_activities/__init__.py rename to tests/functional/__init__.py diff --git a/src/tests/functional/execute_child_pipeline/pipeline/child.json b/tests/functional/execute_child_pipeline/pipeline/child.json similarity index 100% rename from src/tests/functional/execute_child_pipeline/pipeline/child.json rename to tests/functional/execute_child_pipeline/pipeline/child.json diff --git a/src/tests/functional/execute_child_pipeline/pipeline/main.json b/tests/functional/execute_child_pipeline/pipeline/main.json similarity index 100% rename from src/tests/functional/execute_child_pipeline/pipeline/main.json rename to tests/functional/execute_child_pipeline/pipeline/main.json diff --git a/src/tests/functional/execute_child_pipeline/test_execute_pipeline_activity.py b/tests/functional/execute_child_pipeline/test_execute_pipeline_activity.py similarity index 99% rename from src/tests/functional/execute_child_pipeline/test_execute_pipeline_activity.py rename to tests/functional/execute_child_pipeline/test_execute_pipeline_activity.py index 20d0adcf..58f14360 100644 --- a/src/tests/functional/execute_child_pipeline/test_execute_pipeline_activity.py +++ b/tests/functional/execute_child_pipeline/test_execute_pipeline_activity.py @@ -1,5 +1,4 @@ import pytest - from azure_data_factory_testing_framework.exceptions.pipeline_not_found_error import PipelineNotFoundError from azure_data_factory_testing_framework.models.activities.activity import Activity from azure_data_factory_testing_framework.state import RunParameter, RunParameterType diff --git a/src/tests/test_test_framework.py b/tests/test_test_framework.py similarity index 99% rename from src/tests/test_test_framework.py rename to tests/test_test_framework.py index f5945c79..c315df3e 100644 --- a/src/tests/test_test_framework.py +++ b/tests/test_test_framework.py @@ -1,5 +1,4 @@ import pytest - from azure_data_factory_testing_framework.exceptions.pipeline_activities_circular_dependency_error import ( PipelineActivitiesCircularDependencyError, ) diff --git a/src/tests/unit/functions/test_function_argument.py b/tests/unit/functions/test_function_argument.py similarity index 99% rename from src/tests/unit/functions/test_function_argument.py rename to tests/unit/functions/test_function_argument.py index e6cbd641..86310e06 100644 --- a/src/tests/unit/functions/test_function_argument.py +++ b/tests/unit/functions/test_function_argument.py @@ -1,5 +1,4 @@ import pytest - from azure_data_factory_testing_framework.exceptions.dataset_parameter_not_found_error import ( DatasetParameterNotFoundError, ) diff --git a/src/tests/unit/functions/test_function_call.py b/tests/unit/functions/test_function_call.py similarity index 99% rename from src/tests/unit/functions/test_function_call.py rename to tests/unit/functions/test_function_call.py index 2e4a9955..1f265bcb 100644 --- a/src/tests/unit/functions/test_function_call.py +++ b/tests/unit/functions/test_function_call.py @@ -1,5 +1,4 @@ import pytest - from azure_data_factory_testing_framework.exceptions.function_call_invalid_arguments_count_error import ( FunctionCallInvalidArgumentsCountError, ) diff --git a/src/tests/unit/functions/test_function_parser.py b/tests/unit/functions/test_function_parser.py similarity index 100% rename from src/tests/unit/functions/test_function_parser.py rename to tests/unit/functions/test_function_parser.py diff --git a/src/tests/unit/functions/test_function_repository.py b/tests/unit/functions/test_function_repository.py similarity index 100% rename from src/tests/unit/functions/test_function_repository.py rename to tests/unit/functions/test_function_repository.py diff --git a/src/tests/unit/functions/test_functions_collection_implementation.py b/tests/unit/functions/test_functions_collection_implementation.py similarity index 99% rename from src/tests/unit/functions/test_functions_collection_implementation.py rename to tests/unit/functions/test_functions_collection_implementation.py index 07bd74f1..2c9656b2 100644 --- a/src/tests/unit/functions/test_functions_collection_implementation.py +++ b/tests/unit/functions/test_functions_collection_implementation.py @@ -1,10 +1,9 @@ from typing import Any, Union +import azure_data_factory_testing_framework.functions.functions_collection_implementation as collection_functions import pytest from pytest import param -import azure_data_factory_testing_framework.functions.functions_collection_implementation as collection_functions - @pytest.mark.parametrize( ["collection", "value", "expected"], diff --git a/src/tests/unit/functions/test_functions_string_implementation.py b/tests/unit/functions/test_functions_string_implementation.py similarity index 99% rename from src/tests/unit/functions/test_functions_string_implementation.py rename to tests/unit/functions/test_functions_string_implementation.py index 645d8a4f..783998a5 100644 --- a/src/tests/unit/functions/test_functions_string_implementation.py +++ b/tests/unit/functions/test_functions_string_implementation.py @@ -1,6 +1,5 @@ -import pytest - import azure_data_factory_testing_framework.functions.functions_string_implementation as string_functions +import pytest @pytest.mark.parametrize( diff --git a/src/tests/unit/models/activities/base/test_activity.py b/tests/unit/models/activities/base/test_activity.py similarity index 99% rename from src/tests/unit/models/activities/base/test_activity.py rename to tests/unit/models/activities/base/test_activity.py index 53a91f61..f139eb17 100644 --- a/src/tests/unit/models/activities/base/test_activity.py +++ b/tests/unit/models/activities/base/test_activity.py @@ -1,5 +1,4 @@ import pytest - from azure_data_factory_testing_framework.models.activities.activity import Activity from azure_data_factory_testing_framework.models.activities.execute_pipeline_activity import ExecutePipelineActivity from azure_data_factory_testing_framework.models.data_factory_element import DataFactoryElement diff --git a/src/tests/unit/models/activities/control_activities/test_for_each_activity.py b/tests/unit/models/activities/control_activities/test_for_each_activity.py similarity index 99% rename from src/tests/unit/models/activities/control_activities/test_for_each_activity.py rename to tests/unit/models/activities/control_activities/test_for_each_activity.py index b9c10489..484ad936 100644 --- a/src/tests/unit/models/activities/control_activities/test_for_each_activity.py +++ b/tests/unit/models/activities/control_activities/test_for_each_activity.py @@ -1,5 +1,4 @@ import pytest - from azure_data_factory_testing_framework.models.activities.for_each_activity import ForEachActivity from azure_data_factory_testing_framework.models.activities.set_variable_activity import SetVariableActivity from azure_data_factory_testing_framework.models.data_factory_element import DataFactoryElement diff --git a/src/tests/unit/models/activities/control_activities/test_if_condition_activity.py b/tests/unit/models/activities/control_activities/test_if_condition_activity.py similarity index 99% rename from src/tests/unit/models/activities/control_activities/test_if_condition_activity.py rename to tests/unit/models/activities/control_activities/test_if_condition_activity.py index 5ef8b50e..5f8627f6 100644 --- a/src/tests/unit/models/activities/control_activities/test_if_condition_activity.py +++ b/tests/unit/models/activities/control_activities/test_if_condition_activity.py @@ -1,5 +1,4 @@ import pytest - 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.data_factory_element import DataFactoryElement diff --git a/src/tests/unit/models/activities/control_activities/test_until_activity.py b/tests/unit/models/activities/control_activities/test_until_activity.py similarity index 99% rename from src/tests/unit/models/activities/control_activities/test_until_activity.py rename to tests/unit/models/activities/control_activities/test_until_activity.py index 9ad69033..33ccd1db 100644 --- a/src/tests/unit/models/activities/control_activities/test_until_activity.py +++ b/tests/unit/models/activities/control_activities/test_until_activity.py @@ -1,5 +1,4 @@ import pytest - from azure_data_factory_testing_framework.models.activities.set_variable_activity import SetVariableActivity from azure_data_factory_testing_framework.models.activities.until_activity import UntilActivity from azure_data_factory_testing_framework.models.data_factory_element import DataFactoryElement diff --git a/src/tests/unit/models/activities/test_set_variable_activity.py b/tests/unit/models/activities/test_set_variable_activity.py similarity index 99% rename from src/tests/unit/models/activities/test_set_variable_activity.py rename to tests/unit/models/activities/test_set_variable_activity.py index 5001b528..1bbf786f 100644 --- a/src/tests/unit/models/activities/test_set_variable_activity.py +++ b/tests/unit/models/activities/test_set_variable_activity.py @@ -1,5 +1,4 @@ import pytest - from azure_data_factory_testing_framework.exceptions.variable_being_evaluated_does_not_exist_error import ( VariableBeingEvaluatedDoesNotExistError, ) diff --git a/src/tests/unit/models/pipelines/test_pipeline_resource.py b/tests/unit/models/pipelines/test_pipeline_resource.py similarity index 99% rename from src/tests/unit/models/pipelines/test_pipeline_resource.py rename to tests/unit/models/pipelines/test_pipeline_resource.py index d70a7b24..afa69ba7 100644 --- a/src/tests/unit/models/pipelines/test_pipeline_resource.py +++ b/tests/unit/models/pipelines/test_pipeline_resource.py @@ -1,5 +1,4 @@ import pytest - from azure_data_factory_testing_framework.models.pipeline import Pipeline from azure_data_factory_testing_framework.state import RunParameterType from azure_data_factory_testing_framework.state.run_parameter import RunParameter