A pytest plugin for configuring workflow/pipeline tests using YAML files
Project description
pytest-workflow is a pytest plugin that aims to make pipeline/workflow testing easy by using yaml files for the test configuration.
For our complete documentation checkout our readthedocs page.
Installation
Pytest-workflow requires Python 3.5 or higher. It is tested on Python 3.5, 3.6 and 3.7. Python 2 is not supported.
Make sure your virtual environment is activated.
Install using pip pip install pytest-workflow
Create a tests directory in the root of your repository.
Create your test yaml files in the tests directory.
Quickstart
Run pytest from an environment with pytest-workflow installed. Pytest will automatically gather files in the tests directory starting with test and ending in .yaml or .yml.
To check the progress of a workflow while it is running you can use tail -f on the stdout or stderr file of the workflow. The locations of these files are reported in the log as soon as a workflow is started.
For debugging pipelines using the --keep-workflow-wd flag is recommended. This will keep the workflow directory and logs after the test run so it is possible to check where the pipeline crashed. The -v flag can come in handy as well as it gives a complete overview of succeeded and failed tests.
Below is an example of a YAML file that defines a test:
- name: Touch a file
command: touch test.file
files:
- path: test.file
This will run touch test.file and check afterwards if a file with path: test.file is present. It will also check if the command has exited with exit code 0, which is the only default test that is run. Testing workflows that exit with another exit code is also possible. Several other predefined tests as well as custom tests are possible.
Documentation for more advanced use cases can be found on our readthedocs page.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pytest-workflow-1.1.0.tar.gz
.
File metadata
- Download URL: pytest-workflow-1.1.0.tar.gz
- Upload date:
- Size: 17.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.5.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c855171d1a68801e6cb61befb91faf1c33f4713c36a3e18e40081b0f85e41cd5 |
|
MD5 | e8a0471177b7496b7639c414bdadb337 |
|
BLAKE2b-256 | ca0f3d6204c55576720363a1968177d1f986a2670c6b0ea51a03d1694bea4f55 |
File details
Details for the file pytest_workflow-1.1.0-py3-none-any.whl
.
File metadata
- Download URL: pytest_workflow-1.1.0-py3-none-any.whl
- Upload date:
- Size: 33.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.5.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 662ee37f6eb2bdae934ebe98ecaf061e58f8bee8c7d1e45a577397074f3bb32e |
|
MD5 | 260404d1d95dc9006868fcf4f2c67302 |
|
BLAKE2b-256 | 892655931400e57eba7f4e79e2989e6d45cf2afb14a4cd7bcca84f6a5429a607 |