Files
galaxy/scripts/validate_tools.sh
T
John Chilton 939e7774a8 Create galaxy-tool-util package.
This is (so far a subset of) the tool utilities from galaxy-lib. galaxy-lib mocked out a fake galaxy.tools to allow these to all exist below the galaxy.tools - but this was a terrible hack - in order for the new packages to be true subsets of Galaxy they need to be refactored into a new package that doesn't depend on models, SA, galaxy.jobs, etc...

[x] galaxy.tools.deps -> galaxy.tool_util.deps
[x] galaxy.tools.loader -> galaxy.tool_util.loader
[x] galaxy.tools.cwl -> galaxy.tool_util.cwl
[x] galaxy.tools.loader -> galaxy.tool_util.loader
[x] galaxy.tools.fetcher -> galaxy.tool_util.fetcher
[x] galaxy.tools.locations -> galaxy.tool_util.locations
[x] galaxy.tools.parser -> galaxy.tool_util.parser
2019-05-16 16:45:25 -04:00

36 lines
867 B
Bash
Executable File

#!/bin/sh
cd `dirname $0`/..
./scripts/common_startup.sh
GALAXY_VIRTUAL_ENV="${GALAXY_VIRTUAL_ENV:-.venv}"
if [ -d "$GALAXY_VIRTUAL_ENV" ];
then
printf "Activating virtualenv at $GALAXY_VIRTUAL_ENV\n"
. "$GALAXY_VIRTUAL_ENV/bin/activate"
fi
xsd_path="lib/galaxy/tools/xsd/galaxy.xsd"
err_tmp=`mktemp`
count=0
exit=0
for p in "$@"; do
count=$((count+1))
path="$p"
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
echo "ok $count";
else
echo "not ok $count $path";
cat "$err_tmp" | sed 's/^/ /'
exit=1
fi
done
rm "$err_tmp"
exit $exit