Skip to content

Commit

Permalink
[DCK][CI] Add coverage and speed
Browse files Browse the repository at this point in the history
After building, boot all services that odoo will need to avoid hitting docker/compose#4688 on parallel jobs.

Add `--no-deps` to linters.

Add coverage report.
  • Loading branch information
yajo committed Sep 27, 2017
1 parent 27f043e commit ea76a4e
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions .gitlab-ci.yml
Expand Up @@ -15,6 +15,7 @@ Pull and build images on private addons:
- docker-compose down -v --remove-orphans
- docker-compose build --pull
- docker-compose pull
- docker-compose run --rm odoo --version

# Lint
Pylint for main branches on private addons:
Expand All @@ -24,10 +25,10 @@ Pylint for main branches on private addons:
- PRIVATE_ADDONS="$(ls -1 odoo/custom/src/private | tr -s '\n' ,)"
- test -n "$PRIVATE_ADDONS" || echo No private addons found
- test -z "$PRIVATE_ADDONS" ||
docker-compose run --rm --user root --name "$CONTAINER_NAME"
docker-compose run --rm --no-deps --name "$CONTAINER_NAME"
-e LOG_LEVEL=WARNING odoo bash -c "
git clone --depth 1 $MQT_REPO $MQT_PATH &&
pip install -q --no-cache pylint-odoo &&
pip install --user -q pylint-odoo &&
pylint --load-plugins pylint_odoo -d C8101
--rcfile $MQT_PATH/travis/cfg/$CFG
custom/src/private/*"
Expand All @@ -49,10 +50,10 @@ Pylint beta on private addons:

Flake8 on private addons:
script:
- docker-compose run --rm --user root --name "$CONTAINER_NAME"
- docker-compose run --rm --no-deps --user root --name "$CONTAINER_NAME"
-e LOG_LEVEL=WARNING odoo bash -c "
git clone --depth 1 $MQT_REPO $MQT_PATH &&
pip install -q --no-cache flake8 &&
pip install -q flake8 &&
cd custom/src/private &&
$MQT_PATH/travis/test_flake8"

Expand All @@ -62,9 +63,17 @@ Install and test private addons:
- PRIVATE_ADDONS="$(ls -1 odoo/custom/src/private | tr -s '\n' ,)"
- test -n "$PRIVATE_ADDONS" || echo No private addons found
- test -z "$PRIVATE_ADDONS" ||
docker-compose run --rm odoo --stop-after-init -i $PRIVATE_ADDONS
- test -z "$PRIVATE_ADDONS" ||
docker-compose run --rm odoo unittest $PRIVATE_ADDONS
docker-compose run --rm -w /home/odoo
odoo bash -c "
odoo --stop-after-init -i $PRIVATE_ADDONS &&
pip install --user -q coverage &&
coverage run
--source /opt/odoo/custom/src/private/
--omit '*/__openerp__.py,*/__manifest__.py'
\$(realpath \$(which odoo)) --stop-after-init --test-enable
-u $PRIVATE_ADDONS &&
coverage report --skip-covered"
coverage: /TOTAL.* (\d+)%/

# Runbot
Boot runbot:
Expand Down

0 comments on commit ea76a4e

Please sign in to comment.