Skip to content

Commit

Permalink
Implement conda testing test case #616 and various Galaxy versions.
Browse files Browse the repository at this point in the history
Conda resolution changed a lot from 16.07 to 16.10 to 17.01 - make sure each is verified.
  • Loading branch information
jmchilton committed Jan 25, 2017
1 parent 8d37288 commit 8be5608
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 2 deletions.
56 changes: 55 additions & 1 deletion tests/test_cmd_test_conda.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class CmdTestCondaTestCase(CliTestCase):
"""Integration tests for the ``test`` command."""

@skip_if_environ("PLANEMO_SKIP_GALAXY_TESTS")
def test_conda_dependencies(self):
def test_conda_dependencies_explicit_resolution(self):
with self._isolate():
bwa_test = os.path.join(PROJECT_TEMPLATES_DIR, "conda_testing", "bwa.xml")
test_command = [
Expand All @@ -26,6 +26,60 @@ def test_conda_dependencies(self):
]
self._check_exit_code(test_command, exit_code=0)

@skip_if_environ("PLANEMO_SKIP_GALAXY_TESTS")
def test_conda_dependencies_implicit_resolution(self):
# Shouldn't need to explicitly declare resolution of these things anymore.
with self._isolate():
bwa_test = os.path.join(PROJECT_TEMPLATES_DIR, "conda_testing", "bwa.xml")
test_command = [
"--verbose",
"test",
"--galaxy_branch", "dev",
bwa_test,
]
self._check_exit_code(test_command, exit_code=0)

@skip_if_environ("PLANEMO_SKIP_GALAXY_TESTS")
def test_conda_dependencies_galaxy_16_10(self):
# Conda resolution was changed quite a bit after this - just ensure things are still working.
with self._isolate():
bwa_test = os.path.join(PROJECT_TEMPLATES_DIR, "conda_testing", "bwa.xml")
test_command = [
"--verbose",
"test",
"--galaxy_branch", "release_16.10",
bwa_test,
]
self._check_exit_code(test_command, exit_code=0)

@skip_if_environ("PLANEMO_SKIP_GALAXY_TESTS")
def test_conda_dependencies_galaxy_16_07(self):
# Conda resolution was changed quite a bit after this - just ensure things are still working.
with self._isolate():
bwa_test = os.path.join(PROJECT_TEMPLATES_DIR, "conda_testing", "bwa.xml")
test_command = [
"--verbose",
"test",
"--galaxy_branch", "release_16.07",
bwa_test,
]
self._check_exit_code(test_command, exit_code=0)

@skip_if_environ("PLANEMO_SKIP_GALAXY_TESTS")
def test_conda_dependencies_verify_branch_testing_properly(self):
# This tries to test Conda dependency resolution with a pre-Conda Galaxy and
# expects a failure. This verifies the other test cases are in fact testing
# different versions of Galaxy as expected.
with self._isolate():
bwa_test = os.path.join(PROJECT_TEMPLATES_DIR, "conda_testing", "bwa.xml")
test_command = [
"--verbose",
"test",
"--galaxy_branch", "release_15.10",
bwa_test,
]
self._check_exit_code(test_command, exit_code=self.non_zero_exit_code)

@skip_if_environ("PLANEMO_SKIP_GALAXY_TESTS")
def test_conda_dependencies_version(self):
"""Test testing a simple workflow with Galaxy."""
Expand Down
7 changes: 6 additions & 1 deletion tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
# More information on testing click applications at following link.
# http://click.pocoo.org/3/testing/#basic-testing
class CliTestCase(TestCase):
non_zero_exit_code = object()

def setUp(self): # noqa
self._runner = CliRunner()
Expand Down Expand Up @@ -81,7 +82,11 @@ def _check_exit_code(self, command_list, exit_code=0):
result = self._invoke(command_list)
print("Command list output is [%s]" % result.output)
result_exit_code = result.exit_code
if result_exit_code != expected_exit_code:
if expected_exit_code is self.non_zero_exit_code:
matches_expectation = result_exit_code != 0
else:
matches_expectation = result_exit_code == expected_exit_code
if not matches_expectation:
message = EXIT_CODE_MESSAGE % (
" ".join(command_list),
result_exit_code,
Expand Down

0 comments on commit 8be5608

Please sign in to comment.