Skip to content

Commit

Permalink
Add script to test a planemo wheel.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jmchilton committed Nov 11, 2015
1 parent e70967b commit 6514ff5
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions scripts/test_wheel.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash

## TODO: fail if virtualenv is not located.

set -e

VERSION=$1

# Ensure working directory is planemo project.
SCRIPTS_DIRECTORY="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
PROJECT_DIRECTORY="${SCRIPTS_DIRECTORY}/.."
DIST_DIRECTORY="${PROJECT_DIRECTORY}/dist"
WHEEL_FILE="${DIST_DIRECTORY}/planemo-$VERSION-py2.py3-none-any.whl"
DEV_REQUIREMENTS="${PROJECT_DIRECTORY}/dev-requirements.txt"

cd $PROJECT_DIRECTORY


WORKING_DIRECTORY=`mktemp -d -t planemotestXXXXXX`
cp -r "$PROJECT_DIRECTORY"/{.coveragerc,setup.cfg,tests,project_templates} "$WORKING_DIRECTORY"

cd "$WORKING_DIRECTORY"
VIRTUALENV_DIRECTORY="$WORKING_DIRECTORY/venv"
virtualenv "$VIRTUALENV_DIRECTORY"
. "$VIRTUALENV_DIRECTORY/bin/activate"
pip install "${WHEEL_FILE}"
pip install -r "${DEV_REQUIREMENTS}"

nosetests tests

0 comments on commit 6514ff5

Please sign in to comment.