Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: testing framework in python and microsoft fabric support with expression grammar and evaluation support #30

Merged
merged 131 commits into from
Dec 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
131 commits
Select commit Hold shift + click to select a range
354b349
feat: introduce initial python code base and patching script to fix a…
arjendev Nov 8, 2023
82058f9
fix: fix imports of scripts
arjendev Nov 8, 2023
3a1a016
chore: migrate to pytest
arjendev Nov 8, 2023
149d995
feat: model and data factory repositories, dynamically patching gener…
arjendev Nov 8, 2023
ea7a209
feat: testframework pipeline evaluation logic without iteration activ…
arjendev Nov 8, 2023
29c9ff6
chore: move examples to example folder
arjendev Nov 9, 2023
314a1f4
feat: foreach support and refactor model patching
arjendev Nov 9, 2023
bbc159a
refactor: automatically patching of models
arjendev Nov 9, 2023
d731665
feat: if condition activity
arjendev Nov 9, 2023
d85fa3a
feat: until activity
arjendev Nov 9, 2023
036c370
feat: setVariable activity
arjendev Nov 10, 2023
4a5f63f
feat: pipeline activity
arjendev Nov 10, 2023
a01458d
feat: function_call, function_argument and expression_parsing
arjendev Nov 10, 2023
9b2b2f3
feat: function argument expression evaluation
arjendev Nov 10, 2023
e83afbb
feat: function argument activity output evaluation
arjendev Nov 10, 2023
386c7b6
feat: function_call evaluation so far
arjendev Nov 10, 2023
f3e8c47
feat: function_call evaluation, optional parameters, apply leonards f…
arjendev Nov 13, 2023
5fe72b0
test: add function_call tests
arjendev Nov 13, 2023
853db41
fix: function_call error argument naming
arjendev Nov 13, 2023
b8ac613
chore(python): add ruff linting
LeonardHd Nov 13, 2023
30c7178
style(python): apply ruff auto fixes
LeonardHd Nov 13, 2023
b8ddb34
style(python): apply ruff unsafe auto fixes
LeonardHd Nov 13, 2023
d4eb7ac
style(python): ruff fix E501 and ruff formatting
LeonardHd Nov 13, 2023
9e9354e
style(python): ruff fixes ANN001,ANN201,ANN401
LeonardHd Nov 13, 2023
30c5f44
style(python): fix new line formatting
LeonardHd Nov 13, 2023
efa809a
style(python): format test files
LeonardHd Nov 13, 2023
85dc7c4
style(python): ruff E741
LeonardHd Nov 14, 2023
aa0921b
fix(python): import docstring parse
LeonardHd Nov 14, 2023
3c3ab64
style(python): fix N806
LeonardHd Nov 14, 2023
62d74e3
style(python): various ruff fixes on style
LeonardHd Nov 14, 2023
3e5e7b1
refactor(python): allow runstate to func arg
LeonardHd Nov 14, 2023
8ef847a
fix: broken test
arjendev Nov 14, 2023
c4109f1
feat: introduce docstrings and abstract evaluate method on generated …
arjendev Nov 14, 2023
920f272
chore: support python 3.9
arjendev Nov 15, 2023
8f41d28
fix: some types
arjendev Nov 15, 2023
f7b807a
refactor: improve package structure
arjendev Nov 15, 2023
f078482
chore: formatting
arjendev Nov 15, 2023
86cbabe
refactor: misc improvements
arjendev Nov 15, 2023
ffcf817
test: test and fix execute child pipelines
arjendev Nov 15, 2023
3d2502d
chore: separate functional and unit testing in testing folder structure
arjendev Nov 15, 2023
c9200ad
chore: rename examples folder
arjendev Nov 15, 2023
2711556
test: circular dependency between activities in pipeline
arjendev Nov 15, 2023
cd93dbe
ci: add ci-python.yaml
arjendev Nov 15, 2023
ae920ec
ci: merge ci workflows
arjendev Nov 15, 2023
9d54c4a
ci: fix working directory of loaded cached venv
arjendev Nov 15, 2023
1368b0e
ci: split python and dotnet ci
arjendev Nov 15, 2023
d71ae10
ci: fix pytest
arjendev Nov 15, 2023
6f4a9ef
ci: fix pytest
arjendev Nov 15, 2023
e4efde7
test: fix pipelines folder
arjendev Nov 15, 2023
750b20e
chore: set pyproject.toml license
arjendev Nov 15, 2023
615bfc2
cd: add pypi release
arjendev Nov 15, 2023
bd0781f
cd: fix pypi release dist folder
arjendev Nov 15, 2023
0825408
ci: build poetry package
arjendev Nov 15, 2023
1e7b8b4
cd: update name to match pypi project name
arjendev Nov 15, 2023
fb7b677
chore: rename library name
arjendev Nov 15, 2023
c9dd4ed
test: add batch job example unit tests
arjendev Nov 15, 2023
47a0a5c
fix: formatting
arjendev Nov 15, 2023
83ad590
fix: import
arjendev Nov 15, 2023
92aa2b1
docs: update python README.md
arjendev Nov 15, 2023
bca6653
test: add mutatest
jayachithra Nov 16, 2023
869f193
docs: improve python README.md
arjendev Nov 16, 2023
37a5e4f
chore: bump version
arjendev Nov 16, 2023
bcb734d
chore: move data factory specific classes to specific folder
arjendev Nov 16, 2023
47ec57c
fix: formatting
arjendev Nov 16, 2023
460c5c5
ci: adjust to alpha versioning
LeonardHd Nov 17, 2023
fa54ff4
chore: fix lockfile
LeonardHd Nov 17, 2023
d4a47b8
fix: evaluate function arguments to the correct datatypes
jayachithra Nov 17, 2023
7662364
chore: add pre-commit hooks
LeonardHd Nov 17, 2023
4a54f2f
refactor(functions): split functions
LeonardHd Nov 17, 2023
35163fa
ci: run only tests folder
LeonardHd Nov 17, 2023
5fa3cf5
feat: fabric support
arjendev Nov 17, 2023
2efa32e
fix: only use parameter.type str representation
LeonardHd Nov 17, 2023
f39b3b6
feat: unified models
arjendev Nov 18, 2023
1e951a8
refactor: repositories and deserializers folder structure
arjendev Nov 20, 2023
0100e99
refactor: clean up models and serialization
arjendev Nov 20, 2023
4936db1
test: rename example test files
LeonardHd Nov 20, 2023
1f037fc
test: prevent pytest collection on TestFramework
LeonardHd Nov 20, 2023
fdb5b1b
fix: raise value error on str representation
LeonardHd Nov 20, 2023
ca3d449
feat: support string functions
LeonardHd Nov 20, 2023
9439052
chore: add vscode settings
LeonardHd Nov 20, 2023
e77fc2f
chore: tests and examples tested with pre-commit
LeonardHd Nov 20, 2023
48608fb
style: fix format on activity dependency
LeonardHd Nov 20, 2023
347a7d7
test: fix example tests directory
arjendev Nov 20, 2023
ac48920
chore: fix pre-commit to not use bash
LeonardHd Nov 20, 2023
323374d
refactor: clean up model constructor arguments
arjendev Nov 20, 2023
2d29777
chore: remove dotnet codebase and move python codebase to src
arjendev Nov 20, 2023
cdcd019
ci: remove dotnet workflow and fix python workflow
arjendev Nov 20, 2023
db5bf4b
chore: clean lockfile
LeonardHd Nov 20, 2023
7c8e017
chore: fix vscode setup
LeonardHd Nov 20, 2023
0ea23ec
chore: readd function registering
LeonardHd Nov 20, 2023
e4f1a72
refactor: initial refactor repositories
arjendev Nov 22, 2023
7cccf59
refactor: deserializers to follow dry
arjendev Nov 22, 2023
c964eed
feat: collection functions v1
LeonardHd Nov 22, 2023
e8e4dd5
test: flip expected and actual for data factory
LeonardHd Nov 22, 2023
af79d72
refactor: package folder structure to match python convention
arjendev Nov 23, 2023
d1bd553
docs: update README.md and package description to reflect Fabric support
arjendev Nov 23, 2023
74f5606
feat: add logical functions
LeonardHd Nov 22, 2023
e82b3d6
chore: clean pre-commit config
LeonardHd Nov 23, 2023
9580f6f
docs: update README.md example
arjendev Nov 23, 2023
f5b8174
feat: set_result on activity for functional tests
arjendev Nov 23, 2023
9bd8ff7
chore: clean up packages
arjendev Nov 23, 2023
ca4af3c
feat: switch activity support
arjendev Nov 23, 2023
1ba6e7b
feat: filter activity support
arjendev Nov 24, 2023
d7d2bdb
test: introduce additional tests for testing filter activity
arjendev Nov 24, 2023
e5058e6
refactor: rename evaluate_control_activity_iterations to evaluate_con…
arjendev Nov 24, 2023
d8c0b2b
refactor: update filter_activity docs
arjendev Nov 24, 2023
60f6d1b
feat: append variable activity
arjendev Nov 24, 2023
6ee41d3
feat: fail activity
arjendev Nov 24, 2023
fd4512b
fix: fail activity deserialization
arjendev Nov 24, 2023
1cc9dcd
chore: setting pytest to verbose
LeonardHd Nov 24, 2023
f2af03f
feat: naive conversion functions
LeonardHd Nov 24, 2023
30cf283
chore: clean up project dependencies
arjendev Nov 24, 2023
7a4fd76
feat: implement all date functions
arjendev Nov 24, 2023
0d3047d
feat: implement math functions
jayachithra Nov 24, 2023
c6ee8a2
feat: replace naive evaluation with lark
LeonardHd Nov 25, 2023
36b5592
fix: deserializing until and foreach activities in pipeline
arjendev Dec 1, 2023
6c78027
fix: if parameter of child_pipeline is not supplied, use defaultValue…
arjendev Dec 1, 2023
210613f
chore: add exception handling for parsing error
LeonardHd Dec 1, 2023
f4d0a2a
fix: allow nested array index on activity parameters
LeonardHd Dec 1, 2023
f658784
style: move terminal in grammar
LeonardHd Dec 1, 2023
ae5c495
fix: deserializer should treat expressions with value in content fiel…
arjendev Dec 1, 2023
d46e73a
refactor: improve activity output field not found error
arjendev Dec 1, 2023
6918761
feat: set execute_pipeline_activity return_values on activity output
arjendev Dec 1, 2023
9036c34
feat: allow null parameters, system variables and a bunch of fixes
arjendev Dec 1, 2023
bd99c36
feat: string interpolation
arjendev Dec 1, 2023
cccccd2
feat: support multiple expressions in string interpolation
arjendev Dec 1, 2023
47683c5
chore: only publish package on main
arjendev Dec 8, 2023
fa9da3a
chore: rename ci.yml to ci-cd.yml to reflect purpose better
arjendev Dec 8, 2023
75dc76e
docs: remove 'unit' from README.md title
arjendev Dec 8, 2023
d31a7da
chore: rename package to data-factory-testing-framework
arjendev Dec 8, 2023
b8b23e6
ci: disable package publishing on non-main branch
arjendev Dec 8, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
76 changes: 76 additions & 0 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: CI-CD

on: [push]

jobs:
build_and_publish:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write
environment:
name: pypi
url: https://pypi.org/p/data-factory-testing-framework
steps:
#----------------------------------------------
# check-out repo and set-up python
#----------------------------------------------
- name: Check out repository
uses: actions/checkout@v3
- name: Set up python
id: setup-python
uses: actions/setup-python@v4
with:
python-version: '3.9'
#----------------------------------------------
# ----- install & configure poetry -----
#----------------------------------------------
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true

#----------------------------------------------
# load cached venv if cache exists
#----------------------------------------------
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
#----------------------------------------------
# install dependencies if cache does not exist
#----------------------------------------------
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: |
source .venv/bin/activate
poetry install --no-interaction --no-root
#----------------------------------------------
# install your root project, if required
#----------------------------------------------
- name: Install project
run: |
source .venv/bin/activate
poetry install --no-interaction
#----------------------------------------------
# run test suite
#----------------------------------------------
- name: Run tests
run: |
source .venv/bin/activate
poetry run pytest .
- name: Set build version and build package
run: |
source .venv/bin/activate
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
44 changes: 0 additions & 44 deletions .github/workflows/ci.yml

This file was deleted.

6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,7 @@ paket-files/
# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
.pytest_cache

# Cake - Uncomment if you are using it
# tools/**
Expand Down Expand Up @@ -396,4 +397,7 @@ FodyWeavers.xsd

# JetBrains Rider
*.sln.iml
.idea
.idea

# Distributions / Releases
dist
24 changes: 24 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
repos:
- repo: https://github.com/python-poetry/poetry
rev: 1.6.1
hooks:
- id: poetry-check
args: []
- id: poetry-lock
args: ["--no-update"]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.5
hooks:
- id: ruff
args: [ --fix ]
- id: ruff-format
- repo: local
hooks:
- id: pytest
name: pytest
entry: poetry run pytest .
language: system
types: [python]
require_serial: true
pass_filenames: false

12 changes: 12 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// VSCode settings for Python
// We track these settings in the repository so that they are consistent across
// for contributors.
{
"python.testing.pytestArgs": [
"."
"-vv"
],
"python.testing.cwd": "${workspaceFolder}",
"python.testing.pytestEnabled": true,
"python.testing.unittestEnabled": false,
}
33 changes: 33 additions & 0 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Azure Data Factory v2 - Unit Testing Framework

## Development

### Prerequisites

* poetry == 1.6.1

### Pre-Commit Hooks

We use pre-commit hooks to ensure that the code is formatted correctly and that the code is linted before committing.

To install the pre-commit hooks, run the following command:

```bash
poetry run pre-commit install
```

To run the pre-commit hooks use the following command (append `--all-files` to run on all files)):

```bash
poetry run pre-commit run
```

### Run Linting

We use Ruff to lint our code as it provides similar rule sets to well-established linters into one (e.g., black, flake8, isort, and pydocstyle).

To run linting, run the following command:

```bash
poetry run ruff .
```
Loading