Commit 5bac7f2f by Daniel Friedman

Fix the way we measure coverage

parent c8c8e25f
......@@ -2,6 +2,8 @@
omit = analyticsdataserver/settings*
*wsgi.py
analytics_data_api/management/commands/generate_fake_course_data.py
source = analyticsdataserver, analytics_data_api
branch = True
[report]
# Regexes for lines to exclude from consideration
......@@ -9,4 +11,10 @@ exclude_lines =
# Have to re-enable the standard pragma
pragma: no cover
raise NotImplementedError
\ No newline at end of file
raise NotImplementedError
[html]
directory = ${COVERAGE_DIR}/html/
[xml]
output = ${COVERAGE_DIR}/coverage.xml
ROOT = $(shell echo "$$PWD")
COVERAGE = $(ROOT)/build/coverage
COVERAGE_DIR = $(ROOT)/build/coverage
PACKAGES = analyticsdataserver analytics_data_api
DATABASES = default analytics
ELASTICSEARCH_VERSION = 1.5.2
TEST_SETTINGS = analyticsdataserver.settings.test
.PHONY: requirements develop clean diff.report view.diff.report quality
......@@ -28,22 +28,22 @@ clean:
coverage erase
test: clean
. ./.test_env && ./manage.py test --settings=analyticsdataserver.settings.test --with-ignore-docstrings \
--exclude-dir=analyticsdataserver/settings --with-coverage --cover-inclusive --cover-branches \
--cover-html --cover-html-dir=$(COVERAGE)/html/ \
--cover-xml --cover-xml-file=$(COVERAGE)/coverage.xml \
$(foreach package,$(PACKAGES),--cover-package=$(package)) \
coverage run ./manage.py test --settings=$(TEST_SETTINGS) \
--with-ignore-docstrings --exclude-dir=analyticsdataserver/settings \
$(PACKAGES)
export COVERAGE_DIR=$(COVERAGE_DIR) && \
coverage html && \
coverage xml
diff.report:
diff-cover $(COVERAGE)/coverage.xml --html-report $(COVERAGE)/diff_cover.html
diff-quality --violations=pep8 --html-report $(COVERAGE)/diff_quality_pep8.html
diff-quality --violations=pylint --html-report $(COVERAGE)/diff_quality_pylint.html
diff-cover $(COVERAGE_DIR)/coverage.xml --html-report $(COVERAGE_DIR)/diff_cover.html
diff-quality --violations=pep8 --html-report $(COVERAGE_DIR)/diff_quality_pep8.html
diff-quality --violations=pylint --html-report $(COVERAGE_DIR)/diff_quality_pylint.html
view.diff.report:
xdg-open file:///$(COVERAGE)/diff_cover.html
xdg-open file:///$(COVERAGE)/diff_quality_pep8.html
xdg-open file:///$(COVERAGE)/diff_quality_pylint.html
xdg-open file:///$(COVERAGE_DIR)/diff_cover.html
xdg-open file:///$(COVERAGE_DIR)/diff_quality_pep8.html
xdg-open file:///$(COVERAGE_DIR)/diff_quality_pylint.html
quality:
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