Commit 5bac7f2f by Daniel Friedman

Fix the way we measure coverage

parent c8c8e25f
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
omit = analyticsdataserver/settings* omit = analyticsdataserver/settings*
*wsgi.py *wsgi.py
analytics_data_api/management/commands/generate_fake_course_data.py analytics_data_api/management/commands/generate_fake_course_data.py
source = analyticsdataserver, analytics_data_api
branch = True
[report] [report]
# Regexes for lines to exclude from consideration # Regexes for lines to exclude from consideration
...@@ -9,4 +11,10 @@ exclude_lines = ...@@ -9,4 +11,10 @@ exclude_lines =
# Have to re-enable the standard pragma # Have to re-enable the standard pragma
pragma: no cover pragma: no cover
raise NotImplementedError raise NotImplementedError
\ No newline at end of file
[html]
directory = ${COVERAGE_DIR}/html/
[xml]
output = ${COVERAGE_DIR}/coverage.xml
ROOT = $(shell echo "$$PWD") ROOT = $(shell echo "$$PWD")
COVERAGE = $(ROOT)/build/coverage COVERAGE_DIR = $(ROOT)/build/coverage
PACKAGES = analyticsdataserver analytics_data_api PACKAGES = analyticsdataserver analytics_data_api
DATABASES = default analytics DATABASES = default analytics
ELASTICSEARCH_VERSION = 1.5.2 ELASTICSEARCH_VERSION = 1.5.2
TEST_SETTINGS = analyticsdataserver.settings.test
.PHONY: requirements develop clean diff.report view.diff.report quality .PHONY: requirements develop clean diff.report view.diff.report quality
...@@ -28,22 +28,22 @@ clean: ...@@ -28,22 +28,22 @@ clean:
coverage erase coverage erase
test: clean test: clean
. ./.test_env && ./manage.py test --settings=analyticsdataserver.settings.test --with-ignore-docstrings \ coverage run ./manage.py test --settings=$(TEST_SETTINGS) \
--exclude-dir=analyticsdataserver/settings --with-coverage --cover-inclusive --cover-branches \ --with-ignore-docstrings --exclude-dir=analyticsdataserver/settings \
--cover-html --cover-html-dir=$(COVERAGE)/html/ \
--cover-xml --cover-xml-file=$(COVERAGE)/coverage.xml \
$(foreach package,$(PACKAGES),--cover-package=$(package)) \
$(PACKAGES) $(PACKAGES)
export COVERAGE_DIR=$(COVERAGE_DIR) && \
coverage html && \
coverage xml
diff.report: diff.report:
diff-cover $(COVERAGE)/coverage.xml --html-report $(COVERAGE)/diff_cover.html diff-cover $(COVERAGE_DIR)/coverage.xml --html-report $(COVERAGE_DIR)/diff_cover.html
diff-quality --violations=pep8 --html-report $(COVERAGE)/diff_quality_pep8.html diff-quality --violations=pep8 --html-report $(COVERAGE_DIR)/diff_quality_pep8.html
diff-quality --violations=pylint --html-report $(COVERAGE)/diff_quality_pylint.html diff-quality --violations=pylint --html-report $(COVERAGE_DIR)/diff_quality_pylint.html
view.diff.report: view.diff.report:
xdg-open file:///$(COVERAGE)/diff_cover.html xdg-open file:///$(COVERAGE_DIR)/diff_cover.html
xdg-open file:///$(COVERAGE)/diff_quality_pep8.html xdg-open file:///$(COVERAGE_DIR)/diff_quality_pep8.html
xdg-open file:///$(COVERAGE)/diff_quality_pylint.html xdg-open file:///$(COVERAGE_DIR)/diff_quality_pylint.html
quality: quality:
pep8 $(PACKAGES) pep8 $(PACKAGES)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment