Giter VIP home page Giter VIP logo

oca-ci's Introduction

Container image to run OCA CI tests

⚠️ These images are meant for running CI tests of the Odoo Community Association. They are not intended for any other purpose, and in particular they are not fit for running Odoo in production. If you decide to base your own CI on these images, be aware that, while we will not break things without reason, we will prioritize ease of maintenance for OCA over backward compatibility. ⚠️

These images provide the following guarantees:

  • Odoo runtime dependencies are installed (wkhtmltopdf, lessc, etc).
  • Odoo source code is in /opt/odoo.
  • Odoo is installed in editable mode in a virtualenv isolated from system python packages.
  • The Odoo configuration file exists at $ODOO_RC.
  • The python, pip and odoo (openerp-server for Odoo < 10) commands found first in PATH are from that virtualenv.
  • coverage is installed in that virtualenv.
  • Prerequisites for running Odoo tests are installed in that virtualenv (this notably includes websocket-client and the chrome browser for running browser tests).

Environment variables:

  • ODOO_VERSION (8.0, ..., 14.0, ...)
  • ODOO_RC
  • OPENERP_SERVER=$ODOO_RC
  • PGHOST=postgres
  • PGUSER=odoo
  • PGPASSWORD=odoo
  • PGDATABASE=odoo
  • PIP_INDEX_URL=https://wheelhouse.odoo-community.org/oca-simple-and-pypi
  • PIP_DISABLE_PIP_VERSION_CHECK=1
  • PIP_NO_PYTHON_VERSION_WARNING=1
  • ADDONS_DIR=.
  • ADDONS_PATH=/opt/odoo/addons
  • INCLUDE=
  • EXCLUDE=
  • OCA_GIT_USER_NAME=oca-ci: git user name to commit .pot files
  • [email protected]: git user email to commit .pot files

Available commands:

  • oca_install_addons: make addons to test (found in $ADDONS_DIR, modulo $INCLUDE an $EXCLUDE) and their dependencies available in the Odoo addons path. Append addons_path=${ADDONS_PATH},${ADDONS_DIR} to $ODOO_RC.
  • oca_init_test_database: create a test database named $PGDATABASE with direct dependencies of addons to test installed in it
  • oca_run_tests: run tests of addons on $PGDATABASE, with coverage.
  • oca_export_and_commit_pot: export .pot files for all addons in $ADDONS_DIR that are installed in $PGDATABASE; git commit changes if any, using $OCA_GIT_USER_NAME and $OCA_GIT_USER_EMAIL.
  • oca_git_push_if_remote_did_not_change: push local commits unless the remote tracked branch has evolved.
  • oca_export_and_push_pot combines the two previous commands.

Build

Build args:

  • python_version (no default)
  • odoo_version (no default)
  • codename (default: focal)
  • odoo_org_repo (default: odoo/odoo)

Tests

Tests are written using pytest in the tests directory.

You can run them using the runtests.sh script inside the container, like this:

docker run -v $PWD/tests:/mnt/tests ghcr.io/oca/oca-ci/py3.8-odoo14.0:latest /mnt/tests/runtests.sh -v

oca-ci's People

Contributors

sbidoul avatar etobella avatar carmenbianca avatar antoniromera avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.