You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This unit test framework is not officially supported. It is currently in an experimental state and has not been tested with every single data factory resource. It should support all activities out-of-the-box but has not been thoroughly tested, please report any issues in the issues section and include an example of the pipeline that is not working as expected.
17
+
This unit test framework is not officially supported.
18
+
It is currently in an experimental state and has not been tested with every single data factory resource.
19
+
It should support all activities out-of-the-box but has not been thoroughly tested,
20
+
please report any issues in the issues section and include an example of the pipeline that is not working as expected.
16
21
17
-
If there's a lot of interest in this framework, then we will continue to improve it and move it to a production-ready state.
22
+
If there's a lot of interest in this framework, then we will continue to improve it and move it to a production-ready state.
18
23
19
24
## Features
20
25
21
26
Goal: Validate that the evaluated pipeline configuration with its expressions is behaving as expected on runtime.
22
27
23
28
1. Evaluate expressions with their functions and arguments instantly by using the framework's internal expression parser.
24
-
2. Test a pipeline or activity against any state to assert the expected outcome. A state can be configured with pipeline parameters, global parameters, variables and activity outputs.
29
+
2. Test a pipeline or activity against any state to assert the expected outcome.
30
+
A state can be configured with pipeline parameters, global parameters, variables and activity outputs.
25
31
3. Simulate a pipeline run and evaluate the execution flow and outcome of each activity.
26
32
4. Dynamically supports all activity types with all their attributes.
27
33
28
-
> Pipelines and activities are not executed on any Data Factory environment, but the evaluation of the pipeline configuration is validated locally. This is different from the "validation" functionality present in the UI, which only validates the syntax of the pipeline configuration.
29
-
34
+
> Pipelines and activities are not executed on any Data Factory environment,
35
+
> but the evaluation of the pipeline configuration is validated locally.
36
+
> This is different from the "validation" functionality present in the UI,
37
+
> which only validates the syntax of the pipeline configuration.
30
38
31
39
## Why
32
40
33
-
Data Factory does not support unit testing out of the box. The only way to validate your changes is through manual testing or running e2e tests against a deployed data factory. These tests are great to have, but miss the following benefits that unit tests, like using this unit test framework, provide:
41
+
Data Factory does not support unit testing out of the box.
42
+
The only way to validate your changes is through manual testing or running e2e tests against a deployed data factory.
43
+
These tests are great to have, but miss the following benefits that unit tests, like using this unit test framework, provide:
34
44
35
-
* Shift left with immediate feedback on changes - Evaluate any individual data factory resource (pipelines, activities, triggers, datasets, linked services etc..), including (complex) expressions
45
+
* Shift left with immediate feedback on changes - Evaluate any individual data factory resource
46
+
(pipelines, activities, triggers, datasets, linked services etc..), including (complex) expressions
36
47
* Allows testing individual resources (e.g. activity) for many different input values to cover more scenarios.
37
-
* Less issues in production - due to the fast nature of writing and running unit tests, you will write more tests in less time and therefore have a higher test coverage. This means more confidence in new changes, fewer risks in breaking existing features (regression tests), and thus far fewer issues in production.
48
+
* Less issues in production - due to the fast nature of writing and running unit tests,
49
+
you will write more tests in less time and therefore have a higher test coverage.
50
+
This means more confidence in new changes, fewer risks in breaking existing features (regression tests),
51
+
and thus far fewer issues in production.
38
52
39
-
> Even though Data Factory is UI-driven writing unit tests, and might not be in the nature of it. How can you be confident that your changes will work as expected, and that existing pipelines will not break, without writing unit tests?
53
+
> Even though Data Factory is UI-driven writing unit tests, and might not be in the nature of it.
54
+
> How can you be confident that your changes will work as expected,
55
+
> and that existing pipelines will not break, without writing unit tests?
40
56
41
57
## Getting started
42
58
43
59
1. Set up an empty Python project with your favorite testing library
body = create_batch_activity.type_properties["body"].get_json_value()
138
+
assert"123"== body["JobId"]
139
+
assert"Job-123"== body["JobName"]
140
+
assert"version1"== body["Version"]
141
+
142
+
with pytest.raises(StopIteration):
143
+
next(activities)
144
+
```
145
+
146
+
> See the [Examples](/examples) folder for more samples
132
147
133
148
## Registering missing expression functions
134
149
135
-
As the framework is interpreting expressions containing functions, these functions are implemented in the framework, but there may be bugs in some of them. You can override their implementation through:
150
+
As the framework is interpreting expressions containing functions, these functions are implemented in the framework,
151
+
but there may be bugs in some of them. You can override their implementation through:
@@ -141,7 +157,8 @@ As the framework is interpreting expressions containing functions, these functio
141
157
142
158
## Tips
143
159
144
-
1. After parsing a data factory resource file, you can use the debugger to easily discover which classes are actually initialized so that you can cast them to the correct type.
160
+
1. After parsing a data factory resource file, you can use the debugger to easily discover which classes are actually
161
+
initialized so that you can cast them to the correct type.
145
162
146
163
## Recommended development workflow for Azure Data Factory v2
147
164
@@ -160,7 +177,7 @@ As the framework is interpreting expressions containing functions, these functio
160
177
161
178
This project welcomes contributions and suggestions. Most contributions require you to agree to a
162
179
Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us
163
-
the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.
180
+
the rights to use your contribution. For details, visit <https://cla.opensource.microsoft.com>.
164
181
165
182
When you submit a pull request, a CLA bot will automatically determine whether you need to provide
166
183
a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions
@@ -177,7 +194,3 @@ trademarks or logos is subject to and must follow
Copy file name to clipboardExpand all lines: SECURITY.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ Instead, please report them to the Microsoft Security Response Center (MSRC) at
14
14
15
15
If you prefer to submit without logging in, send email to [[email protected]](mailto:[email protected]). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/opensource/security/pgpkey).
16
16
17
-
You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://aka.ms/opensource/security/msrc).
17
+
You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://aka.ms/opensource/security/msrc).
18
18
19
19
Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:
0 commit comments