Installation and run instructions¶
Local¶
Local run requires Catcher to be installed first.
Python installation¶
1. install conda executable. See official doc for more info
for Linux:
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh
for Linux:
conda create --name catcher python=3.7
for Linux:
conda activate catcher
python --version
Now you have local python37 installation which you can use after activation.
Catcher installation¶
Catcher has 2 python packages: the core which contains most basic steps, executable and core logic and the external modules package which contains external modules like database, message queue, aws services and other tools support.
- To install the core - run pip install catcher. After it you should be able to run catcher from command line. Check it
with catcher -h.
- Important: if you are using conda - make sure you installed Catcher in the environment and that the environment is
activated every time you are going to run Catcher.
External modules are installed separately on demand, as probably you don’t need all of them. Also, some external modules require drivers and client libraries, needed to be installed locally as well (see readme for more information).
To install only kafka module you need to run pip install catcher-modules[kafka]. In case you need multiple modules - use comma to separate them: pip install catcher-modules[kafka,s3]
Run Catcher¶
By default all Catcher Resources are in ./resources directory. They are used in steps (http/message bodies, data for queries, selenium source files).
Inventory files are in ./inventory. They are used for environment specific variables like database configuration and services endpoints.
Substeps are in ./steps. They are part of the tests, written in Catcher to be included in tests.
Tests are in ./tests. They are your tests.
Reports are in ./reports. This directory is stored for Catcher tests traces. See Reports - Catcher’s trace files for more info.
Docker¶
Docker run doesn’t require Catcher or Python to be installed. Catcher’s docker image will be pulled by Docker automatically. Just make sure you have Docker installed.
It is the most convenient way to run tests. Catcher offers you docker 2 images: catcher_base and catcher.
catcher_base is the base image with only catcher-core installed. You can use it to build your own docker image.
catcher is the full, ready to use image with Catcher and all modules from catcher-modules installed.
docker run -v $(pwd)/inventory:/opt/catcher/inventory -v $(pwd)/resources:/opt/catcher/resources -v $(pwd)/tests:/opt/catcher/tests -v $(pwd)/steps:/opt/catcher/steps -v $(pwd)/reports:/opt/catcher/reports catcher -i inventory/my_inventory.yml tests