Metadata-Version: 1.2
Name: zerobug
Version: 2.0.9
Summary: Zeroincombenze continuous testing framework and tools for python and bash programs
Home-page: https://github.com/zeroincombenze/tools
Author: Antonio Maria Vigliotti
Author-email: <info@shs-av.com>
License: Affero GPL
Project-URL: Source, https://github.com/zeroincombenze/tools/tree/master/zerobug
Project-URL: Documentation, https://zeroincombenze-tools.readthedocs.io/en/latest/zerobug
Project-URL: Changelog, https://github.com/zeroincombenze/tools/blob/master/zerobug/egg-info/CHANGELOG.rst
Description: 
        ======
         2.0.9
        ======
        
        
        
        |Maturity| |license gpl|
        
        
        
        
        Overview
        ========
        
        Zeroincombenze® continuous testing framework for python and bash programs
        -------------------------------------------------------------------------
        
        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.
        
        Because **zerobug** can show total number of unit test to execute, it runs tests
        in 2 passes. In the first pass it counts the number of test, in second pass executes really
        it. This behavior can be overridden by -0 switch.
        
        
        
        
        
        
        
        |
        
        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] [-J] [-k] [-l file] [-N] [-n] [-O]
                           [-p file_list] [-q] [-r number] [-s number] [-V] [-v] [-x] [-X]
                           [-z number] [-0] [-1] [-3]
        
            Regression test on z0bug_odoo
        
            optional arguments:
              -h, --help            show this help message and exit
              -B, --debug           trace msgs in zerobug.tracehis
              -C, --no-coverage     run tests without coverage
              -e, --echo            enable echoing even if not interactive tty
              -J                    load travisrc
              -k, --keep            keep current logfile
              -l file, --logname file
                                    set logfile name
              -N, --new             create new logfile
              -n, --dry-run         count and display # unit tests
              -O                    load odoorc
              -p file_list, --search-pattern file_list
                                    test file pattern
              -q, --quiet           run tests without output (quiet mode)
              -r number, --restart number
                                    set to counted tests, 1st one next to this
              -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
              -X, --esanity         execute test library sanity check and exit
              -z number, --end number
                                    display total # tests when execute them
              -0, --no-count        no count # unit tests
              -1, --coverage        run tests for coverage (obsolete)
              -3, --python3         use python3
        
        
        Code example
        ------------
        
        *zerobug* makes avaiable following functions to test:
        
        |
        
        `Z0BUG.setup(ctx)` (python)
        
        `Z0BUG_setup` (bash)
        
        Setup for test. It is called before all tests.
        
        |
        
        `Z0BUG.teardown(ctx)` (python)
        
        `Z0BUG_teardown` (bash)
        
        Setup for test. It is called after all tests.
        
        |
        
        `Z0BUG.build_os_tree(ctx, list_of_paths)` (python)
        
        `Z0BUG_build_os_tree list_of_paths` (bash)
        
        Build a full os tree from supplied list.
        If python, list of paths is a list of strings.
        If bash, list is one string of paths separated by spaces.
        Function reads list of paths and then create all directories.
        If directory is an absolute path, it is created with the supplied path.
        If directory is a relative path, the directory is created under "tests/res" directory.
        
        Warning!
        To check is made is parent dir does not exit. Please, supply path from parent
        to children, if you want to build a nested tree.
        
        ::
        
            # (python)
            from zerobug import Z0BUG
            class RegressionTest():
        
                def __init__(self, Z0BUG):
                    self.Z0BUG = Z0BUG
        
                def test_01(self, ctx):
                    os_tree = ['10.0',
                               '10.0/addons',
                               '10.0/odoo',]
                    root = self.Z0BUG.build_os_tree(ctx, os_tree)
        
        ::
        
            # (bash)
            Z0BUG_setup() {
                Z0BUG_build_os_tree "10.0 10.0/addons 10.0/odoo"
            }
        
        |
        
        `Z0BUG.remove_os_tree(ctx, list_of_paths)` (python)
        
        `Z0BUG_remove_os_tree list_of_paths` (bash)
        
        Remove a full os tree created by `build_os_tree`
        If python, list of paths is a list of strings.
        If bash, list is a string of paths separated by spaces.
        Function reads list of paths and remove all directories.
        If directory is an absolute path, the supplied path is dropped.
        If directory is a relative path, the directory is dropped from tests/res directory.
        
        Warning!
        This function remove directory and all sub-directories without any control.
        
        ::
        
            # (python)
            from zerobug import Z0BUG
            class RegressionTest():
        
                def __init__(self, Z0BUG):
                    self.Z0BUG = Z0BUG
        
                def test_01(self, ctx):
                    os_tree = ['10.0',
                               '10.0/addons',
                               '10.0/odoo',]
                    root = self.Z0BUG.remove_os_tree(ctx, os_tree)
        
        |
        
        `Z0BUG.build_odoo_env(ctx, version)` (python)
        
        Like build_os_tree but create a specific odoo os tree.
        
        ::
        
            # (python)
            from zerobug import Z0BUG
            from zerobug import Z0testOdoo
            class RegressionTest():
        
                def __init__(self, Z0BUG):
                    self.Z0BUG = Z0BUG
        
                def test_01(self, ctx):
                    root = Z0testOdoo.build_odoo_env(ctx, '10.0')
        
        |
        
        `Z0BUG.git_clone(remote, reponame, branch, odoo_path, force=None)` (python)
        
        Execute git clone of `remote:reponame:branch` into local directory `odoo_path`.
        In local travis emulation, if repository uses local repository, if exists.
        Return odoo root directory
        
        ::
        
            # (python)
            from zerobug import Z0BUG
            from zerobug import Z0testOdoo
        
            from zerobug import Z0BUG
            class RegressionTest():
        
                def __init__(self, Z0BUG):
                    self.Z0BUG = Z0BUG
        
                def test_01(self, ctx):
                    remote = 'OCA'
                    reponame = 'OCB'
                    branch = '10.0'
                    odoo_path = '/opt/odoo/10.0'
                    Z0testOdoo.git_clone(remote, reponame, branch, odoo_path)
        
        
        
        
        Unit test can run in package directory or in ./tests directory of package.
        
        Every test can inquire internal context.
        
        ::
        
            this_fqn      parent caller full qualified name (i.e. /opt/odoo/z0bug.pyc)
            this          parent name, w/o extension (i.e. z0bug)
            ctr           test counter [both bash and python tests]
            dry_run       dry-run (do nothing) [opt_dry_run in bash test]          "-n"
            esanity       True if required sanity check with echo                  "-X"
            max_test      # of tests to execute [both bash and python tests]       "-z"
            min_test      # of test executed before this one                       "-r"
            on_error      behavior after error, 'continue' or 'raise' (default)
            opt_echo      True if echo test result onto std output                 "-e"
            opt_new       new log file [both bash and python tests]                "-N"
            opt_noctr     do not count # tests [both bash and python tests]        "-0"
            opt_verbose   show messages during execution                           "-v"
            logfn         real trace log file name from switch                     "-l"
            qsanity       True if required sanity check w/o echo                   "-x"
            run4cover     Run tests for coverage (use coverage run rather python)  "-C"
            python3       Execute test in python3                                  "-3"
            run_daemon    True if execution w/o tty as stdio
            run_on_top    Top test (not parent)
            run_tty       Opposite of run_daemon
            tlog          default tracelog file name
            _run_autotest True if running auto-test
            _parser       cmd line parser
            _opt_obj      parser obj, to acquire optional switches
            WLOGCMD       override opt_echo; may be None, 'echo', 'echo-1', 'echo-0'
            Z0            this library object
        
        Environment read:
        
        DEV_ENVIRONMENT Name of package; if set test is under travis emulator control
        
        COVERAGE_PROCESS_START
                        Name of coverage conf file; if set test is running for coverage
        
        
        
        |
        |
        
        Getting started
        ===============
        
        
        Installation
        ------------
        
        Zeroincombenze tools require:
        
        * Linux Centos 7/8 or Debian 9/10 or Ubuntu 18/20/22
        * python 2.7+, some tools require python 3.6+
        * bash 5.0+
        
        Stable version via Python Package
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        
        ::
        
            pip install 
        
        |
        
        Current version via Git
        ~~~~~~~~~~~~~~~~~~~~~~~
        
        ::
        
            cd $HOME
            git clone https://github.com/zeroincombenze/tools.git
            cd ./tools
            ./install_tools.sh -p
            source $HOME/devel/activate_tools
        
        
        Upgrade
        -------
        
        Stable version via Python Package
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        
        ::
        
            pip install  -U
        
        |
        
        Current version via Git
        ~~~~~~~~~~~~~~~~~~~~~~~
        
        ::
        
            cd $HOME
            ./install_tools.sh -U
            source $HOME/devel/activate_tools
        
        
        History
        -------
        
        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
        
        
        
        
        |
        |
        
        Credits
        =======
        
        Copyright
        ---------
        
        SHS-AV s.r.l. <https://www.shs-av.com/>
        
        
        Contributors
        ------------
        
        * Antonio Maria Vigliotti <antoniomaria.vigliotti@gmail.com>
        
        
        |
        
        This module is part of  project.
        
        Last Update / Ultimo aggiornamento: 
        
        .. |Maturity| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
            :target: https://odoo-community.org/page/development-status
            :alt: 
        .. |license gpl| image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
            :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
            :alt: License: AGPL-3
        .. |license opl| image:: https://img.shields.io/badge/licence-OPL-7379c3.svg
            :target: https://www.odoo.com/documentation/user/9.0/legal/licenses/licenses.html
            :alt: License: OPL
        .. |Tech Doc| image:: https://www.zeroincombenze.it/wp-content/uploads/ci-ct/prd/button-docs-2.svg
            :target: https://wiki.zeroincombenze.org/en/Odoo/2.0/dev
            :alt: Technical Documentation
        .. |Help| image:: https://www.zeroincombenze.it/wp-content/uploads/ci-ct/prd/button-help-2.svg
            :target: https://wiki.zeroincombenze.org/it/Odoo/2.0/man
            :alt: Technical Documentation
        .. |Try Me| image:: https://www.zeroincombenze.it/wp-content/uploads/ci-ct/prd/button-try-it-2.svg
            :target: https://erp2.zeroincombenze.it
            :alt: Try Me
        .. |Zeroincombenze| image:: https://avatars0.githubusercontent.com/u/6972555?s=460&v=4
           :target: https://www.zeroincombenze.it/
           :alt: Zeroincombenze
        .. |en| image:: https://raw.githubusercontent.com/zeroincombenze/grymb/master/flags/en_US.png
           :target: https://www.facebook.com/Zeroincombenze-Software-gestionale-online-249494305219415/
        .. |it| image:: https://raw.githubusercontent.com/zeroincombenze/grymb/master/flags/it_IT.png
           :target: https://www.facebook.com/Zeroincombenze-Software-gestionale-online-249494305219415/
        .. |check| image:: https://raw.githubusercontent.com/zeroincombenze/grymb/master/awesome/check.png
        .. |no_check| image:: https://raw.githubusercontent.com/zeroincombenze/grymb/master/awesome/no_check.png
        .. |menu| image:: https://raw.githubusercontent.com/zeroincombenze/grymb/master/awesome/menu.png
        .. |right_do| image:: https://raw.githubusercontent.com/zeroincombenze/grymb/master/awesome/right_do.png
        .. |exclamation| image:: https://raw.githubusercontent.com/zeroincombenze/grymb/master/awesome/exclamation.png
        .. |warning| image:: https://raw.githubusercontent.com/zeroincombenze/grymb/master/awesome/warning.png
        .. |same| image:: https://raw.githubusercontent.com/zeroincombenze/grymb/master/awesome/same.png
        .. |late| image:: https://raw.githubusercontent.com/zeroincombenze/grymb/master/awesome/late.png
        .. |halt| image:: https://raw.githubusercontent.com/zeroincombenze/grymb/master/awesome/halt.png
        .. |info| image:: https://raw.githubusercontent.com/zeroincombenze/grymb/master/awesome/info.png
        .. |xml_schema| image:: https://raw.githubusercontent.com/zeroincombenze/grymb/master/certificates/iso/icons/xml-schema.png
           :target: https://github.com/zeroincombenze/grymb/blob/master/certificates/iso/scope/xml-schema.md
        .. |DesktopTelematico| image:: https://raw.githubusercontent.com/zeroincombenze/grymb/master/certificates/ade/icons/DesktopTelematico.png
           :target: https://github.com/zeroincombenze/grymb/blob/master/certificates/ade/scope/Desktoptelematico.md
        .. |FatturaPA| image:: https://raw.githubusercontent.com/zeroincombenze/grymb/master/certificates/ade/icons/fatturapa.png
           :target: https://github.com/zeroincombenze/grymb/blob/master/certificates/ade/scope/fatturapa.md
        .. |chat_with_us| image:: https://www.shs-av.com/wp-content/chat_with_us.gif
           :target: https://t.me/Assitenza_clienti_powERP
        
        
        
Keywords: bash,optargs
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: License :: OSI Approved :: GNU Affero General Public License v3
Classifier: Operating System :: POSIX
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: System :: System Shells
