mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-01 05:31:04 +08:00
89 lines
2.2 KiB
Bash
Executable File
89 lines
2.2 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
set -ex
|
|
|
|
PACKAGE_LIST_FILE=packages_by_dep_dag.txt
|
|
FOR_PULSAR=0
|
|
SKIP_PACKAGES=(
|
|
web_client
|
|
meta
|
|
)
|
|
|
|
should_skip_package() {
|
|
local pkg
|
|
for pkg in ${SKIP_PACKAGES[@]}; do
|
|
[[ $1 == $pkg ]] && return 0
|
|
done
|
|
return 1
|
|
}
|
|
|
|
for arg in "$@"; do
|
|
if [ "$arg" = "--for-pulsar" ]; then
|
|
PACKAGE_LIST_FILE=packages_for_pulsar_by_dep_dag.txt
|
|
FOR_PULSAR=1
|
|
fi
|
|
done
|
|
|
|
# Don't display the pip progress bar when running under CI
|
|
if [ "$CI" = 'true' ]; then
|
|
export PIP_PROGRESS_BAR=off
|
|
fi
|
|
|
|
# Change to packages directory.
|
|
cd "$(dirname "$0")"
|
|
|
|
# Use a throw-away virtualenv
|
|
TEST_PYTHON=${TEST_PYTHON:-"python3"}
|
|
TEST_ENV_DIR=${TEST_ENV_DIR:-$(mktemp -d -t gxpkgtestenvXXXXXX)}
|
|
|
|
"$TEST_PYTHON" -m venv "$TEST_ENV_DIR"
|
|
# shellcheck disable=SC1091
|
|
. "${TEST_ENV_DIR}/bin/activate"
|
|
pip install --upgrade pip setuptools wheel
|
|
if [ $FOR_PULSAR -eq 0 ]; then
|
|
pip install -r../lib/galaxy/dependencies/pinned-typecheck-requirements.txt
|
|
fi
|
|
|
|
# Ensure ordered by dependency DAG
|
|
while read -r package_dir || [ -n "$package_dir" ]; do # https://stackoverflow.com/questions/12916352/shell-script-read-missing-last-line
|
|
# Ignore empty lines
|
|
if [ -z "$package_dir" ]; then
|
|
continue
|
|
fi
|
|
# Ignore lines beginning with `#`
|
|
if [[ $package_dir =~ ^#.* ]]; then
|
|
continue
|
|
fi
|
|
if should_skip_package "$package_dir"; then
|
|
printf "\nSkipping package %s\n\n" "$package_dir"
|
|
continue
|
|
fi
|
|
|
|
printf "\n========= TESTING PACKAGE %s =========\n\n" "$package_dir"
|
|
|
|
cd "$package_dir"
|
|
|
|
# Install extras (if needed)
|
|
if [ "$package_dir" = "util" ]; then
|
|
pip install '.[image-util,template,jstree,config-template]'
|
|
elif [ "$package_dir" = "tool_util" ]; then
|
|
pip install '.[cwl,mulled,edam,extended-assertions]'
|
|
else
|
|
pip install .
|
|
fi
|
|
|
|
pip install -r test-requirements.txt
|
|
|
|
if [ $FOR_PULSAR -eq 0 ]; then
|
|
marker_args=(-m 'not external_dependency_management')
|
|
else
|
|
marker_args=()
|
|
fi
|
|
# Ignore exit code 5 (no tests ran)
|
|
pytest "${marker_args[@]}" . || test $? -eq 5
|
|
if [ $FOR_PULSAR -eq 0 ]; then
|
|
make mypy
|
|
fi
|
|
cd ..
|
|
done < $PACKAGE_LIST_FILE
|