diff --git a/.ci/validate_test_tools.sh b/.ci/validate_test_tools.sh index 9b43e7a6c46..258799dc95d 100755 --- a/.ci/validate_test_tools.sh +++ b/.ci/validate_test_tools.sh @@ -1,11 +1,11 @@ #!/bin/sh -cd `dirname $0`/.. +cd "$(dirname "$0")"/.. xsd_path="lib/galaxy/tools/xsd/galaxy.xsd" # Lint the XSD xmllint --noout "$xsd_path" test_tools_path='test/functional/tools' -tool_files_list=$(ls "$test_tools_path"/*xml | grep -v '_conf.xml$') +tool_files_list=$(ls "$test_tools_path"/*.xml | grep -v '_conf.xml$') sh scripts/validate_tools.sh $tool_files_list diff --git a/.circleci/config.yml b/.circleci/config.yml index 7cac35497e7..32dfbce7036 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -25,7 +25,7 @@ variables: jobs: get_code: docker: - - image: circleci/python:2.7.15 + - image: circleci/python:3.5 <<: *set_workdir steps: # Replace standard code checkout with shallow clone to speed things up. @@ -83,7 +83,7 @@ jobs: - ~/repo py27_lint: docker: - - image: circleci/python:2.7.15 + - image: circleci/python:2.7 <<: *set_workdir steps: - *restore_repo_cache @@ -91,7 +91,7 @@ jobs: - run: tox -e py27-lint py27_unit: docker: - - image: circleci/python:2.7.15 + - image: circleci/python:2.7 <<: *set_workdir steps: - *restore_repo_cache @@ -99,7 +99,7 @@ jobs: - run: tox -e py27-unit py27_docstring: docker: - - image: circleci/python:2.7.15 + - image: circleci/python:2.7 <<: *set_workdir steps: - *restore_repo_cache @@ -107,7 +107,7 @@ jobs: - run: tox -e py27-lint_docstring_include_list py27_first_startup: docker: - - image: circleci/python:2.7.15 + - image: circleci/python:2.7 <<: *set_workdir steps: - *restore_repo_cache @@ -139,14 +139,14 @@ jobs: <<: *set_workdir steps: - *restore_repo_cache - - *install_tox - run: sudo apt-get update # For uwsgi - run: sudo apt-get install -y libpython3.5-dev + - *install_tox - run: tox -e py35-first_startup validate_test_tools: docker: - - image: circleci/python:2.7.15 + - image: circleci/python:3.5 <<: *set_workdir steps: - *restore_repo_cache @@ -160,10 +160,11 @@ jobs: <<: *set_workdir steps: - *restore_repo_cache - - run: bash packages/test.sh + - *install_tox + - run: tox -e test_galaxy_packages check_py3_compatibility: docker: - - image: circleci/python:2.7.15 + - image: circleci/python:3.5 <<: *set_workdir steps: - *restore_repo_cache diff --git a/create_db.sh b/create_db.sh index 8c77eff858d..3c34dd6c3e5 100755 --- a/create_db.sh +++ b/create_db.sh @@ -1,9 +1,9 @@ #!/bin/sh -cd `dirname $0` +cd "$(dirname "$0")" . ./scripts/common_startup_functions.sh setup_python -python ./scripts/create_db.py $@ +python ./scripts/create_db.py "$@" diff --git a/extract_dataset_parts.sh b/extract_dataset_parts.sh index f17ced8bcd5..7591b4a5ae3 100755 --- a/extract_dataset_parts.sh +++ b/extract_dataset_parts.sh @@ -1,6 +1,6 @@ #!/bin/sh -cd `dirname $0` +cd "$(dirname "$0")" . ./scripts/common_startup_functions.sh @@ -9,5 +9,5 @@ setup_python for file in $1/split_info*.json do # echo processing $file - python ./scripts/extract_dataset_part.py $file + python ./scripts/extract_dataset_part.py "$file" done diff --git a/lib/galaxy/dependencies/pipfiles/default/Pipfile b/lib/galaxy/dependencies/pipfiles/default/Pipfile index 02777c6b6b6..0a0bb133704 100644 --- a/lib/galaxy/dependencies/pipfiles/default/Pipfile +++ b/lib/galaxy/dependencies/pipfiles/default/Pipfile @@ -15,6 +15,7 @@ mock = "*" NoseHTML = "*" pygithub3 = {version = "*", markers = "python_version < '3'"} pytest = "*" +pytest-cov = "*" pytest-html = "*" pytest-pythonpath = "*" pytest-postgresql = "*" diff --git a/lib/galaxy/dependencies/pipfiles/default/pinned-dev-requirements.txt b/lib/galaxy/dependencies/pipfiles/default/pinned-dev-requirements.txt index c95d3ff3274..1863f4aad97 100644 --- a/lib/galaxy/dependencies/pipfiles/default/pinned-dev-requirements.txt +++ b/lib/galaxy/dependencies/pipfiles/default/pinned-dev-requirements.txt @@ -10,13 +10,14 @@ chardet==3.0.4 commonmark==0.9.0 configparser==3.7.4 ; python_version < '3.2' contextlib2==0.5.5 ; python_version < '3.5' +coverage==4.5.3 docutils==0.14 funcsigs==1.0.2 ; python_version < '3.3' future==0.17.1 gunicorn==19.9.0 idna==2.8 imagesize==1.1.0 -importlib-metadata==0.17 +importlib-metadata==0.18 jinja2==2.10.1 lxml==4.3.4 markdown==2.6.11 @@ -31,16 +32,17 @@ pathlib2==2.3.2 ; python_version < '3' pathtools==0.1.2 pluggy==0.12.0 port-for==0.4 -psutil==5.6.2 +psutil==5.6.3 py==1.8.0 pygithub3==0.5.1 ; python_version < '3' pygments==2.4.2 pyparsing==2.4.0 +pytest-cov==2.7.1 pytest-html==1.20.0 pytest-metadata==1.8.0 pytest-postgresql==1.4.1 pytest-pythonpath==0.7.3 -pytest==4.6.2 +pytest==4.6.3 pytz==2019.1 pyyaml==5.1.1 recommonmark==0.5.0 diff --git a/lib/galaxy/dependencies/pipfiles/default/pinned-requirements.txt b/lib/galaxy/dependencies/pipfiles/default/pinned-requirements.txt index a8afc0745a0..4bc74ec1fe7 100644 --- a/lib/galaxy/dependencies/pipfiles/default/pinned-requirements.txt +++ b/lib/galaxy/dependencies/pipfiles/default/pinned-requirements.txt @@ -29,7 +29,7 @@ bleach==3.1.0 boltons==19.1.0 boto3==1.9.114 boto==2.49.0 -botocore==1.12.165 +botocore==1.12.167 bx-python==0.8.2 bz2file==0.98 ; python_version < '3.3' cachecontrol==0.11.7 @@ -118,7 +118,7 @@ pathlib2==2.3.2 ; python_version < '3' pbr==5.2.1 prettytable==0.7.2 prov==1.5.1 -psutil==5.6.2 +psutil==5.6.3 pulsar-galaxy-lib==0.12.1 pyasn1-modules==0.2.5 pyasn1==0.4.5 diff --git a/lib/galaxy/tools/test.py b/lib/galaxy/tools/test.py index a4acd0f5ee2..e8c74b6e725 100644 --- a/lib/galaxy/tools/test.py +++ b/lib/galaxy/tools/test.py @@ -21,7 +21,7 @@ log = logging.getLogger(__name__) @nottest def parse_tests(tool, tests_source): """ - Build ToolTestBuilder objects for each "" elements and + Build ToolTestDescription objects for each "" elements and return default interactor (if any). """ raw_tests_dict = tests_source.parse_tests_to_dict() diff --git a/packages/test.sh b/packages/test.sh index 5deb29bf919..d311a4d5ed1 100755 --- a/packages/test.sh +++ b/packages/test.sh @@ -5,8 +5,9 @@ set -e # Change to packages directory. cd "$(dirname "$0")" +# Use a throw-away virtualenv TEST_PYTHON=${TEST_PYTHON:-"python"} -TEST_ENV_DIR=${TEST_ENV_DIR:-`mktemp -d -t gxpkgtestenvXXXXXX`} +TEST_ENV_DIR=${TEST_ENV_DIR:-$(mktemp -d -t gxpkgtestenvXXXXXX)} virtualenv -p "$TEST_PYTHON" "$TEST_ENV_DIR" . "${TEST_ENV_DIR}/bin/activate" @@ -31,13 +32,11 @@ for ((i=0; i<${#PACKAGE_DIRS[@]}; i++)); do cd "$package_dir" pip install -e . - if [ "$package_dir" = "util" ]; - then + if [ "$package_dir" = "util" ]; then pip install -e '.[template,jstree]' fi - if [[ "$run_tests" == "1" ]]; - then + if [[ "$run_tests" == "1" ]]; then pytest --doctest-modules galaxy tests fi cd .. diff --git a/run_tests.sh b/run_tests.sh index 6f94c4b273a..1236e8742cc 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -1,7 +1,6 @@ #!/bin/sh -pwd_dir=$(pwd) -cd `dirname $0` +cd "$(dirname "$0")" rm -f run_functional_tests.log @@ -318,8 +317,8 @@ then -e "GALAXY_TEST_DATABASE_TYPE=$db_type" \ -e "LC_ALL=C" \ --rm \ - -v `pwd`:/galaxy \ - -v `pwd`/test/docker/base/run_test_wrapper.sh:/usr/local/bin/run_test_wrapper.sh $DOCKER_IMAGE "$@" + -v "$(pwd)":/galaxy \ + -v "$(pwd)"/test/docker/base/run_test_wrapper.sh:/usr/local/bin/run_test_wrapper.sh "$DOCKER_IMAGE" "$@" exit $? fi @@ -374,7 +373,6 @@ do api_script="./test/api" shift 1 fi - coverage_file="api_coverage.xml" ;; -selenium|--selenium) GALAXY_TEST_TOOL_CONF="config/tool_conf.xml.sample,test/functional/tools/samples_tool_conf.xml" @@ -412,15 +410,15 @@ do shift ;; --external_url) - GALAXY_TEST_EXTERNAL=$2 + export GALAXY_TEST_EXTERNAL=$2 shift 2 ;; --external_master_key) - GALAXY_CONFIG_MASTER_KEY=$2 + export GALAXY_CONFIG_MASTER_API_KEY=$2 shift 2 ;; --external_user_key) - GALAXY_TEST_USER_API_KEY=$2 + export GALAXY_TEST_USER_API_KEY=$2 shift 2 ;; -f|-framework|--framework) @@ -428,7 +426,6 @@ do marker="-m tool" test_script="pytest" report_file="run_framework_tests.html" - coverage_file="framework_coverage.xml" framework_test=1; shift 1 ;; @@ -437,7 +434,6 @@ do marker="-m tool" test_script="pytest" report_file="run_framework_tests.html" - coverage_file="main_tools_coverage.xml" framework_test=1; shift 1 ;; @@ -445,7 +441,6 @@ do marker="-m data_manager" test_script="pytest" report_file="run_data_managers_tests.html" - coverage_file="data_managers_coverage.xml" data_managers_test=1; shift 1 ;; @@ -454,7 +449,6 @@ do marker="-m tool" test_script="pytest" report_file="run_migrated_tests.html" - coverage_file="migrated_coverage.xml" migrated_test=1; shift ;; @@ -463,7 +457,6 @@ do marker="-m tool" test_script="pytest" report_file="run_installed_tests.html" - coverage_file="installed_coverage.xml" installed_test=1; shift ;; @@ -503,7 +496,6 @@ do # Must have coverage installed (try `which coverage`) - only valid with --unit # for now. Would be great to get this to work with functional tests though. coverage_arg="--with-coverage" - NOSE_WITH_COVERAGE=true shift ;; --debug) @@ -523,7 +515,6 @@ do unit_extra="$unit_extra lib test/unit" shift 1 fi - coverage_file="unit_coverage.xml" ;; -i|-integration|--integration) GALAXY_TEST_TOOL_CONF="config/tool_conf.xml.sample,test/functional/tools/samples_tool_conf.xml" @@ -535,7 +526,6 @@ do else integration_extra="./test/integration" shift 1 - coverage_file="integration_coverage.xml" fi ;; --no_cleanup) @@ -616,7 +606,7 @@ elif [ -n "$toolshed_script" ]; then elif [ -n "$api_script" ]; then extra_args="$api_script" elif [ -n "$section_id" ]; then - extra_args=`python tool_list.py $section_id` + extra_args=$(python tool_list.py "$section_id") elif [ -n "$unit_extra" ]; then extra_args="$unit_extra" elif [ -n "$integration_extra" ]; then @@ -645,8 +635,8 @@ else fi export GALAXY_TEST_TOOL_CONF if [ "$test_script" = 'pytest' ]; then - if [ "$coverage_arg" = "--with_coverage" ]; then - coverage_arg="--cov-report term --cov-report xml:cov-unit.xml --cov=lib" + if [ "$coverage_arg" = '--with-coverage' ]; then + coverage_arg="--cov-report term --cov=lib" fi "$test_script" -v --html "$report_file" $coverage_arg $xunit_args $extra_args "$@" else diff --git a/scripts/cleanup_datasets/delete_datasets.sh b/scripts/cleanup_datasets/delete_datasets.sh index 501c234a8d5..e7dfb3f6874 100644 --- a/scripts/cleanup_datasets/delete_datasets.sh +++ b/scripts/cleanup_datasets/delete_datasets.sh @@ -1,4 +1,4 @@ #!/bin/sh -cd `dirname $0`/../.. -python ./scripts/cleanup_datasets/cleanup_datasets.py -d 10 -6 -r $@ >> ./scripts/cleanup_datasets/delete_datasets.log +cd "$(dirname "$0")"/../.. +python ./scripts/cleanup_datasets/cleanup_datasets.py -d 10 -6 -r "$@" >> ./scripts/cleanup_datasets/delete_datasets.log diff --git a/scripts/cleanup_datasets/delete_userless_histories.sh b/scripts/cleanup_datasets/delete_userless_histories.sh index 72d68db72ec..9bb8c70882f 100644 --- a/scripts/cleanup_datasets/delete_userless_histories.sh +++ b/scripts/cleanup_datasets/delete_userless_histories.sh @@ -1,4 +1,4 @@ #!/bin/sh -cd `dirname $0`/../.. -python ./scripts/cleanup_datasets/cleanup_datasets.py -d 10 -1 $@ >> ./scripts/cleanup_datasets/delete_userless_histories.log +cd "$(dirname "$0")"/../.. +python ./scripts/cleanup_datasets/cleanup_datasets.py -d 10 -1 "$@" >> ./scripts/cleanup_datasets/delete_userless_histories.log diff --git a/scripts/cleanup_datasets/populate_uuid.sh b/scripts/cleanup_datasets/populate_uuid.sh index ac2028462cf..c12c5240c19 100644 --- a/scripts/cleanup_datasets/populate_uuid.sh +++ b/scripts/cleanup_datasets/populate_uuid.sh @@ -1,5 +1,5 @@ #!/bin/sh -cd `dirname $0`/../.. +cd "$(dirname "$0")"/../.. export PYTHONPATH=./lib/ -python ./scripts/cleanup_datasets/populate_uuid.py ./config/galaxy.ini $@ +python ./scripts/cleanup_datasets/populate_uuid.py ./config/galaxy.ini "$@" diff --git a/scripts/cleanup_datasets/purge_datasets.sh b/scripts/cleanup_datasets/purge_datasets.sh index e4405015c50..6d5c12bb880 100644 --- a/scripts/cleanup_datasets/purge_datasets.sh +++ b/scripts/cleanup_datasets/purge_datasets.sh @@ -1,4 +1,4 @@ #!/bin/sh -cd `dirname $0`/../.. -python ./scripts/cleanup_datasets/cleanup_datasets.py -d 10 -3 -r $@ >> ./scripts/cleanup_datasets/purge_datasets.log +cd "$(dirname "$0")"/../.. +python ./scripts/cleanup_datasets/cleanup_datasets.py -d 10 -3 -r "$@" >> ./scripts/cleanup_datasets/purge_datasets.log diff --git a/scripts/cleanup_datasets/purge_folders.sh b/scripts/cleanup_datasets/purge_folders.sh index ff970d0ac8e..d02b7671e6f 100644 --- a/scripts/cleanup_datasets/purge_folders.sh +++ b/scripts/cleanup_datasets/purge_folders.sh @@ -1,4 +1,4 @@ #!/bin/sh -cd `dirname $0`/../.. -python ./scripts/cleanup_datasets/cleanup_datasets.py -d 10 -5 -r $@ >> ./scripts/cleanup_datasets/purge_folders.log +cd "$(dirname "$0")"/../.. +python ./scripts/cleanup_datasets/cleanup_datasets.py -d 10 -5 -r "$@" >> ./scripts/cleanup_datasets/purge_folders.log diff --git a/scripts/cleanup_datasets/purge_histories.sh b/scripts/cleanup_datasets/purge_histories.sh index 66e9f3d285f..8c7ff274d4a 100644 --- a/scripts/cleanup_datasets/purge_histories.sh +++ b/scripts/cleanup_datasets/purge_histories.sh @@ -1,4 +1,4 @@ #!/bin/sh -cd `dirname $0`/../.. -python ./scripts/cleanup_datasets/cleanup_datasets.py -d 10 -2 -r $@ >> ./scripts/cleanup_datasets/purge_histories.log +cd "$(dirname "$0")"/../.. +python ./scripts/cleanup_datasets/cleanup_datasets.py -d 10 -2 -r "$@" >> ./scripts/cleanup_datasets/purge_histories.log diff --git a/scripts/cleanup_datasets/purge_libraries.sh b/scripts/cleanup_datasets/purge_libraries.sh index 6a96b30268d..9e66e05cb5c 100644 --- a/scripts/cleanup_datasets/purge_libraries.sh +++ b/scripts/cleanup_datasets/purge_libraries.sh @@ -1,4 +1,4 @@ #!/bin/sh -cd `dirname $0`/../.. -python ./scripts/cleanup_datasets/cleanup_datasets.py -d 10 -4 -r $@ >> ./scripts/cleanup_datasets/purge_libraries.log +cd "$(dirname "$0")"/../.. +python ./scripts/cleanup_datasets/cleanup_datasets.py -d 10 -4 -r "$@" >> ./scripts/cleanup_datasets/purge_libraries.log diff --git a/scripts/cleanup_datasets/update_metadata.sh b/scripts/cleanup_datasets/update_metadata.sh index 7933a0d9ebb..a78325d8ee7 100644 --- a/scripts/cleanup_datasets/update_metadata.sh +++ b/scripts/cleanup_datasets/update_metadata.sh @@ -6,4 +6,4 @@ . ./scripts/get_python.sh . ./setup_paths.sh -$GALAXY_PYTHON ./scripts/cleanup_datasets/update_metadata.py ./config/galaxy.ini $@ +"$GALAXY_PYTHON" ./scripts/cleanup_datasets/update_metadata.py ./config/galaxy.ini "$@" diff --git a/scripts/maintenance.sh b/scripts/maintenance.sh index 8ca4771ed54..e45d11bb603 100755 --- a/scripts/maintenance.sh +++ b/scripts/maintenance.sh @@ -6,7 +6,7 @@ set -e display_help(){ - scriptname=`basename $0` + scriptname=$(basename "$0") printf "./$scriptname [--help] [--no-dry-run] [--days 10] Will run the galaxy cleanup scripts in the recommend order. By default a 'dry-run' is started. Specify --no-dry-run to do the actual cleanup. @@ -52,7 +52,7 @@ do esac done -cd "$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)"/../ +cd "$(dirname "$0")"/.. . scripts/common_startup_functions.sh diff --git a/scripts/migrate_tools/0002_tools.sh b/scripts/migrate_tools/0002_tools.sh index 926aba9529d..7262196b5a9 100644 --- a/scripts/migrate_tools/0002_tools.sh +++ b/scripts/migrate_tools/0002_tools.sh @@ -1,4 +1,4 @@ #!/bin/sh -cd `dirname $0`/../.. -python ./scripts/migrate_tools/migrate_tools.py 0002_tools.xml $@ +cd "$(dirname "$0")"/../.. +python ./scripts/migrate_tools/migrate_tools.py 0002_tools.xml "$@" diff --git a/scripts/migrate_tools/0003_tools.sh b/scripts/migrate_tools/0003_tools.sh index dfc3bde56b3..f8a1ba8bb16 100644 --- a/scripts/migrate_tools/0003_tools.sh +++ b/scripts/migrate_tools/0003_tools.sh @@ -1,4 +1,4 @@ #!/bin/sh -cd `dirname $0`/../.. -python ./scripts/migrate_tools/migrate_tools.py 0003_tools.xml $@ +cd "$(dirname "$0")"/../.. +python ./scripts/migrate_tools/migrate_tools.py 0003_tools.xml "$@" diff --git a/scripts/migrate_tools/0004_tools.sh b/scripts/migrate_tools/0004_tools.sh index 40b76956fa2..7ae608f3683 100644 --- a/scripts/migrate_tools/0004_tools.sh +++ b/scripts/migrate_tools/0004_tools.sh @@ -1,4 +1,4 @@ #!/bin/sh -cd `dirname $0`/../.. -python ./scripts/migrate_tools/migrate_tools.py 0004_tools.xml $@ +cd "$(dirname "$0")"/../.. +python ./scripts/migrate_tools/migrate_tools.py 0004_tools.xml "$@" diff --git a/scripts/migrate_tools/0005_tools.sh b/scripts/migrate_tools/0005_tools.sh index c9f1f3c61d6..da7f9c09098 100644 --- a/scripts/migrate_tools/0005_tools.sh +++ b/scripts/migrate_tools/0005_tools.sh @@ -1,4 +1,4 @@ #!/bin/sh -cd `dirname $0`/../.. -python ./scripts/migrate_tools/migrate_tools.py 0005_tools.xml $@ +cd "$(dirname "$0")"/../.. +python ./scripts/migrate_tools/migrate_tools.py 0005_tools.xml "$@" diff --git a/scripts/migrate_tools/0006_tools.sh b/scripts/migrate_tools/0006_tools.sh index 1f000ebeca6..ff85522a5f9 100644 --- a/scripts/migrate_tools/0006_tools.sh +++ b/scripts/migrate_tools/0006_tools.sh @@ -1,4 +1,4 @@ #!/bin/sh -cd `dirname $0`/../.. -python ./scripts/migrate_tools/migrate_tools.py 0006_tools.xml $@ +cd "$(dirname "$0")"/../.. +python ./scripts/migrate_tools/migrate_tools.py 0006_tools.xml "$@" diff --git a/scripts/migrate_tools/0007_tools.sh b/scripts/migrate_tools/0007_tools.sh index a6cf948593d..8a88f44420c 100644 --- a/scripts/migrate_tools/0007_tools.sh +++ b/scripts/migrate_tools/0007_tools.sh @@ -1,4 +1,4 @@ #!/bin/sh -cd `dirname $0`/../.. -python ./scripts/migrate_tools/migrate_tools.py 0007_tools.xml $@ +cd "$(dirname "$0")"/../.. +python ./scripts/migrate_tools/migrate_tools.py 0007_tools.xml "$@" diff --git a/scripts/migrate_tools/0008_tools.sh b/scripts/migrate_tools/0008_tools.sh index 50cafd19936..d312237023b 100644 --- a/scripts/migrate_tools/0008_tools.sh +++ b/scripts/migrate_tools/0008_tools.sh @@ -1,4 +1,4 @@ #!/bin/sh -cd `dirname $0`/../.. -python ./scripts/migrate_tools/migrate_tools.py 0008_tools.xml $@ +cd "$(dirname "$0")"/../.. +python ./scripts/migrate_tools/migrate_tools.py 0008_tools.xml "$@" diff --git a/scripts/migrate_tools/0009_tools.sh b/scripts/migrate_tools/0009_tools.sh index 36f162b141c..78242fe2422 100644 --- a/scripts/migrate_tools/0009_tools.sh +++ b/scripts/migrate_tools/0009_tools.sh @@ -1,4 +1,4 @@ #!/bin/sh -cd `dirname $0`/../.. -python ./scripts/migrate_tools/migrate_tools.py 0009_tools.xml $@ +cd "$(dirname "$0")"/../.. +python ./scripts/migrate_tools/migrate_tools.py 0009_tools.xml "$@" diff --git a/scripts/migrate_tools/0010_tools.sh b/scripts/migrate_tools/0010_tools.sh index fde17704dd3..03c65dd9973 100644 --- a/scripts/migrate_tools/0010_tools.sh +++ b/scripts/migrate_tools/0010_tools.sh @@ -1,4 +1,4 @@ #!/bin/sh -cd `dirname $0`/../.. -python ./scripts/migrate_tools/migrate_tools.py 0010_tools.xml $@ +cd "$(dirname "$0")"/../.. +python ./scripts/migrate_tools/migrate_tools.py 0010_tools.xml "$@" diff --git a/scripts/migrate_tools/0011_tools.sh b/scripts/migrate_tools/0011_tools.sh index a31365804fd..e06a6be40b3 100644 --- a/scripts/migrate_tools/0011_tools.sh +++ b/scripts/migrate_tools/0011_tools.sh @@ -1,4 +1,4 @@ #!/bin/sh -cd `dirname $0`/../.. -python ./scripts/migrate_tools/migrate_tools.py 0011_tools.xml $@ +cd "$(dirname "$0")"/../.. +python ./scripts/migrate_tools/migrate_tools.py 0011_tools.xml "$@" diff --git a/scripts/migrate_tools/0012_tools.sh b/scripts/migrate_tools/0012_tools.sh index 97fbe354d04..2df312f980a 100644 --- a/scripts/migrate_tools/0012_tools.sh +++ b/scripts/migrate_tools/0012_tools.sh @@ -1,4 +1,4 @@ #!/bin/sh -cd `dirname $0`/../.. -python ./scripts/migrate_tools/migrate_tools.py 0012_tools.xml $@ +cd "$(dirname "$0")"/../.. +python ./scripts/migrate_tools/migrate_tools.py 0012_tools.xml "$@" diff --git a/scripts/tool_shed/migrate_tools_to_repositories.sh b/scripts/tool_shed/migrate_tools_to_repositories.sh index e1108e20307..bbab9b1b333 100644 --- a/scripts/tool_shed/migrate_tools_to_repositories.sh +++ b/scripts/tool_shed/migrate_tools_to_repositories.sh @@ -1,4 +1,4 @@ #!/bin/sh -cd `dirname $0`/../.. +cd "$(dirname "$0")"/../.. python ./scripts/tool_shed/migrate_tools_to_repositories.py ./community_wsgi.ini >> ./scripts/tool_shed/migrate_tools_to_repositories.log diff --git a/scripts/validate_tools.sh b/scripts/validate_tools.sh index 11a52c2f0aa..f57c1cb814a 100755 --- a/scripts/validate_tools.sh +++ b/scripts/validate_tools.sh @@ -1,33 +1,31 @@ #!/bin/sh -cd `dirname $0`/.. +cd "$(dirname "$0")"/.. GALAXY_SKIP_CLIENT_BUILD=1 ./scripts/common_startup.sh GALAXY_VIRTUAL_ENV="${GALAXY_VIRTUAL_ENV:-.venv}" -if [ -d "$GALAXY_VIRTUAL_ENV" ]; -then +if [ -d "$GALAXY_VIRTUAL_ENV" ]; then printf "Activating virtualenv at $GALAXY_VIRTUAL_ENV\n" . "$GALAXY_VIRTUAL_ENV/bin/activate" fi xsd_path="lib/galaxy/tool_util/xsd/galaxy.xsd" -err_tmp=`mktemp` +err_tmp=$(mktemp) count=0 exit=0 for p in "$@"; do count=$((count+1)) path="$p" - echo $path + echo "$path" PYTHONPATH=lib:$PYTHONPATH export PYTHONPATH - result=`python -c "import galaxy.tool_util.loader; import xml.etree; xml.etree.ElementTree.dump(galaxy.tool_util.loader.load_tool('$path').getroot())" | xmllint --nowarning --noout --schema "$xsd_path" - 2> "$err_tmp"` - if [ $? -eq 0 ] - then + python -c "import galaxy.tool_util.loader; import xml.etree; xml.etree.ElementTree.dump(galaxy.tool_util.loader.load_tool('$path').getroot())" | xmllint --nowarning --noout --schema "$xsd_path" - 2> "$err_tmp" + if [ $? -eq 0 ]; then echo "ok $count"; else echo "not ok $count $path"; - cat "$err_tmp" | sed 's/^/ /' + sed 's/^/ /' "$err_tmp" exit=1 fi done diff --git a/tox.ini b/tox.ini index 9904d2a82f1..0aec466cf97 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,7 @@ [tox] # envlist is the list of environments that are tested when `tox` is run without any option # hyphens in an environment name are used to delimit factors -envlist = check_py3_compatibility, py{27,35}-first_startup, py{27,35}-lint, py27-lint_docstring_include_list, py{27,35}-unit, validate_test_tools +envlist = check_py3_compatibility, py{27,35}-first_startup, py{27,35}-lint, py27-lint_docstring_include_list, py{27,35}-unit, test_galaxy_packages, validate_test_tools skipsdist = True [testenv] @@ -35,6 +35,9 @@ commands = bash .ci/flake8_wrapper_docstrings.sh --exclude [testenv:py27-lint_docstring_include_list] commands = bash .ci/flake8_wrapper_docstrings.sh --include +[testenv:test_galaxy_packages] +commands = bash packages/test.sh + [testenv:validate_test_tools] commands = bash .ci/validate_test_tools.sh