commit/galaxy-central: jmchilton: Small improvements to JavaScript testing with run_tests.sh.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/d8eccdf88c80/ Changeset: d8eccdf88c80 User: jmchilton Date: 2014-09-02 18:35:33 Summary: Small improvements to JavaScript testing with run_tests.sh. Add new -j|--casperjs option to run through the casperjs test suite. Ensure grunt is on path before attempting to run qunit tests. A more useful version of this changeset which automatically installed phantomjs, casperjs, grunt, and npm as needed and added the required tools to the tester's path (https://bitbucket.org/jmchilton/galaxy-central-fork-1/commits/0919fc9403933f...) proved unpopular because of implementation details - see conversation here https://bitbucket.org/galaxy/galaxy-central/pull-request/461/remove-deprecat.... Affected #: 2 files diff -r 7f729ff2483d6aed19100542e102f14e3f2f11b1 -r d8eccdf88c8090e7237dca11502c5c62b3388bc0 run_tests.sh --- a/run_tests.sh +++ b/run_tests.sh @@ -31,6 +31,19 @@ echo "'${0##*/} -sid ccc' for testing one section with sid 'ccc' ('ccc' is the string after 'section::')" } +exists() { + type "$1" >/dev/null 2>/dev/null +} + +ensure_grunt() { + if ! exists "grunt"; + then + echo "Grunt not on path, cannot run these tests." + exit 1 + fi +} + + test_script="./scripts/functional_tests.py" report_file="run_functional_tests.html" with_framework_test_tools_arg="" @@ -110,6 +123,12 @@ data_managers_test=1; shift 1 ;; + -j|-casperjs|--casperjs) + # TODO: Support running casper tests against existing + # Galaxy instances. + casperjs_test=1; + shift + ;; -m|-migrated|--migrated) migrated_test=1; shift @@ -196,6 +215,11 @@ extra_args="$toolshed_script" elif [ -n "$api_script" ]; then extra_args="$api_script" +elif [ -n "$casperjs_test" ]; then + # TODO: Ensure specific versions of casperjs and phantomjs are + # available. Some option for leveraging npm to automatically + # install these dependencies would be nice as well. + extra_args="test/casperjs/casperjs_runner.py" elif [ -n "$section_id" ]; then extra_args=`python tool_list.py $section_id` elif [ -n "$test_id" ]; then @@ -212,6 +236,7 @@ if [ "$driver" = "python" ]; then python $test_script $coverage_arg -v --with-nosehtml --html-report-file $report_file $with_framework_test_tools_arg $extra_args else + ensure_grunt if [ -n "$watch" ]; then grunt_task="watch" else diff -r 7f729ff2483d6aed19100542e102f14e3f2f11b1 -r d8eccdf88c8090e7237dca11502c5c62b3388bc0 test/casperjs/casperjs_runner.py --- a/test/casperjs/casperjs_runner.py +++ b/test/casperjs/casperjs_runner.py @@ -6,8 +6,9 @@ * casperjs test mytests.js --url='http://localhost:8080' * python casperjs_runner.py * nosetests -* sh run_functional_tests.sh test/casperjs/casperjs_runner.py -* sh run_functional_tests.sh +* sh run_tests.sh -j +* sh run_tests.sh test/casperjs/casperjs_runner.py +* sh run_tests.sh Note: that you can enable (lots of) debugging info using cli options: * casperjs test api-user-tests.js --url='http://localhost:8080' --verbose=true --logLevel=debug Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
participants (1)
-
commits-noreply@bitbucket.org