Permalink
Browse files

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.
  • Loading branch information...
jmchilton committed Nov 11, 2015
1 parent e70967b commit 6514ff54a9110bd028e1d9dbde0c5849dfd10a11
Showing with 29 additions and 0 deletions.
  1. +29 −0 scripts/test_wheel.bash
@@ -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.