Commit acc5b079 by Will Daly

Merge pull request #342 from edx/will/javascript-test-script

Separate Python and JavaScript install/test scripts
parents 8f6189a3 29b91c7c
......@@ -75,13 +75,13 @@ To limit Python tests to a particular Django app:
.. code:: bash
./scripts/test.sh openassessment.xblock
./scripts/test-python.sh openassessment.xblock
To run just the JavaScript tests:
.. code:: bash
npm test
./scripts/test-js.sh
To run the JavaScript tests in Chrome so you can use the debugger:
......
#!/usr/bin/env bash
cd `dirname $BASH_SOURCE` && cd ..
STATIC_JS="apps/openassessment/xblock/static/js"
echo "Installing Node requirements..."
if [ -z `which npm` ]; then
echo "Please install NodeJS: http://nodejs.org/"
exit 1
fi
npm config set loglevel warn
npm install
echo "Minimizing XBlock JavaScript..."
echo "(set DEBUG_JS=1 to preserve indentation and line breaks)"
if [[ -n "$DEBUG_JS" ]]; then
UGLIFY_EXTRA_ARGS="--beautify"
fi
node_modules/.bin/uglifyjs $STATIC_JS/src/oa_shared.js $STATIC_JS/src/*.js $UGLIFY_EXTRA_ARGS > "$STATIC_JS/openassessment.min.js"
#!/usr/bin/env bash
cd `dirname $BASH_SOURCE` && cd ..
STATIC_JS="apps/openassessment/xblock/static/js"
if [[ -n "$1" ]]; then
REQS="$1"
else
REQS="dev"
fi
echo "Installing Python requirements..."
pip install -q -r requirements/$REQS.txt
echo "Installing XBlock..."
pip install -q -e .
#!/usr/bin/env bash
cd `dirname $BASH_SOURCE` && cd ..
STATIC_JS="apps/openassessment/xblock/static/js"
if [[ -n "$1" ]]; then
REQS="$1"
else
REQS="dev"
fi
echo "Installing Python requirements..."
pip install -q -r requirements/$REQS.txt
echo "Installing XBlock..."
pip install -q -e .
echo "Installing Node requirements..."
if [ -z `which npm` ]; then
echo "Please install NodeJS: http://nodejs.org/"
exit 1
fi
npm config set loglevel warn
npm install
echo "Minimizing XBlock JavaScript..."
echo "(set DEBUG_JS=1 to preserve indentation and line breaks)"
if [[ -n "$DEBUG_JS" ]]; then
UGLIFY_EXTRA_ARGS="--beautify"
fi
node_modules/.bin/uglifyjs $STATIC_JS/src/oa_shared.js $STATIC_JS/src/*.js $UGLIFY_EXTRA_ARGS > "$STATIC_JS/openassessment.min.js"
./scripts/install-python.sh
./scripts/install-js.sh
#!/usr/bin/env bash
cd `dirname $BASH_SOURCE` && cd ..
./scripts/install-js.sh
echo "Generating HTML fixtures for JavaScript tests..."
export DJANGO_SETTINGS_MODULE="settings.test"
./scripts/render_templates.py apps/openassessment/xblock/static/js/fixtures/templates.json
echo "Running JavaScript tests..."
npm test
#!/usr/bin/env bash
cd `dirname $BASH_SOURCE` && cd ..
./scripts/install-python.sh test
echo "Running Python tests..."
export DJANGO_SETTINGS_MODULE="settings.test"
python manage.py test $1
......@@ -4,14 +4,5 @@
set -e
cd `dirname $BASH_SOURCE` && cd ..
./scripts/install.sh test
echo "Running Python tests..."
export DJANGO_SETTINGS_MODULE="settings.test"
python manage.py test $1
echo "Generating HTML fixtures for JavaScript tests..."
./scripts/render_templates.py apps/openassessment/xblock/static/js/fixtures/templates.json
echo "Running JavaScript tests..."
npm test
./scripts/test-python.sh
./scripts/test-js.sh
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