Permalink
Browse files

Fix shed_test and shed_serve for test/local tool sheds.

  • Loading branch information...
jmchilton committed May 22, 2015
1 parent 9b860f7 commit f3cafaa1f3be2c301633eac01e5068f805287c95
Showing with 25 additions and 3 deletions.
  1. +21 −0 planemo/galaxy_config.py
  2. +3 −2 planemo/shed/__init__.py
  3. +1 −1 tests/test_shed_test.py
@@ -20,6 +20,7 @@
from planemo.io import write_file
from planemo.io import kill_pid_file
from planemo import git
from planemo.shed import tool_shed_url
from planemo.bioblend import (
galaxy,
ensure_module,
@@ -73,6 +74,11 @@
</dependency_resolvers>
"""

TOOL_SHEDS_CONF = """<tool_sheds>
<tool_shed name="Target Shed" url="${shed_target_url}" />
</tool_sheds>
"""

# Provide some shortcuts for simple/common dependency resolutions strategies.
STOCK_DEPENDENCY_RESOLUTION_STRATEGIES = {
"brew_dependency_resolution": BREW_DEPENDENCY_RESOLUTION_CONF,
@@ -128,6 +134,9 @@ def config_join(*args):
tool_conf = config_join("tool_conf.xml")
database_location = config_join("galaxy.sqlite")
shed_tools_path = config_join("shed_tools")
sheds_config_path = _configure_sheds_config_file(
config_directory, **kwds
)
preseeded_database = True
master_api_key = kwds.get("master_api_key", "test_key")
dependency_dir = os.path.join(config_directory, "deps")
@@ -166,6 +175,7 @@ def config_join(*args):
file_path="${temp_directory}/files",
new_file_path="${temp_directory}/tmp",
tool_config_file=tool_config_file,
tool_sheds_config_file=sheds_config_path,
check_migrate_tools="False",
manage_dependency_relationships="False",
job_working_directory="${temp_directory}/job_working_directory",
@@ -431,6 +441,17 @@ def _search_tool_path_for(path, target, extra_paths=[]):
return None


def _configure_sheds_config_file(config_directory, **kwds):
if "shed_target" not in kwds:
kwds = kwds.copy()
kwds["shed_target"] = "toolshed"
shed_target_url = tool_shed_url(kwds)
contents = _sub(TOOL_SHEDS_CONF, {"shed_target_url": shed_target_url})
tool_sheds_conf = os.path.join(config_directory, "tool_sheds_conf.xml")
write_file(tool_sheds_conf, contents)
return tool_sheds_conf


def _tool_conf_entry_for(tool_paths):
tool_definitions = ""
for tool_path in tool_paths:
@@ -322,7 +322,7 @@ def tool_shed_client(ctx=None, **kwds):
def prop(key):
return kwds.get("shed_%s" % key, None) or shed_config.get(key, None)

url = _tool_shed_url(kwds)
url = tool_shed_url(kwds)
if read_only:
key = None
email = None
@@ -608,7 +608,7 @@ def shed_repo_type(config, name):
return repo_type


def _tool_shed_url(kwds):
def tool_shed_url(kwds):
url = kwds.get("shed_target")
if url in SHED_SHORT_NAMES:
url = SHED_SHORT_NAMES[url]
@@ -1217,6 +1217,7 @@ class RealizationException(Exception):
'for_each_repository',
'api_exception_to_message',
'tool_shed_client',
'tool_shed_url',
'diff_repo',
'download_tarball',
'shed_init',
@@ -12,7 +12,7 @@
class ShedTestTestCase(CliTestCase):

@skip_if_environ("PLANEMO_SKIP_GALAXY_TESTS")
def test_serve(self):
def test_shed_test(self):
fastqc_path = os.path.join(TEST_REPOS_DIR, "fastqc")
test_cmd = [
"shed_test",

0 comments on commit f3cafaa

Please sign in to comment.