From a7d60d582412c69a70ce1e16dc13c5b55cf50950 Mon Sep 17 00:00:00 2001 From: John Chilton Date: Mon, 5 Mar 2018 11:18:56 -0500 Subject: [PATCH 1/4] More verbose testing, can't tell what is going on Travis. --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index c8bbcd90a..c8519dfce 100644 --- a/setup.cfg +++ b/setup.cfg @@ -3,7 +3,7 @@ universal = 1 [nosetests] exclude=(planemo_ext|.*cwl2script.*) -verbosity=1 +verbosity=6 detailed-errors=1 with-doctest=1 with-coverage=1 From f3932b0e237422fd021b675d4b61936a24343e70 Mon Sep 17 00:00:00 2001 From: John Chilton Date: Mon, 5 Mar 2018 17:12:06 -0500 Subject: [PATCH 2/4] More robust shed serve command. --- planemo/commands/cmd_shed_serve.py | 1 + tests/test_cmd_serve.py | 28 ++++++++++++++++++++--- tests/test_cmd_shed_serve.py | 36 ------------------------------ 3 files changed, 26 insertions(+), 39 deletions(-) delete mode 100644 tests/test_cmd_shed_serve.py diff --git a/planemo/commands/cmd_shed_serve.py b/planemo/commands/cmd_shed_serve.py index 8a540aec5..eecc2e055 100644 --- a/planemo/commands/cmd_shed_serve.py +++ b/planemo/commands/cmd_shed_serve.py @@ -15,6 +15,7 @@ @options.galaxy_run_options() @options.galaxy_config_options() @options.pid_file_option() +@options.daemon_option() @click.option( "--skip_dependencies", is_flag=True, diff --git a/tests/test_cmd_serve.py b/tests/test_cmd_serve.py index 5f63052ee..9b66a15a9 100644 --- a/tests/test_cmd_serve.py +++ b/tests/test_cmd_serve.py @@ -46,13 +46,32 @@ def test_serve_workflow(self): "--extra_tools", cat, ] self._launch_thread_and_wait(self._run, extra_args) - time.sleep(40) + time.sleep(30) user_gi = self._user_gi assert len(user_gi.histories.get_histories(name=TEST_HISTORY_NAME)) == 0 user_gi.histories.create_history(TEST_HISTORY_NAME) assert user_gi.tools.get_tools(tool_id="random_lines1") assert len(user_gi.workflows.get_workflows()) == 1 + @skip_if_environ("PLANEMO_SKIP_GALAXY_TESTS") + def test_shed_serve(self): + extra_args = ["--daemon", "--pid_file", self._pid_file, "--shed_target", "toolshed"] + fastqc_path = os.path.join(TEST_REPOS_DIR, "fastqc") + self._serve_artifact = fastqc_path + self._launch_thread_and_wait(self._run_shed, extra_args) + user_gi = self._user_gi + found = False + tool_ids = None + for i in range(30): + tool_ids = [t["id"] for t in user_gi.tools.get_tools()] + if "toolshed.g2.bx.psu.edu/repos/devteam/fastqc/fastqc/0.71" in tool_ids: + found = True + break + time.sleep(5) + + assert found, "Failed to find fastqc id in %s" % tool_ids + kill_pid_file(self._pid_file) + @skip_if_environ("PLANEMO_SKIP_GALAXY_TESTS") def test_serve_profile(self): self._test_serve_profile() @@ -105,9 +124,12 @@ def _launch_thread_and_wait(self, func, args=[]): time.sleep(1) assert network_util.wait_net_service("127.0.0.1", port, timeout=600) - def _run(self, serve_args=[]): + def _run_shed(self, serve_args=[]): + return self._run(serve_args=serve_args, serve_cmd="shed_serve") + + def _run(self, serve_args=[], serve_cmd="serve"): test_cmd = [ - "serve", + serve_cmd, "--install_galaxy", "--no_dependency_resolution", "--port", diff --git a/tests/test_cmd_shed_serve.py b/tests/test_cmd_shed_serve.py deleted file mode 100644 index b992a0f01..000000000 --- a/tests/test_cmd_shed_serve.py +++ /dev/null @@ -1,36 +0,0 @@ -import functools -import os -import threading -import time - -from planemo import network_util -from .test_utils import ( - CliTestCase, - skip_if_environ, - TEST_REPOS_DIR, -) - - -class ShedServeTestCase(CliTestCase): - - @skip_if_environ("PLANEMO_SKIP_GALAXY_TESTS") - def test_serve(self): - port = network_util.get_free_port() - serve = functools.partial(self._run, port) - t = threading.Thread(target=serve) - t.daemon = True - t.start() - time.sleep(15) - assert network_util.wait_net_service("127.0.0.1", port) - - def _run(self, port): - fastqc_path = os.path.join(TEST_REPOS_DIR, "fastqc") - test_cmd = [ - "shed_serve", - "--install_galaxy", - "--shed_target", "toolshed", - "--port", - str(port), - fastqc_path, - ] - self._check_exit_code(test_cmd) From 702b2e3cb93ec0eabc6fc8818d8b1cc227bd6ecc Mon Sep 17 00:00:00 2001 From: John Chilton Date: Tue, 6 Mar 2018 20:54:03 -0500 Subject: [PATCH 3/4] Conda testing changes - only test recent versions of Galaxy. --- tests/test_cmd_test_conda.py | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/tests/test_cmd_test_conda.py b/tests/test_cmd_test_conda.py index e4a444b96..24365e0c1 100644 --- a/tests/test_cmd_test_conda.py +++ b/tests/test_cmd_test_conda.py @@ -40,21 +40,6 @@ def test_conda_dependencies_implicit_resolution(self): ] 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 tool with wrong version and ensure it fails.""" @@ -90,7 +75,7 @@ def test_local_conda_dependencies_version(self): self._check_exit_code(conda_install_command) test_command = [ "test", - "--galaxy_branch", "release_17.01", + "--galaxy_branch", "release_17.09", fleeqtk_tool, ] self._check_exit_code(test_command) From e82b7de99eb4813aa8dbf33c2a4a5a1bdd457478 Mon Sep 17 00:00:00 2001 From: John Chilton Date: Tue, 6 Mar 2018 20:54:33 -0500 Subject: [PATCH 4/4] touch up tox.ini --- tox.ini | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index 4401d4358..ed615b239 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,6 @@ -# TODO: py34 to envlist # TODO: implement doc linting [tox] -envlist = py{27,34}-lint, py{27,34}-quick, py27-lint-imports, py27-lint-docstrings, py27-lint-readme, py27-lint-docs, py{27,34,35} +envlist = py{27,34}-lint, py{27,34,35}-quick, py27-lint-imports, py27-lint-docstrings, py27-lint-readme, py27-lint-docs, py{27,34,35} source_dir = planemo test_dir = tests