Skip to content

Commit 6514ff5

Browse files
committed
Add script to test a planemo wheel.
Test wheel directly in isolation by installing it into its own virtualenv and copying test data and required files out into a temp directory. Progress toward issue #184.
1 parent e70967b commit 6514ff5

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

scripts/test_wheel.bash

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/bin/bash
2+
3+
## TODO: fail if virtualenv is not located.
4+
5+
set -e
6+
7+
VERSION=$1
8+
9+
# Ensure working directory is planemo project.
10+
SCRIPTS_DIRECTORY="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
11+
PROJECT_DIRECTORY="${SCRIPTS_DIRECTORY}/.."
12+
DIST_DIRECTORY="${PROJECT_DIRECTORY}/dist"
13+
WHEEL_FILE="${DIST_DIRECTORY}/planemo-$VERSION-py2.py3-none-any.whl"
14+
DEV_REQUIREMENTS="${PROJECT_DIRECTORY}/dev-requirements.txt"
15+
16+
cd $PROJECT_DIRECTORY
17+
18+
19+
WORKING_DIRECTORY=`mktemp -d -t planemotestXXXXXX`
20+
cp -r "$PROJECT_DIRECTORY"/{.coveragerc,setup.cfg,tests,project_templates} "$WORKING_DIRECTORY"
21+
22+
cd "$WORKING_DIRECTORY"
23+
VIRTUALENV_DIRECTORY="$WORKING_DIRECTORY/venv"
24+
virtualenv "$VIRTUALENV_DIRECTORY"
25+
. "$VIRTUALENV_DIRECTORY/bin/activate"
26+
pip install "${WHEEL_FILE}"
27+
pip install -r "${DEV_REQUIREMENTS}"
28+
29+
nosetests tests

0 commit comments

Comments
 (0)