Skip to main content

Data Factory - Testing Framework 🛠️

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.

The framework is community supported only, hence there's no official Microsoft SLA for features or bug fixes. Please file an issue for bugs or feature requests. The framework is open source and contributions are welcome!

Features ⭐

The framework evaluates pipeline and activity definitions which can be asserted. It does so by providing the following features:

  1. 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.
  2. Test an activity with a specific state and assert the evaluated expressions.
  3. Test a pipeline run by verifying the execution flow of activities for specific input parameters and assert the evaluated expressions of each activity.

The framework does not support running the actual pipeline. It only gives you the ability to test the pipeline and activity definitions.

High-level example 💡

Given a WebActivity with a typeProperties.url property containing the following expression:

@concat(pipeline().globalParameters.BaseUrl, variables('Path'))

A simple test to validate that the concatenation is working as expected could look like this:

    # Arrange
    activity = pipeline.get_activity_by_name("webactivity_name")
    state = PipelineRunState(
        parameters=[
            RunParameter(RunParameterType.Global, "BaseUrl", "https://example.com"),
        ],
        variables=[
            PipelineRunVariable("Path", "some-path"),
        ])

    # Act
    activity.evaluate(state)

    # Assert
    assert "https://example.com/some-path" == activity.type_properties["url"].result

Why ❓

Data 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:

  • Runs locally with immediate feedback
  • Easier to cover a lot of different scenarios and edge cases
  • Regression testing

Getting started 🚀

Before you start writing tests, you need to set up the repository and install the framework:

  1. Repository setup
  2. Installing and initializing the framework

If you are not that experienced with Python and prefer a step-by-step guide, use the more detailed getting started guide.

The framework allows you to write two types of tests:

Concepts 📚

The following pages go deeper into different topics and concepts of the framework to help in getting you started.

Basic 🌱

  1. Repository setup
  2. Installing and initializing the framework
  3. State
  4. Activity testing
  5. Pipeline testing

Advanced 🔬

  1. Debugging your activities and pipelines
  2. Development workflow
  3. Overriding expression functions
  4. Framework internals

Examples 📝

More advanced examples demonstrating the capabilities of the framework:

Fabric:

  1. Batch job example

Azure Data Factory:

  1. Copy blobs example
  2. Batch job example

Azure Synapse Analytics:

  1. Copy blobs example

Contributing 🤝

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

Trademarks ™️

This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.

Release files for data-factory-testing-framework 1.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for data-factory-testing-framework 1.4.1
File Size Uploaded
data_factory_testing_framework-1.4.1.tar.gz 31.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for data-factory-testing-framework 1.4.1
File Interpreter ABI Platform
data_factory_testing_framework-1.4.1-py3-none-any.whl Python 3 none any Details

Total release size: 15.1 MB

Release files / data_factory_testing_framework-1.4.1.tar.gz

Download URL data_factory_testing_framework-1.4.1.tar.gz
Size 31.4 kB
Tags Source
SHA-256 checksum
How to use checksums
0541d33c8839739aa93a3d5de99f73867beefedb8c68da6db401b293a83856d1
BLAKE2b-256 checksum
How to use checksums
9e1ea9c5d0afcd4b7475af6f5f1b564c604d2c0dc056044cf44700f5cbd36cb0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / data_factory_testing_framework-1.4.1-py3-none-any.whl

Download URL data_factory_testing_framework-1.4.1-py3-none-any.whl
Size 15.1 MB
Tags Python 3
SHA-256 checksum
How to use checksums
e663061929db032f9dfcc7fa643de46df157aaf5e1ad4f9a2bb8d9660770219f
BLAKE2b-256 checksum
How to use checksums
1f7451ac5aece3eef3a76f60fbcee0f14bd006377d5ea2a51d53014b269464fb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

1.4.2

2 release files

This release

1.4.1 This release

2 release files

1.4.0

2 release files

1.3.2

2 release files

1.3.0

2 release files

1.2.3

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.10

2 release files

1.1.5

2 release files

1.1.4

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.2.17

2 release files

0.2.12

2 release files

0.2.9

2 release files

0.2.8

2 release files

0.2.7

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page