summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorBruno Wagner <bwagner@riseup.net>2017-01-03 16:31:00 -0200
committerBruno Wagner <bwagner@riseup.net>2017-01-03 16:31:00 -0200
commitcb21017d3affd6ff51c47de36913311206c865df (patch)
tree8feed308d2ce202a7e78c0ed1aa07894574e4704 /Makefile
parent9da37a371bd4f7b14b28036ddb528c33bad1ad18 (diff)
Added coverage to the Makefile
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile21
1 files changed, 15 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index 1f3eddc1..cdd5e85c 100644
--- a/Makefile
+++ b/Makefile
@@ -14,13 +14,13 @@ install: requirements install_py install_js
.PHONY: requirements_py
requirements_py: create_virtualenv
@echo "Upgrading pip and setuptools"
- @source ~/.venvs/pixua/bin/activate;\
+ @source $(VIRTUALENV)/bin/activate;\
pip install --upgrade pip setuptools
.PHONY: install_py
install_py: service/requirements.txt service/test_requirements.txt
@echo "Installing python packages"
- @source ~/.venvs/pixua/bin/activate;\
+ @source $(VIRTUALENV)/bin/activate;\
cd service;\
pip install --exists-action s -r requirements.txt -r test_requirements.txt
@@ -61,7 +61,7 @@ test_all: test functional_tests
.PHONY: linters_py
linters_py:
@echo "Running pep8"
- @source ~/.venvs/pixua/bin/activate;\
+ @source $(VIRTUALENV)/bin/activate;\
cd service;\
pep8 --ignore=E501 pixelated test
@@ -73,11 +73,17 @@ linters_js:
.PHONY: coverage
coverage:
+ @source $(VIRTUALENV)/bin/activate;\
+ cd service;\
+ coverage run -p --source=pixelated `which trial` test.unit;\
+ coverage run -p --source=pixelated `which trial` test.integration;\
+ coverage combine;\
+ coverage html
.PHONY: unit_tests_py
unit_tests_py:
@echo "Running python unit tests"
- -@source ~/.venvs/pixua/bin/activate;\
+ @source $(VIRTUALENV)/bin/activate;\
cd service;\
trial --reporter=text test.unit
@@ -90,14 +96,14 @@ unit_tests_js:
.PHONY: integration_tests_py
integration_tests:
@echo "Running integration tests"
- @source ~/.venvs/pixua/bin/activate;\
+ @source $(VIRTUALENV)/bin/activate;\
cd service;\
trial -j`grep -c "^processor" /proc/cpuinfo || sysctl -n hw.logicalcpu` --reporter=text test.integration
.PHONY: functional_tests
functional_tests: ensure_phantomjs_installed
@echo "Running behave functional tests"
- @source ~/.venvs/pixua/bin/activate;\
+ @source $(VIRTUALENV)/bin/activate;\
cd service;\
behave --tags ~@wip --tags ~@smoke test/functional/features
@@ -128,10 +134,13 @@ clean_all: clean remove_javascript_packages remove_virtualenv
clean_py:
rm -rf service/_trial_temp
find . -name "*.pyc" -delete
+ @source $(VIRTUALENV)/bin/activate;\
+ rm -rf service/.coverage
.PHONY: clean_js
clean_js:
rm -rf web-ui/dist
+ rm -rf web-ui/.sass-cache
.PHONY: clean_cache
clean_cache: