forked from openedx-unsupported/edx-analytics-dashboard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
128 lines (95 loc) · 4.65 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
.PHONY: requirements
ROOT = $(shell echo "$$PWD")
COVERAGE = $(ROOT)/build/coverage
NODE_BIN=./node_modules/.bin
DJANGO_SETTINGS_MODULE ?= "analytics_dashboard.settings.local"
.PHONY: requirements clean
# pin to 9.0.3 until tox-battery upgrades
pin_pip:
pip install --upgrade pip==9.0.3
requirements: requirements.py requirements.js
requirements.py:
pip install -q -r requirements/base.txt --exists-action w
requirements.js:
npm install --unsafe-perm
test.requirements: requirements
pip install -q -r requirements/test.txt --exists-action w
develop: test.requirements
pip install -q -r requirements/local.txt --exists-action w
migrate:
python manage.py migrate --run-syncdb
clean:
find . -name '*.pyc' -delete
coverage erase
test_python_no_compress: clean
python manage.py test analytics_dashboard common --settings=analytics_dashboard.settings.test --with-coverage \
--cover-package=analytics_dashboard --cover-package=common --cover-branches --cover-html --cover-html-dir=$(COVERAGE)/html/ \
--with-ignore-docstrings --cover-xml --cover-xml-file=$(COVERAGE)/coverage.xml
test_compress: static
# No longer does anything. Kept for legacy support.
test_python: test_compress test_python_no_compress
accept:
ifeq ("${DISPLAY_LEARNER_ANALYTICS}", "True")
./manage.py waffle_flag enable_learner_analytics --create --everyone
endif
ifeq ("${ENABLE_COURSE_LIST_FILTERS}", "True")
./manage.py waffle_switch enable_course_filters on --create
endif
ifeq ("${ENABLE_COURSE_LIST_PASSING}", "True")
./manage.py waffle_switch enable_course_passing on --create
endif
./manage.py create_acceptance_test_soapbox_messages
nosetests -v acceptance_tests -e NUM_PROCESSES=1 --exclude-dir=acceptance_tests/course_validation
./manage.py delete_acceptance_test_soapbox_messages
# local acceptance tests are typically run with by passing in environment variables on the commandline
# e.g. API_SERVER_URL="http://localhost:9001/api/v0" API_AUTH_TOKEN="edx" make accept_local
accept_local:
./manage.py create_acceptance_test_soapbox_messages
nosetests -v acceptance_tests --exclude-dir=acceptance_tests/course_validation
./manage.py delete_acceptance_test_soapbox_messages
a11y:
ifeq ("${DISPLAY_LEARNER_ANALYTICS}", "True")
./manage.py waffle_flag enable_learner_analytics --create --everyone
endif
BOKCHOY_A11Y_CUSTOM_RULES_FILE=./node_modules/edx-custom-a11y-rules/lib/custom_a11y_rules.js SELENIUM_BROWSER=firefox nosetests -v a11y_tests -e NUM_PROCESSES=1 --exclude-dir=acceptance_tests/course_validation
course_validation:
python -m acceptance_tests.course_validation.generate_report
quality:
pep8 acceptance_tests analytics_dashboard common
PYTHONPATH=".:./analytics_dashboard:$PYTHONPATH" pylint --rcfile=pylintrc acceptance_tests analytics_dashboard common
validate_python: test.requirements test_python quality
#FIXME validate_js: requirements.js
validate_js:
$(NODE_BIN)/gulp test
npm run lint -s
validate: validate_python validate_js
demo:
python manage.py waffle_switch show_engagement_forum_activity off --create
python manage.py waffle_switch enable_course_api off --create
python manage.py waffle_switch display_course_name_in_nav off --create
# compiles djangojs and django .po and .mo files
compile_translations:
python manage.py compilemessages
# creates the source django & djangojs files
extract_translations:
cd analytics_dashboard && python ../manage.py makemessages -l en -v1 --ignore="docs/*" --ignore="src/*" --ignore="i18n/*" --ignore="assets/*" --ignore="static/bundles/*" -d django
cd analytics_dashboard && python ../manage.py makemessages -l en -v1 --ignore="docs/*" --ignore="src/*" --ignore="i18n/*" --ignore="assets/*" --ignore="static/bundles/*" -d djangojs
dummy_translations:
cd analytics_dashboard && i18n_tool dummy -v
generate_fake_translations: extract_translations dummy_translations compile_translations
pull_translations:
cd analytics_dashboard && tx pull -af
update_translations: pull_translations generate_fake_translations
# check if translation files are up-to-date
detect_changed_source_translations:
cd analytics_dashboard && i18n_tool changed
# extract, compile, and check if translation files are up-to-date
validate_translations: extract_translations compile_translations detect_changed_source_translations
cd analytics_dashboard && i18n_tool validate
static_no_compress: static
# No longer does anything. Kept for legacy support.
static:
$(NODE_BIN)/webpack --config webpack.prod.config.js
# collectstatic creates way too much output with the cldr-data directory output so silence that directory
echo "Running collectstatic while silencing cldr-data/main/* ..."
python manage.py collectstatic --noinput | sed -n '/.*node_modules\/cldr-data\/main\/.*/!p'