[ADD] coveragerc, travis.yml
authorHolger Brunn <hbrunn@therp.nl>
Mon, 21 Jul 2014 09:53:31 +0000 (11:53 +0200)
committerHolger Brunn <hbrunn@therp.nl>
Mon, 21 Jul 2014 09:53:31 +0000 (11:53 +0200)
.coveragerc [new file with mode: 0644]
.travis.yml [new file with mode: 0644]

diff --git a/.coveragerc b/.coveragerc
new file mode 100644 (file)
index 0000000..708cb0f
--- /dev/null
@@ -0,0 +1,19 @@
+# Config file .coveragerc
+# adapt the include for your project
+
+[report]
+include =
+    */OCA/OCB/addons/*
+    */OCA/OCB/openerp/addons/*
+
+omit =
+    */tests/*
+    *__init__.py
+
+# Regexes for lines to exclude from consideration
+exclude_lines =
+    # Have to re-enable the standard pragma
+    pragma: no cover
+
+    # Don't complain about null context checking
+    if context is None:
diff --git a/.travis.yml b/.travis.yml
new file mode 100644 (file)
index 0000000..b326bdd
--- /dev/null
@@ -0,0 +1,27 @@
+language: python
+
+python:
+  - "2.7"
+
+env:
+  - VERSION="7.0"
+  - DATABASE="openerp_test"
+
+virtualenv:
+  system_site_packages: true
+
+install:
+  - git clone https://github.com/OCA/maintainer-quality-tools.git ${HOME}/maintainer-quality-tools
+  - sudo apt-get install python-lxml
+  - pip install QUnitSuite flake8 coveralls
+  - pip install -r ${HOME}/maintainer-quality-tools/travis/requirements.txt
+
+script:
+  - travis_run_flake8
+  - createdb ${DATABASE}
+  - ./openerp-server -d ${DATABASE} --addons-path=./openerp/addons,./addons --stop-after-init --init=all
+  - coverage run "./openerp-server -d ${DATABASE} --addons-path=./openerp/addons,./addons --stop-after-init --init=all --test-enable --log-level=test" | tee stdout.log
+  - ! grep -v mail stdout.log | egrep -q "(At least one test failed when loading the modules.|ERROR ${DATABASE})"
+
+after_success:
+  coveralls