mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Drop unused run_tests.sh options
Use planemo to test individual tools as needed. Fixes https://github.com/galaxyproject/galaxy/issues/15231
This commit is contained in:
+6
-43
@@ -4,9 +4,6 @@ cd "$(dirname "$0")"
|
||||
|
||||
show_help() {
|
||||
cat <<EOF
|
||||
'${0##*/} -id bbb' for testing one tool with id 'bbb' ('bbb' is the tool id)
|
||||
'${0##*/} -sid ccc' for testing one section with sid 'ccc' ('ccc' is the string after 'section::')
|
||||
'${0##*/} -list' for listing all the tool ids
|
||||
'${0##*/} -api (test_path)' for running all the test scripts in the ./lib/galaxy_test/api directory, test_path
|
||||
can be pytest selector
|
||||
'${0##*/} -cwl (test_path)' for running all the test scripts in the ./lib/galaxy_test/api/cwl directory, test_path
|
||||
@@ -14,7 +11,6 @@ cat <<EOF
|
||||
'${0##*/} -integration (test_path)' for running all integration test scripts in the ./test/integration directory, test_path
|
||||
can be pytest selector
|
||||
'${0##*/} -toolshed (test_path)' for running all the test scripts in the ./lib/tool_shed/test directory
|
||||
'${0##*/} -installed' for running tests of Tool Shed installed tools
|
||||
'${0##*/} -main' for running tests of tools shipped with Galaxy
|
||||
'${0##*/} -framework' for running through example tool tests testing framework features in test/functional/tools"
|
||||
'${0##*/} -framework -id toolid' for testing one framework tool (in test/functional/tools/) with id 'toolid'
|
||||
@@ -297,7 +293,6 @@ if [ -n "$BUILD_NUMBER" ]; then
|
||||
xunit_report_file="xunit-${BUILD_NUMBER}.xml"
|
||||
fi
|
||||
|
||||
run_default_functional_tests="1"
|
||||
# Loop through and consume the main arguments.
|
||||
# Some loops will consume more than one argument (there are extra "shift"s in some cases).
|
||||
while :
|
||||
@@ -307,10 +302,6 @@ do
|
||||
show_help
|
||||
exit 0
|
||||
;;
|
||||
-l|-list|--list)
|
||||
show_list
|
||||
exit 0
|
||||
;;
|
||||
-id|--id)
|
||||
if [ $# -gt 1 ]; then
|
||||
test_id=$2;
|
||||
@@ -320,15 +311,6 @@ do
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
-s|-sid|--sid)
|
||||
if [ $# -gt 1 ]; then
|
||||
section_id=$2
|
||||
shift 2
|
||||
else
|
||||
echo "--sid requires an argument" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
-a|-api|--api)
|
||||
GALAXY_TEST_USE_HIERARCHICAL_OBJECT_STORE="True" # Run these tests with a non-trivial object store.
|
||||
export GALAXY_TEST_USE_HIERARCHICAL_OBJECT_STORE
|
||||
@@ -409,32 +391,18 @@ do
|
||||
framework_test=1;
|
||||
shift 1
|
||||
;;
|
||||
-main|-main_tools|--main_tools)
|
||||
GALAXY_TEST_TOOL_CONF="lib/galaxy/config/sample/tool_conf.xml.sample"
|
||||
marker="tool"
|
||||
report_file="run_framework_tests.html"
|
||||
framework_test=1;
|
||||
shift 1
|
||||
;;
|
||||
-d|-data_managers|--data_managers)
|
||||
marker="data_manager"
|
||||
report_file="run_data_managers_tests.html"
|
||||
data_managers_test=1;
|
||||
shift 1
|
||||
;;
|
||||
-m|-migrated|--migrated)
|
||||
GALAXY_TEST_TOOL_CONF="config/migrated_tools_conf.xml"
|
||||
-main|-main_tools|--main_tools)
|
||||
GALAXY_TEST_TOOL_CONF="lib/galaxy/config/sample/tool_conf.xml.sample"
|
||||
marker="tool"
|
||||
report_file="run_migrated_tests.html"
|
||||
migrated_test=1;
|
||||
shift
|
||||
;;
|
||||
-installed|--installed)
|
||||
GALAXY_TEST_TOOL_CONF="config/shed_tool_conf.xml"
|
||||
marker="tool"
|
||||
report_file="run_installed_tests.html"
|
||||
installed_test=1;
|
||||
shift
|
||||
report_file="run_framework_tests.html"
|
||||
framework_test=1;
|
||||
shift 1
|
||||
;;
|
||||
-r|--report_file)
|
||||
if [ $# -gt 1 ]; then
|
||||
@@ -555,7 +523,6 @@ do
|
||||
--)
|
||||
# Do not default to running the functional tests in this case, caller
|
||||
# is opting to run specific tests so don't interfere with that by default.
|
||||
unset run_default_functional_tests;
|
||||
shift
|
||||
break
|
||||
;;
|
||||
@@ -589,7 +556,7 @@ fi
|
||||
|
||||
setup_python
|
||||
|
||||
if [ -n "$framework_test" ] || [ -n "$installed_test" ] || [ -n "$migrated_test" ] || [ -n "$data_managers_test" ] ; then
|
||||
if [ -n "$framework_test" ] || [ -n "$data_managers_test" ] ; then
|
||||
if [ -n "$test_id" ]; then
|
||||
selector="-k $test_id"
|
||||
else
|
||||
@@ -602,16 +569,12 @@ elif [ -n "$toolshed_script" ]; then
|
||||
extra_args="$toolshed_script"
|
||||
elif [ -n "$api_script" ]; then
|
||||
extra_args="$api_script"
|
||||
elif [ -n "$section_id" ]; then
|
||||
extra_args=$(python tool_list.py "$section_id")
|
||||
elif [ -n "$unit_extra" ]; then
|
||||
extra_args="$unit_extra"
|
||||
elif [ -n "$integration_extra" ]; then
|
||||
extra_args="$integration_extra"
|
||||
elif [ -n "$test_target" ] ; then
|
||||
extra_args="$test_target"
|
||||
elif [ -n "$run_default_functional_tests" ] ; then
|
||||
extra_args='--exclude="^get" functional'
|
||||
else
|
||||
extra_args=""
|
||||
fi
|
||||
|
||||
@@ -1,85 +0,0 @@
|
||||
import os
|
||||
import sys
|
||||
|
||||
# read tool_conf.xml to get all the tool xml file names
|
||||
onoff = 1
|
||||
tool_list = []
|
||||
tool_conf_file = os.environ.get("GALAXY_TEST_TOOL_CONF", None)
|
||||
|
||||
if tool_conf_file is None:
|
||||
for possible_tool_file in ["config/tool_conf.xml", "tool_conf.xml", "config/tool_conf.xml.sample"]:
|
||||
tool_conf_file = possible_tool_file
|
||||
if os.path.isfile(possible_tool_file):
|
||||
break
|
||||
|
||||
if tool_conf_file is None or not os.path.isfile(tool_conf_file):
|
||||
sys.stderr.write(f"Tool config file not found: {tool_conf_file}\n")
|
||||
sys.exit(1)
|
||||
|
||||
for line in open(tool_conf_file):
|
||||
if line.find("<!--") != -1:
|
||||
onoff = 0
|
||||
if line.find("file") != -1 and onoff == 1:
|
||||
strs = line.split('"')
|
||||
tool_list.append(strs[1])
|
||||
if line.find("<section") != -1 and onoff == 1:
|
||||
keys = line.strip().split('"')
|
||||
n = 0
|
||||
strtmp = "section::"
|
||||
while n < len(keys):
|
||||
if keys[n].find("id") != -1:
|
||||
strtmp = strtmp + keys[n + 1]
|
||||
if keys[n].find("name") != -1:
|
||||
strtmp = strtmp + keys[n + 1] + "-"
|
||||
n = n + 1
|
||||
tool_list.append(strtmp.replace(" ", "_"))
|
||||
if line.find("-->") != -1:
|
||||
onoff = 1
|
||||
|
||||
# read tool info from every tool xml file
|
||||
name = []
|
||||
id = []
|
||||
desc = []
|
||||
tool_infos = []
|
||||
for tool in tool_list:
|
||||
if tool.find("section") != -1:
|
||||
tool_info = dict()
|
||||
tool_info["id"] = tool
|
||||
tool_infos.append(tool_info)
|
||||
if os.path.exists("tools/" + tool):
|
||||
for line in open("tools/" + tool):
|
||||
if line.find("<tool ") != -1 and line.find("id") != -1:
|
||||
keys = line.strip().split('"')
|
||||
tool_info = dict()
|
||||
tool_info["desc"] = ""
|
||||
for n in range(len(keys) - 1):
|
||||
if " id=" in keys[n]:
|
||||
tool_info["id"] = keys[n + 1].replace(" ", "_")
|
||||
if " name=" in keys[n]:
|
||||
tool_info["name"] = keys[n + 1]
|
||||
if " description=" in keys[n]:
|
||||
tool_info["desc"] = keys[n + 1]
|
||||
tool_infos.append(tool_info)
|
||||
break
|
||||
|
||||
flag = 0
|
||||
if len(sys.argv) == 1:
|
||||
for tool_info in tool_infos:
|
||||
if tool_info["id"].find("section") != -1:
|
||||
print(
|
||||
"==========================================================================================================================================="
|
||||
)
|
||||
print("{:<45}\t{:<40}\t{}".format("id", "name", tool_info["id"]))
|
||||
print(
|
||||
"- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -"
|
||||
)
|
||||
else:
|
||||
print("{:<45}\t{:<40}".format(tool_info["id"], tool_info["name"]))
|
||||
else:
|
||||
for tool_info in tool_infos:
|
||||
if tool_info["id"].find("section") != -1:
|
||||
flag = 0
|
||||
elif flag == 1:
|
||||
print(" functional.test_toolbox:TestForTool_%s" % tool_info["id"], end=" ")
|
||||
if tool_info["id"].replace("section::", "") == sys.argv[1]:
|
||||
flag = 1
|
||||
Reference in New Issue
Block a user