From 384ded827c9eed67f28fbb6032d7b3e42f1fc8be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Sat, 21 Mar 2020 15:00:04 +0100 Subject: [PATCH] remove coverall support Also, install codecov only when needed to avoid having uneeded and possibly conflicting dependencies during tests --- .travis.yml | 4 ++-- README.md | 16 ++++++++-------- requirements.txt | 1 - sample_files/.gitlab-ci-2.yml | 2 +- travis/travis_after_tests_success | 28 +++++++--------------------- travis/travis_install_nightly | 9 +++++---- 6 files changed, 23 insertions(+), 37 deletions(-) diff --git a/.travis.yml b/.travis.yml index d7d1fe779..a419150dc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -69,7 +69,7 @@ install: - cp -r tests/test_repo/* ./ - export PATH=$HOME/maintainer-quality-tools/travis:$PATH # Force install lint requirements in all cases of MQT for self_test script. - - pip install codecov==2.0.15 coveralls==1.8.2 + - pip install coverage - LINT_CHECK="1" travis_install_nightly 8.0 # only used if VERSION not set in env - git --git-dir=${TRAVIS_BUILD_DIR}/.git add --all # All modules moved are modules changed to test PR changes @@ -81,4 +81,4 @@ after_success: # Seudo-fix for codecov that is not processing "data_file" parameter # More info about: https://github.com/codecov/codecov-python/issues/120 - cp ./.coverage_mqt ./.coverage - - TESTS="1" LINT_CHECK="0" travis_after_tests_success + - TESTS="1" TEST_ENABLE="1" LINT_CHECK="0" travis_after_tests_success diff --git a/README.md b/README.md index eb3ce6f88..e0f875979 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ [![Build Status](https://travis-ci.org/OCA/maintainer-quality-tools.svg)](https://travis-ci.org/OCA/maintainer-quality-tools) -[![Coverage Status](https://coveralls.io/repos/OCA/maintainer-quality-tools/badge.svg)](https://coveralls.io/r/OCA/maintainer-quality-tools) +[![codecov](https://codecov.io/gh/OCA/maintainer-quality-tools/branch/master/graph/badge.svg)](https://codecov.io/gh/OCA/maintainer-quality-tools) QA Tools for Odoo maintainers (MQT) =================================== @@ -64,12 +64,12 @@ similar to this one: - VERSION="8.0" UNIT_TEST="1" -Coveralls/Codecov configuration file ------------------------------------- +Codecov configuration file +-------------------------- -[Coveralls](https://coveralls.io/) and [Codecov](https://codecov.io/) services provide information on the test coverage of your modules. -Currently both configurations are automatic (check default configuration [here](cfg/.coveragerc)). -So, as of today, you don't need to include a `.coveragerc` into the repository, +[Codecov](https://codecov.io/) provides information on the test coverage of your modules. +The configurations is automatic (check default configuration [here](cfg/.coveragerc)). +So you don't need to include a `.coveragerc` into the repository, If you do it, it will be simply ignored. **NOTE:** the current configuration automatically ignores `*_example` modules @@ -80,7 +80,7 @@ Names used for the test databases --------------------------------- MQT has a nice feature of organizing your testing databases. -You might want to do that if you want to double them up as +You might want to do that if you want to double them up as staging DBs or if you want to work with an advanced set of templates in order to speed up your CI pipeline. Just specify at will: @@ -110,5 +110,5 @@ Disable test If you want to make a build without tests, you can use the following directive: `TEST_ENABLE="0"` -You will simply get the databases with packages installed, +You will simply get the databases with packages installed, but whithout running any tests. diff --git a/requirements.txt b/requirements.txt index 64ca81e41..fd7b40022 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,7 +3,6 @@ pyserial pyopenssl>=16.2.0 pyyaml==3.12 ; python_version < '3.7' pyyaml==3.13 ; python_version >= '3.7' -coveralls websocket-client unittest2 six diff --git a/sample_files/.gitlab-ci-2.yml b/sample_files/.gitlab-ci-2.yml index c12b2419f..72c6cd505 100644 --- a/sample_files/.gitlab-ci-2.yml +++ b/sample_files/.gitlab-ci-2.yml @@ -22,7 +22,7 @@ variables: before_script: - curl -sL https://deb.nodesource.com/setup_10.x | bash - - apt-get install -y sudo postgresql-client expect-dev python-lxml nodejs python-dev python-pip build-essential libsasl2-dev python-dev libldap2-dev libssl-dev - - pip install codecov==2.0.15 coveralls==1.8.2 coverage + - pip install coverage lint: stage: test diff --git a/travis/travis_after_tests_success b/travis/travis_after_tests_success index ad1eebb42..0fbac73ac 100755 --- a/travis/travis_after_tests_success +++ b/travis/travis_after_tests_success @@ -1,21 +1,7 @@ -#!/usr/bin/env python - -import os - -from coverage.cmdline import main as coverage_main -from coveralls import cli as coveralls_cli -from codecov import main as codecov_main - - -if (os.environ.get('TESTS', '1') == '1' and - os.environ.get('TEST_ENABLE', '1') == '1' and - not os.environ.get('LINT_CHECK') == '1'): - coverage_main(["report", "--show-missing"]) - try: - coveralls_cli.main(argv=None) - except: - pass - try: - codecov_main(argv=None) - except: - pass +#!/bin/bash +set -e +if [[ "${TESTS:-1}" == "1" ]] && [[ "${TEST_ENABLE:-1}" == "1" ]] && [[ "${LINT_CHECK}" != "1" ]]; then + coverage report --show-missing + pip install codecov + codecov +fi diff --git a/travis/travis_install_nightly b/travis/travis_install_nightly index 5485d2cc8..023f0ac76 100755 --- a/travis/travis_install_nightly +++ b/travis/travis_install_nightly @@ -108,10 +108,7 @@ sed -i '/^python-ldap\=\=/d' ${ODOO_PATH}/requirements.txt sed -i 's/^requests\=\=/requests[security]\=\=/g' ${ODOO_PATH}/requirements.txt pip install -q --no-binary pycparser -r ${ODOO_PATH}/requirements.txt -pip install -q QUnitSuite codecov==2.0.15 coveralls==1.8.2 - -# Use reference .coveragerc -cp ${HOME}/maintainer-quality-tools/cfg/.coveragerc . +pip install -q QUnitSuite MQT_DEP=${MQT_DEP:-OCA} if [[ "${MQT_DEP}" == "OCA" ]] ; then @@ -129,6 +126,10 @@ else --extra-index-url https://wheelhouse.odoo-community.org/oca-simple/ fi +# Use reference .coveragerc +cp ${HOME}/maintainer-quality-tools/cfg/.coveragerc . +pip install coverage + if [[ "${WKHTMLTOPDF_VERSION}" == "" && $(which wkhtmltopdf) != "" ]]; then echo "You have installed wkhtmltopdf but is not patched (probably) then we will overwrite it" export WKHTMLTOPDF_VERSION="0.12.4"