{"id":16098402,"url":"https://github.com/microsoft/data-factory-testing-framework","last_synced_at":"2025-04-12T09:33:30.225Z","repository":{"id":196203740,"uuid":"680062489","full_name":"microsoft/data-factory-testing-framework","owner":"microsoft","description":"A stand-alone test framework that allows to write unit tests for Data Factory pipelines on Microsoft Fabric, Azure Data Factory and Azure Synapse Analytics.","archived":false,"fork":false,"pushed_at":"2025-04-07T17:56:11.000Z","size":3993,"stargazers_count":97,"open_issues_count":12,"forks_count":28,"subscribers_count":11,"default_branch":"main","last_synced_at":"2025-04-08T10:11:41.816Z","etag":null,"topics":["azure-data-factory","azure-synapse","data-factory","fabric","functional-tests","microsoft-fabric","test","testing-framework","unit-tests"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/microsoft.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":"SUPPORT.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-08-18T08:52:25.000Z","updated_at":"2025-04-04T02:01:20.000Z","dependencies_parsed_at":"2023-11-06T11:24:33.929Z","dependency_job_id":"770e486e-f449-4eea-a362-b0768c6c0cf2","html_url":"https://github.com/microsoft/data-factory-testing-framework","commit_stats":{"total_commits":212,"total_committers":12,"mean_commits":"17.666666666666668","dds":0.4056603773584906,"last_synced_commit":"1e2ec4d7eb7d9c1e64c2aa4a4c90ae3a91a1e40c"},"previous_names":["microsoft/azure-data-factory-testing-framework","microsoft/data-factory-testing-framework"],"tags_count":36,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2Fdata-factory-testing-framework","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2Fdata-factory-testing-framework/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2Fdata-factory-testing-framework/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2Fdata-factory-testing-framework/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/microsoft","download_url":"https://codeload.github.com/microsoft/data-factory-testing-framework/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247819933,"owners_count":21001394,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["azure-data-factory","azure-synapse","data-factory","fabric","functional-tests","microsoft-fabric","test","testing-framework","unit-tests"],"created_at":"2024-10-09T18:05:30.836Z","updated_at":"2025-04-12T09:33:30.190Z","avatar_url":"https://github.com/microsoft.png","language":"Python","readme":"# Data Factory - Testing Framework :hammer_and_wrench:\n\nA stand-alone test framework that allows to write unit tests for Data Factory pipelines on [Microsoft Fabric](https://learn.microsoft.com/en-us/fabric/data-factory/), [Azure Data Factory](https://learn.microsoft.com/en-us/azure/data-factory/concepts-pipelines-activities?tabs=data-factory) and [Azure Synapse Analytics](https://learn.microsoft.com/en-us/azure/data-factory/concepts-pipelines-activities?tabs=data-factory).\n\n\u003e The framework is currently in _Public Preview_ and is not officially supported by Microsoft.\n\n## Features :star:\n\nThe framework evaluates pipeline and activity definitions which can be asserted. It does so by providing the following features:\n\n1. Evaluate expressions by using the framework's internal expression parser. It supports all the functions and arguments that are available in the Data Factory expression language.\n2. Test an activity with a specific state and assert the evaluated expressions.\n3. Test a pipeline run by verifying the execution flow of activities for specific input parameters and assert the evaluated expressions of each activity.\n\n\u003e The framework does not support running the actual pipeline. It only gives you the ability to test the pipeline and activity definitions.\n\n### High-level example :bulb:\n\nGiven a `WebActivity` with a `typeProperties.url` property containing the following expression:\n\n```datafactoryexpression\n@concat(pipeline().globalParameters.BaseUrl, variables('Path'))\n```\n\nA simple test to validate that the concatenation is working as expected could look like this:\n\n```python\n    # Arrange\n    activity = pipeline.get_activity_by_name(\"webactivity_name\")\n    state = PipelineRunState(\n        parameters=[\n            RunParameter(RunParameterType.Global, \"BaseUrl\", \"https://example.com\"),\n        ],\n        variables=[\n            PipelineRunVariable(\"Path\", \"some-path\"),\n        ])\n\n    # Act\n    activity.evaluate(state)\n\n    # Assert\n    assert \"https://example.com/some-path\" == activity.type_properties[\"url\"].result\n   ```\n\n## Why :question:\n\nData Factory does not support unit testing, nor testing of pipelines locally. Having integration and e2e tests running on an actual Data Factory instance is great, but having unit tests on top of them provides additional means of quick iteration, validation and regression testing. Unit testing with the _Data Factory Testing Framework_ has the following benefits:\n\n* Runs locally with immediate feedback\n* Easier to cover a lot of different scenarios and edge cases\n* Regression testing\n\n## Getting started :rocket:\n\nBefore you start writing tests, you need to set up the repository and install the framework:\n\n1. [Repository setup](docs/basic/repository_setup.md)\n2. [Installing and initializing the framework](docs/basic/installing_and_initializing_framework.md)\n\n\u003e If you are not that experienced with Python and prefer a step-by-step guide, use the more detailed [getting started](docs/basic/getting_started.md) guide.\n\nThe framework allows you to write two types of tests:\n\n* [Activity testing](docs/basic/activity_testing.md) - for testing activities in isolation\n* [Pipeline testing](docs/basic/pipeline_testing.md) - for testing the entire pipeline\n\n## Concepts :books:\n\nThe following pages go deeper into different topics and concepts of the framework to help in getting you started.\n\n### Basic :seedling:\n\n1. [Repository setup](docs/basic/repository_setup.md)\n2. [Installing and initializing the framework](docs/basic/installing_and_initializing_framework.md)\n3. [State](docs/basic/state.md)\n4. [Activity testing](docs/basic/activity_testing.md)\n5. [Pipeline testing](docs/basic/pipeline_testing.md)\n\n### Advanced :microscope:\n\n1. [Debugging your activities and pipelines](docs/advanced/debugging.md)\n2. [Development workflow](docs/advanced/development_workflow.md)\n3. [Overriding expression functions](docs/advanced/overriding_expression_functions.md)\n4. [Framework internals](docs/advanced/framework_internals.md)\n\n## Examples :memo:\n\nMore advanced examples demonstrating the capabilities of the framework:\n\nFabric:\n\n1. [Batch job example](examples/fabric/batch_job/README.md)\n\nAzure Data Factory:\n\n1. [Copy blobs example](examples/data_factory/copy_blobs/README.md)\n2. [Batch job example](examples/data_factory/batch_job/README.md)\n\nAzure Synapse Analytics:\n\n1. [Copy blobs example](examples/synapse/copy_blobs/README.md)\n\n## Contributing :handshake:\n\nThis project welcomes contributions and suggestions.  Most contributions require you to agree to a\nContributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us\nthe rights to use your contribution. For details, visit \u003chttps://cla.opensource.microsoft.com\u003e.\n\nWhen you submit a pull request, a CLA bot will automatically determine whether you need to provide\na CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions\nprovided by the bot. You will only need to do this once across all repos using our CLA.\n\nThis project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).\nFor more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or\ncontact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.\n\n## Trademarks :tm:\n\nThis project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft\ntrademarks or logos is subject to and must follow\n[Microsoft's Trademark \u0026 Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general).\nUse of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship.\nAny use of third-party trademarks or logos are subject to those third-party's policies.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrosoft%2Fdata-factory-testing-framework","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmicrosoft%2Fdata-factory-testing-framework","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrosoft%2Fdata-factory-testing-framework/lists"}