Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
set -e
shopt -s nullglob
PULSAR_INSTALL_TARGET="${PULSAR_INSTALL_TARGET:-pulsar-app}"
PLANEMO_INSTALL_TARGET="${PLANEMO_INSTALL_TARGET:-planemo==0.36.1}"
init_temp_dir() {
TEMP_DIR=`mktemp -d`
echo "Setting up test directory $TEMP_DIR"
cd "$TEMP_DIR"
}
init_pulsar() {
PULSAR_INSTALL_TARGET="${PULSAR_INSTALL_TARGET:-pulsar-app}"
PROJECT_DIR="$SCRIPT_DIR/.."
mkdir pulsar
cd pulsar
echo "Setting up virtualenv for Pulsar"
virtualenv venv
. venv/bin/activate # .venv\Scripts\activate if Windows
echo "Installing Pulsar using 'pip install $PULSAR_INSTALL_TARGET'"
pip install $PULSAR_INSTALL_TARGET
cd ..
}
stop_pulsar() {
cd pulsar
. venv/bin/activate
echo "Stopping Pulsar daemon."
pulsar --stop-daemon
echo "Ending tests."
}
check_pulsar() {
cd pulsar
echo "Starting Pulsar in daemon mode."
pulsar --daemon
echo "Waiting for Pulsar to start."
sleep 2
echo "Running a standalone Pulsar job."
pulsar-check # runs a test job
echo "Stopping Pulsar daemon."
pulsar --stop-daemon
echo "End Pulsar Checks"
echo "Testing Pulsar-Galaxy Interaction"
echo "Starting Pulsar in daemon mode."
pulsar --daemon
echo "Waiting for Pulsar to start."
sleep 2
cd ..
}
init_planemo() {
template="$1"
echo "Creating a virtual environment for Planemo to drive a test job."
virtualenv planemo-venv
. planemo-venv/bin/activate
echo "Installing Pulsar using 'pip install $PLANEMO_INSTALL_TARGET'"
pip install --upgrade pip
pip install "$PLANEMO_INSTALL_TARGET"
echo "Setting up Planemo test tools."
planemo project_init --template="$template" test_tools
}
run_planemo() {
echo "Running tool tests with Planemo through Pulsar"
: ${GALAXY_ROOT:=""}
galaxy_root_args=""
if [ -d "$GALAXY_ROOT" ];
then
galaxy_root_args="--galaxy_root $GALAXY_ROOT"
fi
planemo --verbose test $galaxy_root_args "$@"
echo "Tests complete."
}