From c959f9dcf9f4bc0c3dfeb4e68c082c79d479de35 Mon Sep 17 00:00:00 2001 From: Tim Bielawa Date: Fri, 26 Aug 2016 08:53:45 -0700 Subject: Fix PyLint errors discovered when upgrading to newer version * Fixes PyLint to run in the virtualenv used for all tests * Replaced 'LooseVersion' with 'parse_version' from setuptools - This is a work around for the issue in https://github.com/PyCQA/pylint/issues/73 in which pylint can not import disutils.version correctly in a virtualenv. * Removed the unused function 'delete_hosts' which was causing a pylint error as well * Removed a deprecated pylint pragma option, 'bad-builtin' * Fixed some import ordering issues it was picky about * Added another disable for a case where the PyLint suggestion would have us altering the container we would be iterating over * Add code-coverage reports to the unittests with the MINIMUM coverage percentage for success set to 70% - Current test coverage is at 76% --- utils/Makefile | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'utils/Makefile') diff --git a/utils/Makefile b/utils/Makefile index dd0b5cdd0..7676354b0 100644 --- a/utils/Makefile +++ b/utils/Makefile @@ -35,13 +35,17 @@ clean: @rm -fR build dist rpm-build MANIFEST htmlcov .coverage cover ooinstall.egg-info oo-install @rm -fR $(NAME)env +viewcover: + xdg-open cover/index.html + virtualenv: @echo "#############################################" @echo "# Creating a virtualenv" @echo "#############################################" virtualenv $(NAME)env . $(NAME)env/bin/activate && pip install -r requirements.txt - . $(NAME)env/bin/activate && pip install pep8 nose coverage mock flake8 PyYAML click + . $(NAME)env/bin/activate && pip install setuptools --upgrade + . $(NAME)env/bin/activate && pip install enum configparser pylint pep8 nose coverage mock flake8 PyYAML click # If there are any special things to install do it here # . $(NAME)env/bin/activate && INSTALL STUFF @@ -50,14 +54,14 @@ ci-unittests: @echo "#############################################" @echo "# Running Unit Tests in virtualenv" @echo "#############################################" -# . $(NAME)env/bin/activate && nosetests -v --with-cover --cover-html --cover-min-percentage=80 --cover-package=$(TESTPACKAGE) test/ - . $(NAME)env/bin/activate && nosetests -v test/ + . $(NAME)env/bin/activate && nosetests -v --with-coverage --cover-html --cover-min-percentage=70 --cover-package=$(SHORTNAME) test/ + @echo "VIEW CODE COVERAGE REPORT WITH 'xdg-open cover/index.html' or run 'make viewcover'" ci-pylint: @echo "#############################################" @echo "# Running PyLint Tests in virtualenv" @echo "#############################################" - python -m pylint --rcfile ../git/.pylintrc src/ooinstall/cli_installer.py src/ooinstall/oo_config.py src/ooinstall/openshift_ansible.py src/ooinstall/variants.py + . $(NAME)env/bin/activate && python -m pylint --rcfile ../git/.pylintrc src/ooinstall/cli_installer.py src/ooinstall/oo_config.py src/ooinstall/openshift_ansible.py src/ooinstall/variants.py ci-list-deps: @echo "#############################################" -- cgit v1.2.3 From 615b42f66da4f0e3e6a3516a0d859a7842db5ec4 Mon Sep 17 00:00:00 2001 From: Tim Bielawa Date: Fri, 26 Aug 2016 10:23:07 -0700 Subject: Add missing pip requirement to virtualenv --- utils/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'utils/Makefile') diff --git a/utils/Makefile b/utils/Makefile index 7676354b0..ef2928b52 100644 --- a/utils/Makefile +++ b/utils/Makefile @@ -45,7 +45,7 @@ virtualenv: virtualenv $(NAME)env . $(NAME)env/bin/activate && pip install -r requirements.txt . $(NAME)env/bin/activate && pip install setuptools --upgrade - . $(NAME)env/bin/activate && pip install enum configparser pylint pep8 nose coverage mock flake8 PyYAML click + . $(NAME)env/bin/activate && pip install enum configparser pylint pep8 nose coverage mock flake8 PyYAML click backports.functools_lru_cache # If there are any special things to install do it here # . $(NAME)env/bin/activate && INSTALL STUFF -- cgit v1.2.3 From 8bbb62c30ce141e4ffef29364a1c61941317835a Mon Sep 17 00:00:00 2001 From: Tim Bielawa Date: Fri, 26 Aug 2016 12:13:56 -0700 Subject: Switch to using a requirements.txt file and ensure that setuptools is pinned to the latest version available on RHEL7 --- utils/Makefile | 3 --- 1 file changed, 3 deletions(-) (limited to 'utils/Makefile') diff --git a/utils/Makefile b/utils/Makefile index ef2928b52..99787c7c6 100644 --- a/utils/Makefile +++ b/utils/Makefile @@ -44,9 +44,6 @@ virtualenv: @echo "#############################################" virtualenv $(NAME)env . $(NAME)env/bin/activate && pip install -r requirements.txt - . $(NAME)env/bin/activate && pip install setuptools --upgrade - . $(NAME)env/bin/activate && pip install enum configparser pylint pep8 nose coverage mock flake8 PyYAML click backports.functools_lru_cache - # If there are any special things to install do it here # . $(NAME)env/bin/activate && INSTALL STUFF -- cgit v1.2.3 From 635dbc0040b691ac3f2d8cec3296ddf58cfd3072 Mon Sep 17 00:00:00 2001 From: Tim Bielawa Date: Fri, 26 Aug 2016 12:25:22 -0700 Subject: Try installing setuptools before the rest of the requirements --- utils/Makefile | 1 + 1 file changed, 1 insertion(+) (limited to 'utils/Makefile') diff --git a/utils/Makefile b/utils/Makefile index 99787c7c6..f80d3c7ad 100644 --- a/utils/Makefile +++ b/utils/Makefile @@ -43,6 +43,7 @@ virtualenv: @echo "# Creating a virtualenv" @echo "#############################################" virtualenv $(NAME)env + . $(NAME)env/bin/activate && pip install setuptools==17.1.1 . $(NAME)env/bin/activate && pip install -r requirements.txt # If there are any special things to install do it here # . $(NAME)env/bin/activate && INSTALL STUFF -- cgit v1.2.3 From 54a494e0948c270a66b63dc9420d38bb5b68ff54 Mon Sep 17 00:00:00 2001 From: Tim Bielawa Date: Mon, 29 Aug 2016 10:26:08 -0700 Subject: Change test requirements file name --- utils/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'utils/Makefile') diff --git a/utils/Makefile b/utils/Makefile index f80d3c7ad..79c27626a 100644 --- a/utils/Makefile +++ b/utils/Makefile @@ -43,8 +43,8 @@ virtualenv: @echo "# Creating a virtualenv" @echo "#############################################" virtualenv $(NAME)env - . $(NAME)env/bin/activate && pip install setuptools==17.1.1 - . $(NAME)env/bin/activate && pip install -r requirements.txt + . $(NAME)env/bin/activate && pip install setuptools==17.1.1 + . $(NAME)env/bin/activate && pip install -r test-requirements.txt # If there are any special things to install do it here # . $(NAME)env/bin/activate && INSTALL STUFF -- cgit v1.2.3