diff --git a/.coveragerc b/.coveragerc index 14a1acac..5d00ff08 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,6 +1,8 @@ [run] +data_file = .coverage2 omit = + setup.py /usr/* tests/* @@ -8,3 +10,6 @@ omit = exclude_lines = pragma: no cover no cover: 2.x + +[html] +directory = htmlcov/py2 diff --git a/.coveragerc3 b/.coveragerc3 index 7d4bec13..e7f85d37 100644 --- a/.coveragerc3 +++ b/.coveragerc3 @@ -1,8 +1,10 @@ [run] +data_file = .coverage3 ; extra omissions for py3 for now omit = + setup.py /usr/* tests/* @@ -11,3 +13,6 @@ exclude_lines = pragma: no cover no cover 3.x if six.PY2 + +[html] +directory = htmlcov/py3 diff --git a/.gitignore b/.gitignore index dbcbef60..59b5da0f 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ util/koji-shadowc # # coverage artifacts .coverage +.coverage[23] htmlcov/ *,cover # diff --git a/Makefile b/Makefile index 83787694..4cfac743 100644 --- a/Makefile +++ b/Makefile @@ -61,29 +61,39 @@ _default: clean: rm -f *.o *.so *.pyc *~ koji*.bz2 koji*.src.rpm + rm -rf __pycache__ + rm -rf devtools/fakehubc devtools/fakewebc devtools/__pycache__ rm -rf koji-$(VERSION) for d in $(SUBDIRS); do make -s -C $$d clean; done - coverage erase ||: + find ./tests -name "__pycache__" -exec rm -rf {} \; ||: + find ./tests -name "*.pyc" -exec rm -f {} \; + rm -rf docs/source/__pycache__ docs/source/*.pyc + coverage2 erase ||: + coverage3 erase --rcfile .coveragerc3 ||: + rm -rf htmlcov git-clean: @git clean -d -q -x -test: +test: test2 test3 + @echo "All tests are finished for python 2&3" + +test2: coverage2 erase PYTHONPATH=hub/.:plugins/hub/.:plugins/builder/.:plugins/cli/.:cli/.:www/lib coverage2 run \ --source . /usr/bin/nosetests coverage2 report coverage2 html - @echo Full coverage report at file://$(CURDIR)/htmlcov/index.html + @echo Full coverage report at file://${CURDIR}/htmlcov/py2/index.html test3: - coverage3 erase + coverage3 erase --rcfile .coveragerc3 PYTHONPATH=hub/.:plugins/hub/.:plugins/builder/.:plugins/cli/.:cli/.:www/lib coverage3 run \ --rcfile .coveragerc3 --source . \ /usr/bin/nosetests-3 - coverage3 report --rcfile .coveragerc3 - coverage3 html --rcfile .coveragerc3 - @echo Full coverage report at file://$(CURDIR)/htmlcov/index.html + coverage report --rcfile .coveragerc3 + coverage html --rcfile .coveragerc3 + @echo Full coverage report at file://${CURDIR}/htmlcov/py3/index.html test-tarball: @rm -rf .koji-$(VERSION) diff --git a/builder/Makefile b/builder/Makefile index da56c47f..9d16298f 100644 --- a/builder/Makefile +++ b/builder/Makefile @@ -8,6 +8,7 @@ _default: clean: rm -f *.o *.so *.pyc *~ kojidc + rm -rf __pycache__ _install: diff --git a/cli/Makefile b/cli/Makefile index 605c9eac..d5cca841 100644 --- a/cli/Makefile +++ b/cli/Makefile @@ -13,6 +13,8 @@ _default: clean: rm -f *.o *.so *.pyc *~ kojic + rm -rf __pycache__ + for d in $(SUBDIRS); do make -s -C $$d clean; done install: @if [ "$(DESTDIR)" = "" ]; then \ diff --git a/cli/koji_cli/Makefile b/cli/koji_cli/Makefile index baf78d37..c7c460a9 100644 --- a/cli/koji_cli/Makefile +++ b/cli/koji_cli/Makefile @@ -11,6 +11,7 @@ _default: clean: rm -f *.o *.so *.pyc *~ + rm -rf __pycache__ install: @if [ "$(DESTDIR)" = "" ]; then \ diff --git a/hub/Makefile b/hub/Makefile index 59e0f9f6..e8fe6517 100644 --- a/hub/Makefile +++ b/hub/Makefile @@ -13,6 +13,7 @@ _default: clean: rm -f *.o *.so *.pyc *~ + rm -rf __pycache__ install: @if [ "$(DESTDIR)" = "" ]; then \ diff --git a/koji/Makefile b/koji/Makefile index 7a3925a7..df2991c7 100644 --- a/koji/Makefile +++ b/koji/Makefile @@ -12,7 +12,7 @@ _default: clean: rm -f *.o *.so *.pyc *~ - for d in $(SUBDIRS); do make -s -C $$d clean; done + rm -rf __pycache__ install: mkdir -p $(DESTDIR)/$(PKGDIR) diff --git a/plugins/Makefile b/plugins/Makefile index 500d944f..690e5c36 100644 --- a/plugins/Makefile +++ b/plugins/Makefile @@ -21,7 +21,8 @@ _default: @echo "nothing to make. try make install" clean: - rm -f *.o *.so *.pyc *.pyo *~ + find . -name "__pycache__" -exec rm -rf {} \; ||: + find . -name "*.pyc" -exec rm -f {} \; install: @if [ "$(DESTDIR)" = "" ]; then \ diff --git a/util/Makefile b/util/Makefile index 3310b513..bcaddc90 100644 --- a/util/Makefile +++ b/util/Makefile @@ -7,6 +7,7 @@ _default: clean: rm -f *.o *.so *.pyc *~ + rm -rf __pycache__ for b in $(BINFILES); do rm -f $${b}c; done _install: diff --git a/www/kojiweb/Makefile b/www/kojiweb/Makefile index 4feda333..214a88a5 100644 --- a/www/kojiweb/Makefile +++ b/www/kojiweb/Makefile @@ -8,6 +8,7 @@ _default: clean: rm -f *.o *.so *.pyc *~ + rm -rf __pycache__ for d in $(SUBDIRS); do make -s -C $$d clean; done install: diff --git a/www/lib/kojiweb/Makefile b/www/lib/kojiweb/Makefile index 84e8b033..e23fb4db 100644 --- a/www/lib/kojiweb/Makefile +++ b/www/lib/kojiweb/Makefile @@ -13,6 +13,7 @@ _default: clean: rm -f *.o *.so *.pyc *~ + rm -rf __pycache__ for d in $(SUBDIRS); do make -s -C $$d clean; done install: