Commit e7efcbb9 by Clinton Blackburn

Merge pull request #398 from edx/clintonb/makefile-update

Updated Makefile for easier testing
parents db6774fb 574c9e7f
...@@ -17,6 +17,7 @@ addons: ...@@ -17,6 +17,7 @@ addons:
before_install: before_install:
- "export DISPLAY=:99.0" - "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start" - "sh -e /etc/init.d/xvfb start"
- "export DJANGO_SETTINGS_MODULE=ecommerce.settings.test"
install: install:
- pip install -U codecov - pip install -U codecov
- pip install -U pip wheel - pip install -U pip wheel
...@@ -29,8 +30,10 @@ script: ...@@ -29,8 +30,10 @@ script:
- cd .. - cd ..
# Compile assets and run validation # Compile assets and run validation
- make static -e DJANGO_SETTINGS_MODULE="ecommerce.settings.test" - make clean_static
- make validate - make static
- make validate_python
- make validate_js
branches: branches:
only: only:
- master - master
......
...@@ -22,6 +22,8 @@ help: ...@@ -22,6 +22,8 @@ help:
@echo ' make fake_translations install fake translations ' @echo ' make fake_translations install fake translations '
@echo ' make pull_translations pull translations from Transifex ' @echo ' make pull_translations pull translations from Transifex '
@echo ' make update_translations install new translations from Transifex ' @echo ' make update_translations install new translations from Transifex '
@echo ' make clean_static delete compiled/compressed static assets'
@echo ' make static compile and compress static assets'
@echo ' ' @echo ' '
requirements.js: requirements.js:
...@@ -40,7 +42,10 @@ serve: ...@@ -40,7 +42,10 @@ serve:
clean: clean:
find . -name '*.pyc' -delete find . -name '*.pyc' -delete
coverage erase coverage erase
rm -rf assets/ ecommerce/static/build coverage htmlcov rm -rf coverage htmlcov
clean_static:
rm -rf assets/ ecommerce/static/build
validate_js: validate_js:
rm -rf coverage rm -rf coverage
...@@ -49,14 +54,12 @@ validate_js: ...@@ -49,14 +54,12 @@ validate_js:
$(NODE_BIN)/gulp jscs $(NODE_BIN)/gulp jscs
validate_python: clean validate_python: clean
python manage.py compress --settings=ecommerce.settings.test -v0
REUSE_DB=1 coverage run --branch --source=ecommerce ./manage.py test ecommerce \ REUSE_DB=1 coverage run --branch --source=ecommerce ./manage.py test ecommerce \
--settings=ecommerce.settings.test --with-ignore-docstrings --logging-level=DEBUG --settings=ecommerce.settings.test --with-ignore-docstrings --logging-level=DEBUG
coverage report coverage report
make quality make quality
fast_validate_python: clean fast_validate_python: clean
python manage.py compress --settings=ecommerce.settings.test -v0
REUSE_DB=1 DISABLE_ACCEPTANCE_TESTS=True ./manage.py test ecommerce \ REUSE_DB=1 DISABLE_ACCEPTANCE_TESTS=True ./manage.py test ecommerce \
--settings=ecommerce.settings.test --processes=4 --with-ignore-docstrings --logging-level=DEBUG --settings=ecommerce.settings.test --processes=4 --with-ignore-docstrings --logging-level=DEBUG
make quality make quality
...@@ -70,7 +73,7 @@ validate: validate_python validate_js ...@@ -70,7 +73,7 @@ validate: validate_python validate_js
static: static:
$(NODE_BIN)/r.js -o build.js $(NODE_BIN)/r.js -o build.js
python manage.py collectstatic --noinput -v0 python manage.py collectstatic --noinput -v0
python manage.py compress -v0 python manage.py compress -v0 --force
html_coverage: html_coverage:
coverage html && open htmlcov/index.html coverage html && open htmlcov/index.html
...@@ -97,4 +100,4 @@ update_translations: pull_translations fake_translations ...@@ -97,4 +100,4 @@ update_translations: pull_translations fake_translations
# Targets in a Makefile which do not produce an output file with the same name as the target name # Targets in a Makefile which do not produce an output file with the same name as the target name
.PHONY: help requirements migrate serve clean validate_python quality validate_js validate html_coverage accept \ .PHONY: help requirements migrate serve clean validate_python quality validate_js validate html_coverage accept \
extract_translations dummy_translations compile_translations fake_translations pull_translations \ extract_translations dummy_translations compile_translations fake_translations pull_translations \
update_translations fast_validate_python update_translations fast_validate_python clean_static
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