Skip to content
microservices test and univeral migrations tool
Python Other
  1. Python 99.6%
  2. Other 0.4%
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
catcher
docs
test
.gitignore
.travis.yml
Changelog.rst
Dockerfile
LICENSE
Makefile
Readme.rst
requirements.txt
setup.py

Readme.rst

https://travis-ci.org/comtihon/catcher.svg?branch=master https://patrolavia.github.io/telegram-badge/chat.png

Microservices automated test tool

Support your team with a good Catcher!

https://raw.githubusercontent.com/comtihon/catcher/master/docs/_static/logo_big.png

What is catcher?

Catcher is a flexible end to end test tool, that can be used for automated microservices or data pipelines testing. It helps you to check either one service or whole system interaction. With the help of Catcher you can easily mock external services your system relies on. Catcher is not about only http, it can check different services, such as Kafka, Postgres, CouchBase, Mongodb, Elastic, S3, emails and others.

Testing - How it works?

  1. You implement new business requirements, touching one ore more services (external and internal)
  2. You write tests file in YAML or JSON formats where you describe data movement in your system
  3. You run your tests in any environment (from dev to prod) by just changing inventory files.
  4. Bob (your colleague) implements his own business logic, which requires your test (or part of it) to be run.
  5. Bob writes his test in YAML and includes your test (or certain steps) to be run before or during his test.
  6. John (your devOps) decides to automate tests and makes CI run all tests on every microservice deploy.
  7. Your business logic is tested automatically and you will know if some of your services interact incorrectly.
  8. Profit.

Installation

To install catcher with all internal modules run sudo pip install catcher-modules[all].
This will install catcher and catcher-modules package.
To install just catcher run sudo pip install catcher.
To install specific catcher-module use pip install catcher-modules[kafka]. See catcher-modules-index for all available modules.

Changelog is here.

Customization

Catcher can be easily customized to serve your needs.

  1. You can write your own functions and filters and use them in your step's templates.
  2. You can create your own steps (as python script or any executable)
  3. You can write your steps in catcher itself and include them from other tests.

Usage

  • Write catcher script (see tests). F.e.:

    ---
    steps:
    - http: {get: {url: 'http://my_cache_service.com/save?key=foo&value=bar'}}
    - redis:
        request:
            get: 'foo'
        register: {foo: '{{ OUTPUT }}'}
    - check:
        equals: {the: '{{ foo }}', is: 'bar'}
    
  • Run catcher catcher my_test_file.yml.

You can also specify inventory with -i to test against different environments, custom module paths with -m to include your own modules. Run catcher -h to get full list of available options.
See run documentation for local & docker run info.

Why catcher?

  • don't repeat test code. Write one test and call its steps from another;
  • compute and override variables to check your data and compose new flexible requests;
  • apply :meth:`catcher.steps.check` to the steps results;
  • write test for development, change inventory and test stage/uat/prod after deploy;
  • test all your microservices with ease;
  • automate your testing!
  • modular architecture
  • perfect for big data pipelines testing with prepare-expect

Quickstart and documentation

See readthedocs.

You can’t perform that action at this time.