BEWARE!, this project is in beta stage. Things are changing quickly.
Tools for checking that your Doodba-based project is cool.
Because OCA's maintainer quality tools are too addons-repo-focused.
We needed a too Doodba-focused version instead. 😆
- Mount your project structure, usually based on the provided scaffolding, on
/project
in the container. Docker CLI example:-v $(pwd):/project
. - Give him access to a Docker socket (beware of the security implications!) with
--privileged -v /var/run/docker.sock
or with-e DOCKER_HOST=tcp://dockerhost:2375
. - Configure through environment variables.
- Run any of the bundled scripts.
Example command for test environment, good for CI:
docker container run --rm -it --privileged -e COMPOSE_FILE=test.yaml -v "$PWD:/project:z" -v /var/run/docker.sock:/var/run/docker.sock:z tecnativa/doodba-qa pylint
Example command for devel environment, linting only private addons:
docker container run --rm -it --privileged -v "$PWD:$PWD:z" -v /var/run/docker.sock:/var/run/docker.sock:z -w "$PWD" -e ADDON_CATEGORIES=-p tecnativa/doodba-qa pylint
You most likely want to run this into a CI environment, so just check out the examples
directory and you'll get a hint on how to do it.
You can use any of the upstream Docker Compose environment variables.
Besides, you have these too:
Defaults to --private
for all jobs.
You can change it per job, using any of --private --extra --core
(or -pec
).
These flags are used for the addons
script available in all Doodba projects. Use this command in your project's folder to understand its usage:
docker-compose run --rm odoo addons --help
Defaults to admin
. If set, is used as the DB manager password.
Directory where all the artifacts produced by insider scripts will be extracted.
UID/GID to be set as owner for artifacts produced by insider scripts.
Flags to append to docker-compose build
. Defaults to --pull --no-cache
.
Flags to append to docker-compose down
. Defaults to -v --rmi local --remove-orphans
.
Disables specific linter messages. Its format depends on the underlying linter.
Defaults to manifest-required-author
, since it's expected that you will only want to lint private addons, and those are not OCA's.
TODO: Make it work with flake8.
Enables specific linter messages. Its format depends on the underlying linter.
Empty by default.
TODO: Make it work with flake8.
Right now, only useful for pylint
. Valid values:
loose
(default) uses MQT standard cfg.strict
uses pull request cfg.beta
uses beta cfg.
Used in secrets-setup
when you need a specific DB password.
Defaults to odoopassword
.
By default it is ""
(disabled) to allow assert
statements, which can be OK for tests, although not for production or demos.
More details in Python documentation.
Path for the repos.yaml
file in current scaffolding (not inside the container).
You can use sh
, docker
and docker-compose
commands with all of their features.
Besides, there are other scripts bundled, useful to do a CI pipeline:
Install requested addons.
Build your project with docker-compose
and check odoo works.
Uses BUILD_FLAGS
.
Know if your repos.yaml
definition includes merged or closed pull requests.
Uses the REPOS_FILE
and GITHUB_TOKEN
environment variables.
Run addons' unit tests and report coverage.
Usually you should run addons-install
before.
You will find the HTML report files in ./$ARTIFACTS_DIR/coverage
.
Destroy all containers, volumes, local images and networks.
Uses DESTROY_FLAGS
.
Lint code with flake8 using MQT.
Create missing external networks, which are not autocreated by docker compose because it expects them to be present at the time of booting an environment.
Common examples of such networks are inverseproxy_shared
or globalwhitelist_shared
.
It extracts the required networks from the chosen docker-compose.yaml
file.
Lint code with pylint-odoo using MQT.
Some environment variables modify this script's behavior; check them out.
Creates all needed environment files for the official test.yaml
environment to work.
Uses ADMIN_PASSWORD
and PGPASSWORD
.
Like destroy
, but keeping volumes and images.
These tools are not strictly related to Doodba, but they are helpful and are included: