Commit 32fbb020 by Andy Armstrong

Clean up build scripts

 - add a .jshintrc file
 - add a test-js target
 - make test scripts not use coverage by default
parent 94559a0f
This diff is collapsed. Click to expand it.
...@@ -48,3 +48,6 @@ install: install-wheels install-python install-js install-nltk-data install-test ...@@ -48,3 +48,6 @@ install: install-wheels install-python install-js install-nltk-data install-test
test: test:
./scripts/test.sh ./scripts/test.sh
test-js:
./scripts/test-js.sh
...@@ -11,7 +11,7 @@ module.exports = function(config) { ...@@ -11,7 +11,7 @@ module.exports = function(config) {
'karma-coverage', 'karma-coverage',
'karma-jasmine', 'karma-jasmine',
'karma-chrome-launcher', 'karma-chrome-launcher',
'karma-phantomjs-launcher', 'karma-phantomjs-launcher'
], ],
// frameworks to use // frameworks to use
...@@ -36,7 +36,7 @@ module.exports = function(config) { ...@@ -36,7 +36,7 @@ module.exports = function(config) {
{ {
pattern: 'fixtures/*.html', pattern: 'fixtures/*.html',
served: true, included: false served: true, included: false
}, }
], ],
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
cd `dirname $BASH_SOURCE` && cd .. cd `dirname $BASH_SOURCE` && cd ..
echo "Generating HTML fixtures for JavaScript tests..." echo "Generating HTML fixtures for JavaScript tests..."
export DJANGO_SETTINGS_MODULE="settings.test" export DJANGO_SETTINGS_MODULE=${DJANGO_SETTINGS_MODULE:-"settings.test"}
./scripts/render_templates.py openassessment/xblock/static/js/fixtures/templates.json ./scripts/render_templates.py openassessment/xblock/static/js/fixtures/templates.json
echo "Running JavaScript tests..." echo "Running JavaScript tests..."
......
...@@ -6,5 +6,5 @@ cd `dirname $BASH_SOURCE` && cd .. ...@@ -6,5 +6,5 @@ cd `dirname $BASH_SOURCE` && cd ..
git clean -xfd "./storage/test/" git clean -xfd "./storage/test/"
echo "Running Python tests..." echo "Running Python tests..."
export DJANGO_SETTINGS_MODULE="settings.test" export DJANGO_SETTINGS_MODULE=${DJANGO_SETTINGS_MODULE:-"settings.test"}
python manage.py test $1 python manage.py test $1
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
set -e set -e
cd `dirname $BASH_SOURCE` && cd .. cd `dirname $BASH_SOURCE` && cd ..
export DJANGO_SETTINGS_MODULE=${DJANGO_SETTINGS_MODULE:-"settings.test_with_coverage"}
./scripts/test-python.sh $1 ./scripts/test-python.sh $1
./scripts/test-js.sh ./scripts/test-js.sh
./scripts/build-docs.sh ./scripts/build-docs.sh
...@@ -9,7 +9,7 @@ make install-js ...@@ -9,7 +9,7 @@ make install-js
make javascript make javascript
# Configure Django settings # Configure Django settings
export DJANGO_SETTINGS_MODULE="settings.dev" export DJANGO_SETTINGS_MODULE=${DJANGO_SETTINGS_MODULE:-"settings.dev"}
# Create the database # Create the database
echo "Updating the database..." echo "Updating the database..."
......
...@@ -15,10 +15,6 @@ TEST_APPS = ( ...@@ -15,10 +15,6 @@ TEST_APPS = (
# Configure nose # Configure nose
NOSE_ARGS = [ NOSE_ARGS = [
"-a !acceptance", "-a !acceptance",
'--with-coverage',
'--cover-package=' + ",".join(TEST_APPS),
'--cover-branches',
'--cover-erase',
] ]
DATABASES = { DATABASES = {
......
"""
Django settings for running tests with coverage.
"""
# Inherit from the test settings
from .test import * # pylint:disable=W0614,W0401
# Configure nose so that tests are run with coverage
NOSE_ARGS = [
"-a !acceptance",
'--with-coverage',
'--cover-package=' + ",".join(TEST_APPS),
'--cover-branches',
'--cover-erase',
]
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