Zeroincombenze continuous testing framework and tools for python and bash programs
Project description
Overview
This library can run unit test of target package software. Supported languages are python (through z0testlib.py) and bash (through z0testrc)
zerobug supports test automation, aggregation of tests into collections and independence of the tests from the reporting framework. The zerobug module provides all code that make it easy to support testing both for python programs both for bash scripts. zerobug shows execution test with a message like “n/tot message” where n is current unit test and tot is the total unit test to execute, that is a sort of advancing test progress.
You can use z0bug_odoo that is the odoo integration to test Odoo modules.
zerobug is built on follow concepts:
test main - it is a main program to executes all test runners
test runner - it is a program to executes one or more test suites
test suite - it is a collection of test cases
test case - it is a smallest unit test
The main file is the command zerobug of this package; it searches for test runner files named [id_]test_ where ‘id’ is the shor name of testing package.
Test suite is a collection of test case named test_[0-9]+ inside the runner file, executed in sorted order.
Every suit can contains one or more test case, the smallest unit test; every unit test terminates with success or with failure.
Features
Test execution log
Autodiscovery test modules and functions
Python 2.7+ and 3.5+
coverage integration
travis integration
Usage
usage: zerobug [-h] [-B] [-C] [-e] [-f] [-J] [-k] [-l file] [-N] [-n] [-O] [-p file_list] [-Q] [-q] [-R] [-r number] [-s number] [-V] [-v] [-x] [-X] [-z number] [-0] [-1] [-2] [-3] Regression test on zerobug optional arguments: -h, --help show this help message and exit -B, --debug run tests in debug mode -C, --no-coverage run tests without coverage -e, --echo enable echoing even if not interactive tty (deprecated) -f, --failfast Stop on first fail or error -J load travisrc (deprecated) -k, --keep keep current logfile (deprecated) -l file, --logname file set logfile name (deprecated) -N, --new create new logfile (deprecated) -n, --dry-run count and display # unit tests (deprecated) -O load odoorc (deprecated) -p file_list, --search-pattern file_list Pattern to match tests, comma separated ('test*.py' default) -Q, --count count # unit tests (deprecated) -q, --quiet run tests without output (quiet mode) -R, --run-inner inner mode w/o final messages -r number, --restart number restart count next to number -s number, --start number deprecated -V, --version show program's version number and exit -v, --verbose verbose mode -x, --qsanity like -X but run silently (deprecated) -X, --esanity execute test library sanity check and exit (deprecated) -z number, --end number display total # tests when execute them -0, --no-count no count # unit tests (deprecated) -1, --coverage run tests for coverage (deprecated) -2, --python2 use python2 (deprecated) -3, --python3 use python3 (deprecated) © 2015-2023 by SHS-AV s.r.l. - https://zeroincombenze-tools.readthedocs.io/en/latest/zerobug
Getting started
Prerequisites
Zeroincombenze tools requires:
Linux Centos 7/8 or Debian 9/10 or Ubuntu 18/20/22
python 2.7+, some tools require python 3.6+, best python 3.8+
bash 5.0+
Installation
Stable version via Python Package
pip install zerobug
Current version via Git
cd $HOME [[ ! -d ./tools ]] && git clone https://github.com/zeroincombenze/tools.git cd ./tools ./install_tools.sh -pUT source $HOME/devel/activate_tools
Upgrade
Stable version via Python Package
pip install --upgrade zerobug
Current version via Git
cd ./tools ./install_tools.sh -pUT source $HOME/devel/activate_tools
ChangeLog History
2.0.10 (2023-11-10)
[REF] Partial refactoring
[IMP] New functions assert* like unittest2
[IMP] New switch -f failfast
[IMP] Test signature like unittest2 and old zerobug signature
[IMP] Test flow without return status (like unitest2)
2.0.9 (2023-07-12)
[IMP] zerobug implementation with unittest
[FIX] z0testlib.py: build_odoo_env, odoo-bin / openerp-server are executable
[FIX] z0testlib.py: minor fixes
2.0.7 (2023-05-14)
[IMP] travis_run_pypi_tests: new switch -p PATTERN
2.0.6 (2023-05-08)
[IMP] Now all_tests is ignored
[IMP] Build Odoo environment for Odoo 16.0
2.0.5 (2023-03-24)
[FIX] travis_install_env: ensure list_requirements is executable
[IMP] flake8 configuration
[IMP] coveralls and codecov are not more dependencies
[IMP] Test for Odoo 16.0
2.0.4 (2022-12-08)
[FIX] run_pypi_test: best recognition of python version
[FIX] build_cmd: best recognition of python version
[FIX] travis_install_env: ensure coverage version
[IMP] odoo environment to test more precise
2.0.3 (2022-11-08)
[IMP] npm management
2.0.2.1 (2022-10-31)
[FIX] Odoo 11.0+
[FIX] Ensure coverage 5.0+
2.0.2 (2022-10-20)
[IMP] Stable version
2.0.1.1 (2022-10-12)
[IMP] minor improvements
2.0.1 (2022-10-12)
[IMP] stable version
2.0.0.2 (2022-10-05)
[IMP] travis_install_env: python2 tests
2.0.0.1 (2022-09-06)
[FIX] travis_install_env: minor fixes
[IMP] z0testlib: show coverage result
2.0.0 (2022-08-10)
[REF] Partial refactoring for shell scripts
Credits
Copyright
SHS-AV s.r.l. <https://www.shs-av.com/>
Contributors
Antonio Maria Vigliotti <antoniomaria.vigliotti@gmail.com>
Antonio Maria Vigliotti <info@shs-av.com>
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.