Skip to main content

Yandex.Taxi Testsuite Package

Project description

What is testsuite

Testsuite is a microservice-oriented test framework written in Python based on pytest.

Testsuite is written and supported by Yandex.Taxi, and is used to test Yandex.Taxi microservices written in C++ and Python.

The principal suggested approach to testing - although not the only one - is black box, when the service is tested through http calls.

Direct read and write access from test to database is supported to enable precondition setup and result assertions.

Installation

Installation using pip:

pip3 install yandex-taxi-testsuite

# testsuite with mongodb support
pip3 install yandex-taxi-testsuite[mongodb]

# testsuite with postgresql support
pip3 install yandex-taxi-testsuite[postgresql]
pip3 install yandex-taxi-testsuite[postgresql-binary]

# testsuite with redis support
pip3 install yandex-taxi-testsuite[redis]

# testsuite with mysql support
pip3 install yandex-taxi-testsuite[mysql]

# testsuite with clickhouse support
pip3 install yandex-taxi-testsuite[clickhouse]

# testsuite with rabbitmq support
pip3 install yandex-taxi-testsuite[rabbitmq]

# testsuite with kafka support
pip3 install yandex-taxi-testsuite[kafka]

You can also include testsuite into your project as submodule, e.g.:

mkdir -p submodules
git submodule add git@github.com:yandex/yandex-taxi-testsuite.git submodules/testsuite

Supported databases

Out-of-the-box testsuite supports the following databases:

  • PostgreSQL

  • MongoDB

  • Redis

  • MySQL/MariaDB 10+

  • ClickHouse

  • RabbitMQ

Supported operating systems

Testsuite runs on GNU/Linux and macOS operating systems.

Principle of operation

Testsuite sets up the environment for the service being tested:

  • Testsuite starts any required databases (postgresql, mongo, redis).

  • Before each test, testsuite fills the database with test data.

  • Testsuite starts its own web server (mockserver), which mimics (mocks) microservices other than the one being tested.

Testsuite starts the microservice being tested in a separate process.

Testsuite then runs tests.

A test performs http requests to the service and verifies that the requests were processed properly.

A test may check the results of an http call by looking directly into the service’s database.

A test may check whether the service has made calls to external services, as well as the order of calls and the data that was sent and received.

A test may check the internal state of the service as represented by the data the service sent to the test with the testpoint mechanism.

Source code

Testsuite open-source edition code is available here.

Documentation

For full documentation, including installation, tutorials, please see https://yandex.github.io/yandex-taxi-testsuite/.

Running testsuite

self-tests:

pytest3 ./tests

tests of example services:

cd docs/examples && make

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

yandex_taxi_testsuite-0.2.3.1.tar.gz (101.1 kB view details)

Uploaded Source

Built Distribution

yandex_taxi_testsuite-0.2.3.1-py3-none-any.whl (129.7 kB view details)

Uploaded Python 3

File details

Details for the file yandex_taxi_testsuite-0.2.3.1.tar.gz.

File metadata

File hashes

Hashes for yandex_taxi_testsuite-0.2.3.1.tar.gz
Algorithm Hash digest
SHA256 9689ac1998ca88dff5abf9b9320209794c3320841dcf8ec175b856a2ef78c7e8
MD5 c3a4cdf004fb1f6ba2a741b977c33630
BLAKE2b-256 bdb150e12ec87aff5d00f211556cc93a96f5bd2df53d66d08b760cf74dc68422

See more details on using hashes here.

File details

Details for the file yandex_taxi_testsuite-0.2.3.1-py3-none-any.whl.

File metadata

File hashes

Hashes for yandex_taxi_testsuite-0.2.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4e9d6fd20a45ddd9d0f732494b68f9d124b5ba065b5ef96b3386ef8c8d883b71
MD5 01194d9ef2939b260443a79f05d59e6e
BLAKE2b-256 b7deea7b9a3a4c19b84495457c41d6f57d090697f9de193d4c57393bfa193de5

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