Workflow Integration Tester (WIT)

This guide is intended to instruct users of the WIT program on how to use the tool.

 

  • Installation
    It is recommended (though not necessary) that you use a virtual environment for installing WIT. If you are not familiar with virtual environments, search Google for “python virtualenv tutorial” or similar.  WIT does not need to be installed per se, but its dependencies do. To do so, run:

    pip3 install -r integrator_requirements.txt --extra-index-url https://indeni.jfrog.io/indeni/api/pypi/indeni-pypi-develop/simple --extra-index-url https://indeni.jfrog.io/artifactory/api/pypi/indeni-pypi-stable/simple --extra-index-url https://indeni.jfrog.io/artifactory/api/pypi/indeni-pypi-rc/simple

This command is ideally run from an activated virtual environment. You will find the file “integrator_requirements.txt” in the “workflow_integration_tool” folder at the root of the indeni-knowledge repository.

  • Usage
    From the root of the indeni-knowledge repository, run

    python3 workflow_integration_tool/main.py automation/workflows/<path to workflow.yaml’s folder>

    This will automatically find the test file whose name must end with “workflow_test.yaml” and run all flows described therein. 

  • Understanding Output
    The output should be relatively self-explanatory with some exceptions. A common error (which is being worked on) is the following:

    ERROR:root:no mock found for command: <My specific command>

    This can be caused by a variety of issues. 

    1. There is a typo in the command specified at the top of its Data File

    2. The output of the command is empty (which is currently not allowed, but this will be fixed)

    3. The flow unexpectedly reached a device_task block which caused it to look for a Data File unexpectedly.

    Other than this, the output is mostly the same as what is printed by python’s unittest library, with the addition of some information on which blocks/conclusions are not reached. 

    Notice, if not all blocks/conclusions are reached by some flow, the integration testing will fail.

  • Tips & Tricks
    If you’re using an IDE like PyCharm, you can set debug points inside WIT itself to see the actual Python objects that represent the flows, the execution, the data files, etc.

  • Feedback
    Contact Jon by slack or at jonathan.s@indeni.com with any feedback or for assistance. This is a new tool which is still being improved, so don’t be shy to ask questions. If you’re stuck on a surprising output or if the tool is not working, ask.