Skip to main content

Query Testing framework

Project description

ShreQT

Build Status PyPi Version

⢀⡴⠑⡄⠀⠀⠀⠀⠀⠀⠀⣀⣀⣤⣤⣤⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠸⡇⠀⠿⡀⠀⠀⠀⣀⡴⢿⣿⣿⣿⣿⣿⣿⣿⣷⣦⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠑⢄⣠⠾⠁⣀⣄⡈⠙⣿⣿⣿⣿⣿⣿⣿⣿⣆⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⢀⡀⠁⠀⠀⠈⠙⠛⠂⠈⣿⣿⣿⣿⣿⠿⡿⢿⣆⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⢀⡾⣁⣀⠀⠴⠂⠙⣗⡀⠀⢻⣿⣿⠭⢤⣴⣦⣤⣹⠀⠀⠀⢀⢴⣶⣆
⠀⠀⢀⣾⣿⣿⣿⣷⣮⣽⣾⣿⣥⣴⣿⣿⡿⢂⠔⢚⡿⢿⣿⣦⣴⣾⠁⠸⣼⡿
⠀⢀⡞⠁⠙⠻⠿⠟⠉⠀⠛⢹⣿⣿⣿⣿⣿⣌⢤⣼⣿⣾⣿⡟⠉⠀⠀⠀⠀⠀
⠀⣾⣷⣶⠇⠀⠀⣤⣄⣀⡀⠈⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇⠀⠀⠀⠀⠀⠀  Tests have layers
⠀⠉⠈⠉⠀⠀⢦⡈⢻⣿⣿⣿⣶⣶⣶⣶⣤⣽⡹⣿⣿⣿⣿⡇⠀⠀⠀⠀⠀⠀  Ogres have layers
⠀⠀⠀⠀⠀⠀⠀⠉⠲⣽⡻⢿⣿⣿⣿⣿⣿⣿⣷⣜⣿⣿⣿⡇⠀⠀⠀⠀⠀⠀        ~ Anonymous
⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⣷⣶⣮⣭⣽⣿⣿⣿⣿⣿⣿⣿⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⣀⣀⣈⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠇⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠃⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠹⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠟⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠛⠻⠿⠿⠿⠿⠛⠉

Overview

Query testing framework.

Currently supports only Exasol DB.

This project uses Poetry for dependency management and packaging.

Development

To setup your virtual environment run the following command. The default location for poetry venvs is ~/Library/Caches/pypoetry/virtualenvs

poetry install

To run tests and lint checks:

make checks

To format on all files:

make fmt

Usage

Prequisite

Currently we only support Exasol connections. To run local instance of Exasol as docker container run:

docker run  -p 8999:8888 --detach --privileged --stop-timeout 120  exasol/docker-db:6.0.13-d1

(MacOS) Keep in mind that Exasol is memory-heavy and you need to increase docker memory limit to at least 4GB

Credentials

ShreQT uses following environment variables to connect to database.

Variable Default Value
SHREQT_DSN localhost:8999
SHREQT_USER sys
SHREQT_PASS exasol

Example

The example directory contains simple example which illustrates the example usage.

  • conftest.py includes simple User schema and code which sets up the database for test session.
  • example.py includes a tested function.
  • example_test.py include example test function.

You can run the example with:

make run-example

Build && Deploy

Setup ~/.pypirc with credentials.

Run checks and build package:

make build

Deploy package to pypi using poetry:

make deploy

TODO

  • Automate deployment step with travis
  • Decorator functionality for temporary layer
  • Option to automatically clean layers up once dbonion is destroyed.
  • When exception is raised during layer insertion, whole layer should be rolled back before failure.

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

shreqt-0.4.0.tar.gz (6.0 kB view hashes)

Uploaded Source

Built Distribution

shreqt-0.4.0-py3-none-any.whl (6.6 kB view hashes)

Uploaded Python 3

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