Add new option, tools, and data to functional test framework to test/demonstrate tool framework itself.

Add smaple repeat tool demonstrating some weaknesses of twill-based current framework.
This commit is contained in:
John Chilton
2013-11-21 19:17:12 -06:00
parent 0ebfbc27fe
commit 569c5db221
12 changed files with 96 additions and 2 deletions
+10
View File
@@ -13,6 +13,8 @@ elif [ $1 = 'help' ]; then
echo "'run_functional_tests.sh -list' for listing all the tool ids"
echo "'run_functional_tests.sh -toolshed' for running all the test scripts in the ./test/tool_shed/functional directory"
echo "'run_functional_tests.sh -toolshed testscriptname' for running one test script named testscriptname in the .test/tool_shed/functional directory"
echo "'run_functional_tests.sh -framework' for running through example tool tests testing framework features in test/functional/tools"
echo "'run_functional_tests.sh -framework -id toolid' for testing one framework tool (in test/functional/tools/) with id 'toolid'"
elif [ $1 = '-id' ]; then
python ./scripts/functional_tests.py -v functional.test_toolbox:TestForTool_$2 --with-nosehtml --html-report-file run_functional_tests.html
elif [ $1 = '-sid' ]; then
@@ -46,6 +48,14 @@ elif [ $1 = '-toolshed' ]; then
else
python ./test/tool_shed/functional_tests.py -v --with-nosehtml --html-report-file ./test/tool_shed/run_functional_tests.html $2
fi
elif [ $1 = '-framework' ]; then
if [ ! $2 ]; then
python ./scripts/functional_tests.py -v functional.test_toolbox --with-nosehtml --html-report-file run_functional_tests.html -framework
elif [ $2 = '-id' ]; then
python ./scripts/functional_tests.py -v functional.test_toolbox:TestForTool_$3 --with-nosehtml --html-report-file run_functional_tests.html -framework
else
echo "Invalid test option selected, if -framework first argument to $0, optional second argument must be -id followed a tool id."
fi
else
python ./scripts/functional_tests.py -v --with-nosehtml --html-report-file run_functional_tests.html $1
fi
+18 -2
View File
@@ -178,6 +178,7 @@ def main():
os.environ[ 'HTTP_ACCEPT_LANGUAGE' ] = default_galaxy_locales
testing_migrated_tools = '-migrated' in sys.argv
testing_installed_tools = '-installed' in sys.argv
datatypes_conf_override = None
if testing_migrated_tools or testing_installed_tools:
sys.argv.pop()
@@ -197,8 +198,21 @@ def main():
# Exclude all files except test_toolbox.py.
ignore_files = ( re.compile( r'^test_[adghlmsu]*' ), re.compile( r'^test_ta*' ) )
else:
tool_config_file = os.environ.get( 'GALAXY_TEST_TOOL_CONF', 'tool_conf.xml' )
galaxy_test_file_dir = os.environ.get( 'GALAXY_TEST_FILE_DIR', default_galaxy_test_file_dir )
framework_test = '-framework' in sys.argv # Run through suite of tests testing framework.
if framework_test:
sys.argv.pop()
framework_tool_dir = os.path.join('test', 'functional', 'tools')
tool_conf = os.path.join( framework_tool_dir, 'samples_tool_conf.xml' )
datatypes_conf_override = os.path.join( framework_tool_dir, 'sample_datatypes_conf.xml' )
test_dir = os.path.join( framework_tool_dir, 'test-data')
tool_path = framework_tool_dir
else:
# Use tool_conf.xml toolbox.
tool_conf = 'tool_conf.xml'
test_dir = default_galaxy_test_file_dir
tool_config_file = os.environ.get( 'GALAXY_TEST_TOOL_CONF', tool_conf )
galaxy_test_file_dir = os.environ.get( 'GALAXY_TEST_FILE_DIR', test_dir )
if not os.path.isabs( galaxy_test_file_dir ):
galaxy_test_file_dir = os.path.join( os.getcwd(), galaxy_test_file_dir )
library_import_dir = galaxy_test_file_dir
@@ -338,6 +352,8 @@ def main():
if use_distributed_object_store:
kwargs[ 'object_store' ] = 'distributed'
kwargs[ 'distributed_object_store_config_file' ] = 'distributed_object_store_conf.xml.sample'
if datatypes_conf_override:
kwargs[ 'datatypes_config_file' ] = datatypes_conf_override
# If the user has passed in a path for the .ini file, do not overwrite it.
galaxy_config_file = os.environ.get( 'GALAXY_TEST_INI_FILE', None )
if not galaxy_config_file:
+3
View File
@@ -0,0 +1,3 @@
This directory contains tools only useful for testing the tool test framework
and demonstrating it features. Run the driver script 'run_functional_tests.sh'
with '-installed' as first argument to run through these tests.
+39
View File
@@ -0,0 +1,39 @@
<tool id="multirepeat" name="multirepeat">
<description>tail-to-head</description>
<command>
cat $input1 #for $q in $queries# ${q.input2} #end for# #for $q in $more_queries# ${q.more_queries_input} #end for# > $out_file1
</command>
<inputs>
<param name="input1" type="data" label="Concatenate Dataset"/>
<repeat name="queries" title="Dataset">
<param name="input2" type="data" label="Select" />
</repeat>
<repeat name="more_queries" title="Dataset">
<param name="more_queries_input" type="data" label="Select" />
</repeat>
</inputs>
<outputs>
<data name="out_file1" format="input" metadata_source="input1"/>
</outputs>
<tests>
<test>
<param name="input1" value="simple_line.txt"/>
<param name="input2" value="simple_line.txt"/>
<output name="out_file1" file="simple_line_x2.txt"/>
</test>
<test>
<param name="input1" value="simple_line.txt"/>
<param name="input2" value="simple_line.txt"/>
<param name="input2" value="simple_line.txt"/>
<output name="out_file1" file="simple_line_x3.txt"/>
</test>
<test>
<param name="input1" value="simple_line.txt"/>
<param name="input2" value="simple_line.txt"/>
<param name="input2" value="simple_line.txt"/>
<param name="more_queries_input" value="simple_line.txt"/>
<param name="more_queries_input" value="simple_line.txt"/>
<output name="out_file1" file="simple_line_x5.txt"/>
</test>
</tests>
</tool>
@@ -0,0 +1,8 @@
<?xml version="1.0"?>
<datatypes>
<registration converters_path="lib/galaxy/datatypes/converters" display_path="display_applications">
<datatype extension="velvet" type="galaxy.datatypes.assembly:Velvet" display_in_upload="true"/>
<datatype extension="txt" type="galaxy.datatypes.data:Text" display_in_upload="true"/>
<datatype extension="tabular" type="galaxy.datatypes.tabular:Tabular" display_in_upload="true"/>
</registration>
</datatypes>
@@ -0,0 +1,5 @@
<?xml version="1.0"?>
<toolbox>
<tool file="upload.xml"/>
<tool file="multi_repeats.xml"/>
</toolbox>
@@ -0,0 +1 @@
This is a line of text.
@@ -0,0 +1,2 @@
This is a line of text.
This is a line of text.
@@ -0,0 +1,3 @@
This is a line of text.
This is a line of text.
This is a line of text.
@@ -0,0 +1,5 @@
This is a line of text.
This is a line of text.
This is a line of text.
This is a line of text.
This is a line of text.
+1
View File
@@ -0,0 +1 @@
../../../tools/data_source/upload.py
+1
View File
@@ -0,0 +1 @@
../../../tools/data_source/upload.xml