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. 😆
/project in the container. Docker CLI example: -v $(pwd):/project.--privileged -v /var/run/docker.sock or with -e DOCKER_HOST=tcp://dockerhost:2375.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:
ADDON_CATEGORIESDefaults 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
ADMIN_PASSWORDDefaults to admin. If set, is used as the DB manager password.
ARTIFACTS_DIRDirectory where all the artifacts produced by insider scripts will be extracted.
ARTIFACTS_UID and ARTIFACTS_GIDUID/GID to be set as owner for artifacts produced by insider scripts.
BUILD_FLAGSFlags to append to docker-compose build. Defaults to --pull --no-cache.
DESTROY_FLAGSFlags to append to docker-compose down. Defaults to -v --rmi local --remove-orphans.
LINT_DISABLEDisables 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.
LINT_ENABLEEnables specific linter messages. Its format depends on the underlying linter.
Empty by default.
TODO: Make it work with flake8.
LINT_MODERight now, only useful for pylint. Valid values:
loose (default) uses MQT standard cfg.strict uses pull request cfg.beta uses beta cfg.PGPASSWORDUsed in secrets-setup when you need a specific DB password.
Defaults to odoopassword.
PYTHONOPTIMIZEBy 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.
REPOS_FILEPath 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:
addons-installInstall requested addons.
buildBuild your project with docker-compose and check odoo works.
Uses BUILD_FLAGS.
closed-prsKnow if your repos.yaml definition includes merged or closed pull requests.
Uses the REPOS_FILE and GITHUB_TOKEN environment variables.
coverageRun addons' unit tests and report coverage.
Usually you should run addons-install before.
You will find the HTML report files in ./$ARTIFACTS_DIR/coverage.
destroyDestroy all containers, volumes, local images and networks.
Uses DESTROY_FLAGS.
flake8Lint code with flake8 using MQT.
networks-autocreateCreate 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.
pylintLint code with pylint-odoo using MQT.
Some environment variables modify this script's behavior; check them out.
secrets-setupCreates all needed environment files for the official test.yaml environment to work.
Uses ADMIN_PASSWORD and PGPASSWORD.
shutdownLike destroy, but keeping volumes and images.
These tools are not strictly related to Doodba, but they are helpful and are included:
Content type
Image
Digest
Size
282 MB
Last updated
over 5 years ago
docker pull tecnativa/doodba-qa