Skip to main content

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.

Pytest-workflow is also available as a conda package on conda-forge. Follow these instructions to set up channels properly in order to use conda-forge. Alternatively, you can set up the channels correctly for use with bioconda. After that conda install pytest-workflow can be used to install pytest-workflow.

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 --kwd or --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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pytest-workflow-1.2.1.tar.gz (18.5 kB view details)

Uploaded Source

Built Distribution

pytest_workflow-1.2.1-py3-none-any.whl (34.4 kB view details)

Uploaded Python 3

File details

Details for the file pytest-workflow-1.2.1.tar.gz.

File metadata

  • Download URL: pytest-workflow-1.2.1.tar.gz
  • Upload date:
  • Size: 18.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.5.3

File hashes

Hashes for pytest-workflow-1.2.1.tar.gz
Algorithm Hash digest
SHA256 093fcbf20c51fe56428a9c09eb9c8b1c1e480b98b0e93a5aecc9ef4b2ffe648d
MD5 1839a44f44793c87d992eb7cc45b5e4f
BLAKE2b-256 3c81b37d710b4bcf569cca263dd2a8a9f45a177f8cdc79726138e2253d2a3cdb

See more details on using hashes here.

File details

Details for the file pytest_workflow-1.2.1-py3-none-any.whl.

File metadata

  • Download URL: pytest_workflow-1.2.1-py3-none-any.whl
  • Upload date:
  • Size: 34.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.5.3

File hashes

Hashes for pytest_workflow-1.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e52057ddf923eda268ab91b1a7bce277d8fe8ca1b53f55f6c479180537207b7f
MD5 549dfd9b2b258157d7117267534eb12c
BLAKE2b-256 64e6c0bd0349936f9b89f2a07a73f605f5a4fdb757530e871ae80585c5d253be

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page