Skip to content

Commit

Permalink
Merge pull request #821 from jmchilton/workflow_test_test
Browse files Browse the repository at this point in the history
Tests for workflow testing script.
  • Loading branch information
jmchilton authored Aug 4, 2020
2 parents 4b9b1a5 + b9d621c commit 48157ca
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 2 deletions.
7 changes: 7 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
language: python
sudo: true
matrix:
include:
- python: 3.7
Expand All @@ -13,11 +14,17 @@ matrix:
env: TOX_ENV=py37-unit-nonredundant-noclientbuild-noshed-gx-master
- python: 3.7
env: TOX_ENV=py37-unit-diagnostic-serveshedcmd-gx-master
- python: 3.7
env: TOX_ENV=py37-gxwf_test_test
allow_failures:
- env: TOX_ENV=py37-lint_docstrings
- env: TOX_ENV=py37-unit-diagnostic-serveshedcmd-gx-master
- env: TOX_ENV=py37-gxwf_test_test PLANEMO_TEST_STYLE=docker_test

install:
- pip install tox

script: tox -e $TOX_ENV
services:
- postgresql
- docker
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ test: ## run tests with the default Python (faster than tox)
quick-test: ## run quickest tests with the default Python
$(IN_VENV) PLANEMO_SKIP_SLOW_TESTS=1 PLANEMO_SKIP_GALAXY_TESTS=1 pytest $(TESTS)

gxwf-test-test: ## run test of workflow testing script
bash $(BUILD_SCRIPTS_DIR)/test_workflow_tests.sh

tox: ## run tests with tox in the specified ENV, defaults to py27
$(IN_VENV) tox -e $(ENV) -- $(ARGS)

Expand Down
22 changes: 22 additions & 0 deletions scripts/test_workflow_tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

# Ensure working directory is planemo project.
SCRIPTS_DIRECTORY="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
PROJECT_DIRECTORY="${SCRIPTS_DIRECTORY}/.."

TEMP_DIRECTORY=`mktemp -d 2>/dev/null || mktemp -d -t 'planemowftest'`
cp "$SCRIPTS_DIRECTORY/run_galaxy_workflow_tests.sh" "$TEMP_DIRECTORY"
cp "$PROJECT_DIRECTORY/tests/data/"wf4* "$TEMP_DIRECTORY"
cp "$PROJECT_DIRECTORY/tests/data/1.bed" "$TEMP_DIRECTORY"

cd $PROJECT_DIRECTORY

# Build Planemo wheel.
make dist

# Test against wheel.
export PLANEMO_TARGET="$PROJECT_DIRECTORY/dist/planemo*whl"

cd $TEMP_DIRECTORY
ls
bash run_galaxy_workflow_tests.sh "wf4-distro-tools.gxwf.yml"
9 changes: 7 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py{36}-lint, py36-unit-quick, py36-lint_docstrings, py36-lint_docs, py{36,37}-unit
envlist = py{36}-lint, py36-unit-quick, py36-lint_docstrings, py36-lint_docs, py{36,37}-unit, py36-gxwf_test_test
source_dir = planemo
test_dir = tests

Expand All @@ -10,12 +10,14 @@ commands =
lint_docstrings: flake8 --ignore='D107,D401,D105' {[tox]source_dir}
unit: pytest {env:PYTEST_FAIL_FAIL:} {env:PYTEST_CAPTURE:} -m {env:PYTEST_MARK:""} {env:PYTEST_TARGET:{[tox]test_dir}} {posargs}
mypy: mypy {[tox]source_dir} {posargs}
gxwf_test_test: make setup-venv gxwf-test-test

passenv =
PLANEMO_*
PG*
HOME
DOCS

deps =
lint: flake8-import-order
lint,lint_docstrings: flake8
Expand All @@ -27,6 +29,7 @@ deps =
unit: coverage
unit: flask
mypy: mypy

setenv =
gx: PYTEST_MARK="tests_galaxy_branch"
diagnostic: PLANEMO_TEST_VERBOSE=1
Expand Down Expand Up @@ -54,9 +57,11 @@ setenv =
2005: PLANEMO_TEST_GALAXY_BRANCH=release_20.05
2001: PLANEMO_TEST_GALAXY_BRANCH=release_20.01
skip_install =
doc_test,lint,lint_docs,lint_docstrings,mypy: True
doc_test,lint,lint_docs,lint_docstrings,mypy,gxwf_test_test: True
whitelist_externals =
lint_docs: make
gxwf_test_test: make


[testenv:doc_test]
commands = bash scripts/run_doc_test.sh
Expand Down

0 comments on commit 48157ca

Please sign in to comment.