Add documentation for running casperjs tests through run_tests.sh.

Add option to run a specific test. Verified xunit reports work and --dockerize works for casperjs tests.
This commit is contained in:
John Chilton
2015-10-01 13:45:37 +01:00
parent b0b119356b
commit 49740caaa2
2 changed files with 13 additions and 4 deletions
+12 -3
View File
@@ -24,7 +24,7 @@ cat <<EOF
'${0##*/} -unit (test_path)' for running all unit tests (doctests in lib and tests in test/unit)
'${0##*/} -qunit' for running qunit JavaScript tests
'${0##*/} -qunit testname' for running single JavaScript test with given name
'${0##*/} -casperjs (py_test_path)' for running casperjs JavaScript tests using a Python wrapper for consistency. py_test_path in casperjs_runner.py e.g. 'Test_04_HDAs' or 'Test_04_HDAs.test_00_HDA_states'.
Nose tests will allow specific tests to be selected per the documentation at
https://nose.readthedocs.org/en/latest/usage.html#selecting-tests. These are
@@ -173,9 +173,14 @@ do
-j|-casperjs|--casperjs)
# TODO: Support running casper tests against existing
# Galaxy instances.
if [ $# -gt 1 ]; then
casperjs_test_name=$2
shift 2
else
shift 1
fi
report_file="run_casperjs_tests.html"
casperjs_test=1;
shift
;;
-m|-migrated|--migrated)
migrated_test=1;
@@ -306,7 +311,11 @@ 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"
if [ -n "$casperjs_test_name" ]; then
extra_args="test/casperjs/casperjs_runner.py:$casperjs_test_name"
else
extra_args="test/casperjs/casperjs_runner.py"
fi
elif [ -n "$section_id" ]; then
extra_args=`python tool_list.py $section_id`
elif [ -n "$test_id" ]; then
+1 -1
View File
@@ -160,7 +160,7 @@ class CasperJSTestCase( unittest.TestCase ):
# as of casperjs 1.1, we always need to use the 'test' command
command_line_list.append( 'test' )
# make rel_script_path an absolute path (when this is not run from its dir - i.e. run_functional_tests.sh)
# make rel_script_path an absolute path (when this is not run from its dir - i.e. run_tests.sh)
curr_dir = os.path.dirname( __file__ )
script_path = os.path.join( curr_dir, rel_script_path )
command_line_list.append( script_path )