prybalko / tester

python test task

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Tester

Command-line software in Python 3 that is able to run tests implemented in Python and Bash scripts.

Features

  • Run tests implemented in Python (the choice of testing framework is free) and Bash scripts.
  • Start the test runs in the background.
  • Query the status of running tests (during the test run and afterwards).

Tech

Tester uses some open source projects to work properly:

Usage

Install from source using pip:

git clone git@github.com:prybalko/tester.git
pip install -e tester

Python >= 3.6 supported.

Run tests in the foreground

$ tester run
=================== test session starts =========================================
platform linux -- Python 3.7.3, pytest-4.6.3, py-1.8.0, pluggy-0.12.0
collected 3 items

tests/test_dummy.sh .                                                      [ 33%]
tests/test_sample.py ..                                                    [100%]

=================== 3 passed in 0.21 seconds ====================================

Run tests in the background

$ tester start

Get tests status

$ tester status
 id        pid       test                                              status
 1         23401     tests/test_dummy.sh                               passed
 2         23401     tests/test_sample.py::test_mytest                 passed
 3         23401     tests/test_sample.py::TestClass::test_one         passed

Distributed testing

Distributed test execution is delegated to pytest-xdist plugin.

To send tests to multiple CPUs, type:

$ tester start -n NUM

To send tests to remote SSH account:

$ tester start -d --tx ssh=myhostpopen --rsyncdir mypkg mypkg

This will synchronize your mypkg package directory to a remote ssh account and then locally collect tests and send them to remote places for execution.

The basic command to run tests on multiple platforms is:

$ tester start --dist=each --tx=spec1 --tx=spec2

For more information please see pytest-xdist docs.

Todos

  • add more tests

About

python test task


Languages

Language:Python 99.7%Language:Shell 0.3%