catcher

microservices and data pipelines end-to-end test tool

https://github.com/comtihon/catcher

Science Score: 13.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.4%) to scientific vocabulary

Keywords

catcher e2e e2e-testing e2e-tests migration-tool test-automation test-framework testing-tools

Keywords from Contributors

serializer plagiarism-checker xunit-test xunit-framework actions yolov5 embedded graph-generation optim interactive
Last synced: 6 months ago · JSON representation

Repository

microservices and data pipelines end-to-end test tool

Basic Info
  • Host: GitHub
  • Owner: comtihon
  • License: apache-2.0
  • Language: Python
  • Default Branch: master
  • Homepage:
  • Size: 1.11 MB
Statistics
  • Stars: 96
  • Watchers: 6
  • Forks: 13
  • Open Issues: 19
  • Releases: 0
Topics
catcher e2e e2e-testing e2e-tests migration-tool test-automation test-framework testing-tools
Created almost 8 years ago · Last pushed over 2 years ago
Metadata Files
Readme Changelog License

Readme.rst

.. image:: https://github.com/comtihon/catcher/actions/workflows/test-package.yml/badge.svg?branch=master
    :target: https://github.com/comtihon/catcher/actions/workflows/test-package.yml
.. image:: https://img.shields.io/pypi/v/catcher.svg
    :target: https://pypi.python.org/pypi/catcher
.. image:: https://img.shields.io/pypi/pyversions/catcher.svg
    :target: https://pypi.python.org/pypi/catcher
.. image:: https://img.shields.io/pypi/wheel/catcher.svg
    :target: https://pypi.python.org/pypi/catcher
.. image:: https://patrolavia.github.io/telegram-badge/chat.png
    :target: https://t.me/catcher_e2e

Microservices automated test tool
=================================
Support your team with a good Catcher!

.. image:: https://raw.githubusercontent.com/comtihon/catcher/master/docs/_static/logo_big.png
   :scale: 50 %

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 from the front-end to the back-end.
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.

Quickstart and documentation
----------------------------
1. Check, how to write a `test `_.
2. Get to know how to `install `_ and run Catcher.
3. List all `steps `_ and select those you need.
4. Learn more about `variables `_ and `resources `_
5. Read how to trace and debug your test using `reports `_

For more information check `readthedocs`_.

Very quick start
----------------
You can run Catcher in `docker`_ with all libraries, drivers and steps already installed and configured. It allows
you to try Catcher without installing anything.

Just run the minimal command::

    docker run -v $(pwd)/inventory:/opt/catcher/inventory
               -v $(pwd)/tests:/opt/catcher/tests
                catcher -i inventory/my_inventory.yml tests

It will ask Catcher to run everything within your local **tests** folder using **inventory/my_inventory.yml**. For more
information please check run `instructions `_

.. _docker: https://hub.docker.com/repository/docker/comtihon/catcher

How does it look like?
----------------------

Imagine you have a **user_service** which saves users in **postgre** and posts them to **kafka** topic, where they are
consumed by another service, which sends them emails.
You mention your environment in the inventory files.

local.yml::

    kafka_server: '127.0.0.1:9092'
    postgres: 'test:test@localhost:5433/test'
    user_service: 'http://127.0.0.1:9090'
    email_config:
        host: '127.0.0.1:12345'
        user: 'local_user'
        pass: 'local_pass'

develop.yml::

    kafka_server: 'kafka.dev.mycompany.com:9092'
    postgres: 'dev:dev@postgres.dev.mycompany.com:5433/test'
    user_service: 'http://user_service.dev.mycompany.com:9090'
    email_config:
        host: 'imap.google.com'
        user: 'my_user@google.com'
        pass: 'my_pass'

You write a test::

    variables: # here you specify test-local variables
        users:
            - email: '{{ test_user@my_company.com }}'
              name: '{{ random("name") }}' # templates fully supported
            - email: '{{ random("email") }}'
              name: '{{ random("name") }}'
    steps: # here you write steps which Catcher executed one by one until it fails
        - http:
            post:
                url: '{{ user_service }}/sign_up' # user_service value is taken from active inventory which you specify at runtime
                body: '{{ users[0] }}' # send first user from variables as a POST body
                headers: {Content-Type: 'application/json'}
                response_code: 2xx # will accept 200-299 codes
            name: 'Register {{ users[0].email }} as a new user' # name your step properly (Optional)
            register: {user_id: '{{ OUTPUT.id }}'}  # register new variable user_id as id param from json response
        - postgres: # check if user was saved in the database
            request:
                conf: '{{ postgres }}'
                sql: 'select * from users where user_id = {{ user_id }}'  # user_id from previous step will be used in this template
            register: {email_in_db: '{{ OUTPUT.email }}'}  # load full user data and register only email as a new variable
        - check: # compare email from the database with real user email
            equals: {the: '{{ users[0].email }}', is: '{{ email_id_db }}'}}  # checks the equality between two strings. Templates supported.
        - kafka:
            consume:  # check if user_service pushed newly created user to kafka
                server: '{{ kafka_server }}' # kafka_server value is taken from active inventory
                topic: 'new_users'
                where: # filter all messages except messages for our user
                    equals: {the: '{{ MESSAGE.user_id }}', is: '{{ user_id }}'}
        - email: # check if email was sent for this user
              receive:
                  config: '{{ email_conf }}'
                  filter: {unread: true, subject: 'Welcome {{ users[0].name }}'} # select all unread and filter by subject
                  ack: true  # mark as read
                  limit: 1
              register: {messages: '{{ OUTPUT }}'}  # register all messages found (0 or 1)
        - check: '{{ messages |length > 0 }}' # short form of compare - we should have more than 0 messages co pass this step
    finally:
        - postgres: # delete user from database to cleanup after test finishes (no matter successfully or not)
            request:
                conf: '{{ postgres }}'
                sql: 'delete from users where user_id = {{ user_id }}'

For local environment run it as::

    catcher -i inventories/local.yml tests/my_test.yml

For dev::

    catcher -i inventories/develop.yml tests/my_test.yml

See `microservices`_ for more complex example.

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 `modules `_ (in Python, Java, Kotlin, JS, jar-files or any executable)
3. You can write your steps in catcher itself and `include `_ them from other tests.

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;
* write test for development, change inventory and test stage/uat/prod with no changes;
* test your data pipelines with `Airflow `_ step;
* test your front-end <-> back-end integration with `Selenium `_ step;
* test all your `microservices`_ with ease;
* `modular`_ architecture
* bulk-prepare and bulk-check data for you tests with `prepare-expect`_ step
* automate your testing!

Changelog is `here `_.

Contributors:
-------------
* Many thanks to `Ekaterina Belova `_ for core & modules contribution.

.. _readthedocs: https://catcher-test-tool.readthedocs.io/en/latest/
.. _microservices: https://catcher-test-tool.readthedocs.io/en/latest/source/microservices.html
.. _modular: https://catcher-test-tool.readthedocs.io/en/latest/source/modules.html
.. _prepare-expect: https://catcher-modules.readthedocs.io/en/latest/source/prepare_expect.html
.. _selenium: https://catcher-modules.readthedocs.io/en/latest/source/selenium.html

Owner

  • Name: Val
  • Login: comtihon
  • Kind: user
  • Location: Berlin
  • Company: Airteam Aerial Intelligence GmbH

CTO @airteam-aerial-intelligence

GitHub Events

Total
  • Watch event: 2
Last Year
  • Watch event: 2

Committers

Last synced: over 1 year ago

All Time
  • Total Commits: 369
  • Total Committers: 9
  • Avg Commits per committer: 41.0
  • Development Distribution Score (DDS): 0.507
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Val v****v@g****m 182
Valerii Tikhonov c****n@m****u 64
dependabot[bot] 4****] 46
Val v****v@s****e 28
dependabot-preview[bot] 2****] 27
Valerii Tikhonov v****v@d****e 15
Ekaterina Belova e****a@g****m 4
Val v****v@a****i 2
Ekaterina Belova e****a@s****m 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 1
  • Total pull requests: 155
  • Average time to close issues: 1 day
  • Average time to close pull requests: 26 days
  • Total issue authors: 1
  • Total pull request authors: 2
  • Average comments per issue: 1.0
  • Average comments per pull request: 0.75
  • Merged pull requests: 32
  • Bot issues: 0
  • Bot pull requests: 152
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • beatstream69 (1)
Pull Request Authors
  • dependabot[bot] (141)
  • comtihon (3)
Top Labels
Issue Labels
Pull Request Labels
dependencies (141)

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 202 last-month
  • Total dependent packages: 1
  • Total dependent repositories: 1
  • Total versions: 123
  • Total maintainers: 1
pypi.org: catcher

Microservices automated test tool.

  • Versions: 123
  • Dependent Packages: 1
  • Dependent Repositories: 1
  • Downloads: 202 Last month
Rankings
Dependent packages count: 4.7%
Stargazers count: 7.3%
Forks count: 9.8%
Average: 11.9%
Downloads: 16.2%
Dependent repos count: 21.7%
Maintainers (1)
Last synced: 6 months ago

Dependencies

docs/requirements.txt pypi
  • Sphinx ==5.0.1
requirements.txt pypi
  • Faker ==13.12.1
  • Jinja2 ==3.1.2
  • PyYAML ==6.0
  • colorama ==0.4.4
  • docopt ==0.6.2
  • grpcio ==1.46.3
  • grpcio-tools ==1.46.3
  • mock ==4.0.3
  • networkx ==2.6.3
  • pytest ==7.1.2
  • requests ==2.27.1
  • requests_mock ==1.9.3
  • urllib3 ==1.26.9
  • uuid ==1.30
.github/workflows/docker-publish.yml actions
  • actions/checkout v2 composite
  • docker/build-push-action v2 composite
  • docker/login-action v1 composite
.github/workflows/tag_master.yml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
  • anothrNick/github-tag-action 1.33.0 composite
  • pypa/gh-action-pypi-publish master composite
.github/workflows/test-package.yml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
  • fwilhe2/setup-kotlin main composite
Dockerfile docker
  • python 3.9-alpine build
setup.py pypi