Metadata-Version: 2.4
Name: vxci
Version: 0.0.60
Summary: Tool created to help with Odoo in the CI environment
Home-page: https://git.vauxoo.com/devops/vxci
Author: Vauxoo
Author-email: info@vauxoo.com
License: BSD
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: Unix
Classifier: Operating System :: POSIX
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Topic :: Utilities
License-File: LICENSE
License-File: AUTHORS.rst
Requires-Dist: click==6.6
Requires-Dist: vxbase
Requires-Dist: docker==3.5.1; python_version > "3.4" and python_version < "3.6"
Requires-Dist: docker==5.0.3; python_version >= "3.6" and python_version < "3.8"
Requires-Dist: docker==6.0.0; python_version >= "3.8"
Requires-Dist: requests<2.32.0,>=2.26.0; python_version >= "3.8"
Requires-Dist: future
Requires-Dist: jinja2
Requires-Dist: urllib3==1.26.15; python_version < "3.8"
Requires-Dist: urllib3==1.26.19; python_version >= "3.8"
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: home-page
Dynamic: license
Dynamic: license-file
Dynamic: requires-dist
Dynamic: summary

========
Overview
========



Deployv addon: Gitlab tools. Generated by cookiecutter and cookiecutter-deploy-addon.

A small set of tools to automate repetitive tasks for testing gitlab repositories.

It is important to say that this is not by any mean a replacement for the MQT tools, these are tools that we need in order to make gitlab-ci work properly with the MQT tools.

* Free software: BSD license

Installation
============

::

    pip install vxci

Documentation
=============

https://vxci.readthedocs.io/

Development
===========

To run the all tests run::

    tox

Note, to combine the coverage data from all the tox environments run:

.. list-table::
    :widths: 10 90
    :stub-columns: 1

    - - Windows
      - ::

            set PYTEST_ADDOPTS=--cov-append
            tox

    - - Other
      - ::

            PYTEST_ADDOPTS=--cov-append tox


Changelog
=========

Unreleased
-----------------------------------------

* clickbot: the suite also fails when an integer id, a foreign key or a
  sequence reached ``CLICKBOT_ID_CEILING_PCT`` percent (60 by default) of the
  largest value it can take, and logs the 20 fullest ones. The ceiling of an
  integer column fed by a bigint sequence is the integer one.
  ``CLICKBOT_ID_CEILING_ALLOWED`` accepts ``table.column`` items above the
  threshold. It reads only the catalog, the sequences and indexed maximums,
  so it takes seconds on large databases.
* clickbot: Odoo 16.0 or later, no longer 19.0 only. The suite starts the
  clickbot the way Odoo's own test of each version does (the debug services in
  16.0, the module loader since 17.0), on /web or /odoo (18.0), passes
  ``success_signal`` only where ``browser_js`` takes it, posts the JSON-RPC call
  without ``build_rpc_payload`` before 19.0, reads ``failure_count`` only where
  ``ir.cron`` has it, and blocks the external requests of the crons in 16.0,
  which does not block them in tests.
* check_log: when the log path holds the ``staggered_logs`` folder of a
  ``staggered_install --isolated --parallel`` run, every warning is reported with
  the install that logged it, templates included, and that install's log, and a
  table of those installs closes the output. The joined ``odoo.log.gz_*`` still
  decides the exit status, and a warning no install log holds, such as one from
  another job's log, is still reported as it is.
* clickbot: new command. Restores the database a test job kept (``db.pgc`` and
  ``filestore.tgz`` in ``CLICKBOT_DIR``, ``$CI_COMMIT_REF_SLUG/clickbot`` by
  default) and runs the ``vxci_clickbot`` suite shipped in this package on it,
  under pytest-odoo with ``CLICKBOT_WORKERS`` pytest-xdist workers (4) in one
  job: Odoo's clickbot over every app ``admin`` and ``demo`` see, and "Run
  Manually" on every scheduled action. The apps are packed into
  ``CLICKBOT_APP_BUCKETS`` tests (12) on the run itself, by how many menus each
  one has, never from a table of times; the crons into ``CLICKBOT_CRON_BUCKETS``
  (8). A project tunes it with ``CLICKBOT_USERS``, ``CLICKBOT_SKIP_APPS``,
  ``CLICKBOT_SKIP_MENUS``, ``CLICKBOT_SKIP_CRONS``, ``CLICKBOT_SETUP``
  (``package.module:function`` hooks called with ``env``), ``CLICKBOT_TIMEOUT``,
  ``CLICKBOT_CRON_TIMEOUT`` and ``CLICKBOT_CURSOR_LOCK_TIMEOUT`` (120 s, Odoo's 20 s
  is too short on a loaded runner). The verdict is pytest's exit code and the JUnit
  report, written to ``CLICKBOT_DIR`` with ``odoo.log``; a skipped test turns it
  red. Odoo 19.0 or later. It replaces the ``.gitlab/clickbot.sh`` and the
  ``click_all`` test files each project carried.
* staggered_install --isolated --parallel N (``STAGGERED_PARALLEL``): runs the
  whole plan in one job, N installs at a time off one queue, instead of a share
  of a ``parallel:`` job fixed beforehand by ``staggered_costs.json``. The work
  is done by ``odoo-bin-server-staggered`` (vauxoo/odoo-staggered) inside the
  instance container, the same command a developer runs locally, installed from
  the wheel quay.io/vauxoo/dockerv carries in ``ODOO_STAGGERED_WHEEL_DIR``. vxci
  passes it the modules, ``ODOO_TEST_TAGS``, the language, coverage around each
  module install, ``STAGGERED_KEEP_DB`` and ``--allow_deprecated``, and collects
  the saved log, the log of every install and the coverage as before. Measured
  on vauxoo/ircodoo: 2868 s in one job, against 3150 s to 3364 s for the slowest
  of five nodes.
* build_image: with ``ORCHESTSH=True``, the image is looked up by the name the
  orchestsh CLI gave it (the ``image_name.env`` it writes). A main branch whose
  name is not ``VERSION`` (e.g. ``20.0`` building ``saas-19.4``) can now set
  ``MAIN_BRANCH`` to push the ``<MAIN_APP>-<VERSION>-latest`` tag instead of
  failing with "Unable to find the recently built image", with the orchestsh CLI
  before and after orchestsh/executor!366.
* test_repo/test_image: with ``ORCHESTSH=True``, ``instance_image`` is
  ``IMAGE_REPO:IMAGE_TAG`` when both are set (the ``image_name.env`` sourced
  from the build job), and is computed only as a fallback.
* common: new optional ``ORCHESTSH_REGISTRY`` and ``ORCHESTSH_TOKEN`` environment
  variables. When the registry is set, the image notification sent to
  ``ORCHEST_REGISTRY`` after a push is also sent to OrchestSh, so both systems can
  run side by side while projects migrate. A failed OrchestSh notification is
  logged and does not fail the job.
* staggered_install: new command that installs the modules of a repository one
  at a time on a single database, dependencies first and the main app last,
  running each module's own tests as it is installed. A module that fails does
  not stop the rest. Every install runs under ``coverage run -p`` and the run
  combines them into ``.coverage_<job name>``. No run asks for demo data.
* staggered_install --isolated: installs each module alone on a clone of a
  template database holding exactly the closure of what it declares, so a
  module using another one it never declared fails instead of passing on what
  an earlier module brought in. Splits itself across the nodes of a GitLab
  ``parallel:`` job (``CI_NODE_INDEX``/``CI_NODE_TOTAL``), balanced with the
  per-module seconds of ``staggered_costs.json`` when the repository commits
  it. ``STAGGERED_KEEP_DB`` keeps the main app's database. Demo data that Odoo
  failed to load ends the run red.

* coverage: new ``COVERAGE_EXCLUDE_LINES`` environment variable to append
  regexes to the ``exclude_lines`` section of the generated ``.coveragerc``.
  A repository can now skip a whole family of lines from its ``variables.sh``
  instead of spreading ``# pragma: no cover`` comments over the source. Use
  ``\n`` to separate several regexes, since ``variables.sh`` only accepts
  single-line exports.

* tools_test: fall back to Chrome for Testing when a pinned Chrome version is
  no longer published in the Google apt pool, which purges old builds. Keeps
  the older Chrome that Odoo's legacy ``--headless`` tour driver needs
  installable, so browser tours stop being silently skipped with "Chrome
  executable not found".

0.1.0 (2017-03-03)
-----------------------------------------

* First release on PyPI.
