Skip to content

Commit

Permalink
Drop scripts/function_tests.py
Browse files Browse the repository at this point in the history
  • Loading branch information
mvdbeek authored and nsoranzo committed Jun 28, 2022
1 parent 38dbc7d commit a627f02
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 171 deletions.
53 changes: 14 additions & 39 deletions run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

cd "$(dirname "$0")"

rm -f run_functional_tests.log

show_help() {
cat <<EOF
'${0##*/} -id bbb' for testing one tool with id 'bbb' ('bbb' is the tool id)
Expand All @@ -27,7 +25,7 @@ cat <<EOF
'${0##*/} -selenium (test_selector)' for running specified selenium web tests (using pytest selector syntax)
This wrapper script largely serves as a point documentation and convenience for
running Galaxy's Python tests. Most Python tests shipped with Galaxy can be run with
running Galaxy's Python tests. All Python tests shipped with Galaxy can be run with
pytest directly. Galaxy's client unit tests can be run with ``make client-test``
or ``yarn`` directly as documented in detail in ``client/README.md``.
Expand All @@ -52,7 +50,7 @@ The main test types are as follows:
framework twill to test ToolShed related functionality. These are
located in lib/tool_shed/test.
Python testing is mostly done via pytest. Specific tests can be selected
Python testing is done via pytest. Specific tests can be selected
using the pytest selector syntax is described at https://docs.pytest.org/en/latest/usage.html.
The spots these selectors can be used is described in the above usage documentation
Expand Down Expand Up @@ -152,7 +150,7 @@ Extra options:
--no_cleanup Do not delete temp files for Python functional tests
(-toolshed, -framework, etc...)
--coverage Generate a test coverage report. This option currently
should work with every test that uses pytest, but the
works with every python test, but the
results may not be reliable with selenium or other
frameworks that primarily test the client.
--debug On python test error or failure invoke a pdb shell for
Expand Down Expand Up @@ -270,7 +268,7 @@ exists() {
}

debug=""
test_script="./scripts/functional_tests.py"
test_script="pytest"
report_file="run_functional_tests.html"
coverage_arg=""
xunit_report_file=""
Expand Down Expand Up @@ -327,7 +325,6 @@ do
export GALAXY_TEST_USE_HIERARCHICAL_OBJECT_STORE
GALAXY_TEST_TOOL_CONF="lib/galaxy/config/sample/tool_conf.xml.sample,test/functional/tools/samples_tool_conf.xml"
marker="not cwl_conformance"
test_script="pytest"
report_file="./run_api_tests.html"
if [ $# -gt 1 ]; then
api_script=$2
Expand All @@ -342,7 +339,6 @@ do
export GALAXY_TEST_USE_HIERARCHICAL_OBJECT_STORE
GALAXY_TEST_TOOL_CONF="lib/galaxy/config/sample/tool_conf.xml.sample,test/functional/tools/samples_tool_conf.xml"
marker="cwl_conformance"
test_script="pytest"
report_file="./run_cwl_tests.html"
generate_cwl_conformance_tests=1
if [ $# -gt 1 ]; then
Expand All @@ -355,7 +351,6 @@ do
;;
-selenium|--selenium)
GALAXY_TEST_TOOL_CONF="lib/galaxy/config/sample/tool_conf.xml.sample,test/functional/tools/samples_tool_conf.xml"
test_script="pytest"
report_file="./run_selenium_tests.html"
skip_client_build=""
if [ $# -gt 1 ]; then
Expand All @@ -367,7 +362,6 @@ do
fi
;;
-t|-toolshed|--toolshed)
test_script="./lib/tool_shed/test/functional_tests.py"
report_file="run_toolshed_tests.html"
if [ $# -gt 1 ]; then
toolshed_script=$2
Expand Down Expand Up @@ -402,38 +396,33 @@ do
-f|-framework|--framework)
GALAXY_TEST_TOOL_CONF="test/functional/tools/samples_tool_conf.xml"
marker="tool"
test_script="pytest"
report_file="run_framework_tests.html"
framework_test=1;
shift 1
;;
-main|-main_tools|--main_tools)
GALAXY_TEST_TOOL_CONF="lib/galaxy/config/sample/tool_conf.xml.sample"
marker="tool"
test_script="pytest"
report_file="run_framework_tests.html"
framework_test=1;
shift 1
;;
-d|-data_managers|--data_managers)
marker="data_manager"
test_script="pytest"
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"
marker="tool"
test_script="pytest"
report_file="run_migrated_tests.html"
migrated_test=1;
shift
;;
-installed|--installed)
GALAXY_TEST_TOOL_CONF="config/shed_tool_conf.xml"
marker="tool"
test_script="pytest"
report_file="run_installed_tests.html"
installed_test=1;
shift
Expand Down Expand Up @@ -501,7 +490,6 @@ do
;;
-u|-unit|--unit)
report_file="run_unit_tests.html"
test_script="pytest"
unit_extra='--doctest-modules --ignore lib/galaxy/web/proxy/js/node_modules/ --ignore lib/tool_shed/webapp/controllers --ignore lib/galaxy/jobs/runners/chronos.py --ignore lib/tool_shed/webapp/model/migrate --ignore lib/galaxy/tools/bundled --ignore lib/galaxy_test --ignore lib/tool_shed/test --ignore lib/galaxy/model/migrations/alembic'
generate_cwl_conformance_tests=1
if [ $# -gt 1 ]; then
Expand All @@ -514,7 +502,6 @@ do
;;
-i|-integration|--integration)
GALAXY_TEST_TOOL_CONF="lib/galaxy/config/sample/tool_conf.xml.sample,test/functional/tools/samples_tool_conf.xml"
test_script="pytest"
report_file="./run_integration_tests.html"
if [ $# -gt 1 ]; then
integration_extra=$2
Expand Down Expand Up @@ -621,41 +608,29 @@ else
fi

if [ -n "$xunit_report_file" ]; then
if [ "$test_script" = 'pytest' ]; then
xunit_args="--junit-xml $xunit_report_file"
else
xunit_args="--with-xunit --xunit-file $xunit_report_file"
fi
xunit_args="--junit-xml $xunit_report_file"
else
xunit_args=""
fi
if [ -n "$structured_data_report_file" ]; then
if [ "$test_script" = 'pytest' ]; then
structured_data_args="--json-report --json-report-file $structured_data_report_file"
else
structured_data_args="--with-structureddata --structured-data-file $structured_data_report_file"
fi
structured_data_args="--json-report --json-report-file $structured_data_report_file"
else
structured_data_args=""
fi
if [ -n "$generate_cwl_conformance_tests" ]; then
make generate-cwl-conformance-tests
fi
export GALAXY_TEST_TOOL_CONF
if [ "$test_script" = 'pytest' ]; then
if [ "$coverage_arg" = '--with-coverage' ]; then
coverage_arg="--cov-report xml --cov-report term --cov=lib"
fi
if [ -n "$marker" ]; then
marker_args=(-m "$marker")
else
marker_args=()
fi
args=(-v $debug $structured_data_args --html "$report_file" --self-contained-html $coverage_arg $xunit_args $extra_args "${marker_args[@]}" "$@")
"$test_script" "${args[@]}"
if [ "$coverage_arg" = '--with-coverage' ]; then
coverage_arg="--cov-report xml --cov-report term --cov=lib"
fi
if [ -n "$marker" ]; then
marker_args=(-m "$marker")
else
python "$test_script" $coverage_arg -v --html-report-file $report_file $xunit_args $structured_data_args $extra_args "$@"
marker_args=()
fi
args=(-v $debug $structured_data_args --html "$report_file" --self-contained-html $coverage_arg $xunit_args $extra_args "${marker_args[@]}" "$@")
"$test_script" "${args[@]}"
exit_status=$?
echo "Testing complete. HTML report is in \"$report_file\"." 1>&2
if [ "$structured_data_html" = '1' ]; then
Expand Down
132 changes: 0 additions & 132 deletions scripts/functional_tests.py

This file was deleted.

0 comments on commit a627f02

Please sign in to comment.