Skip to content

Commit

Permalink
Do not skip client build for planemo serve
Browse files Browse the repository at this point in the history
  • Loading branch information
nsoranzo committed Nov 23, 2018
1 parent 3f5ba50 commit ca009dc
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 11 deletions.
1 change: 1 addition & 0 deletions planemo/commands/cmd_serve.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,5 @@ def cli(ctx, uris, **kwds):
"""
paths = uris_to_paths(ctx, uris)
runnables = for_paths(paths)
kwds['galaxy_skip_client_build'] = False
galaxy_serve(ctx, runnables, **kwds)
1 change: 1 addition & 0 deletions planemo/commands/cmd_shed_serve.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ def cli(ctx, paths, **kwds):
install these artifacts, and serve a Galaxy instances that can be
logged into and explored interactively.
"""
kwds['galaxy_skip_client_build'] = False
install_args_list = shed.install_arg_lists(ctx, paths, **kwds)
with shed_serve(ctx, install_args_list, **kwds) as config:
io.info("Galaxy running with tools installed at %s" % config.galaxy_url)
Expand Down
6 changes: 4 additions & 2 deletions planemo/galaxy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
run_galaxy_command,
setup_venv,
)
from .serve import serve as galaxy_serve
from .serve import shed_serve
from .serve import (
serve as galaxy_serve,
shed_serve
)

__all__ = (
"galaxy_config",
Expand Down
7 changes: 3 additions & 4 deletions planemo/galaxy/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,9 +351,9 @@ def local_galaxy_config(ctx, runnables, for_tests=False, **kwds):
def config_join(*args):
return os.path.join(config_directory, *args)

install_env = {
'GALAXY_SKIP_CLIENT_BUILD': '1',
}
install_env = {}
if kwds.get('galaxy_skip_client_build', True):
install_env['GALAXY_SKIP_CLIENT_BUILD'] = '1'
if install_galaxy:
_build_eggs_cache(ctx, install_env, kwds)
_install_galaxy(ctx, config_directory, install_env, kwds)
Expand Down Expand Up @@ -484,7 +484,6 @@ def config_join(*args):
env["GALAXY_TEST_UPLOAD_ASYNC"] = "false"
env["GALAXY_TEST_LOGGING_CONFIG"] = config_join("logging.ini")
env["GALAXY_DEVELOPMENT_ENVIRONMENT"] = "1"
env["GALAXY_SKIP_CLIENT_BUILD"] = "1"
# Following are needed in 18.01 to prevent Galaxy from changing log and pid.
# https://github.com/galaxyproject/planemo/issues/788
env["GALAXY_LOG"] = log_file
Expand Down
6 changes: 4 additions & 2 deletions planemo/galaxy/serve.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
import os
import time

from planemo import io
from planemo import network_util
from planemo import (
io,
network_util
)
from .config import galaxy_config
from .ephemeris_sleep import sleep
from .run import (
Expand Down
15 changes: 12 additions & 3 deletions tests/test_cmd_serve.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
import time
import uuid

import requests

from planemo import network_util
from planemo.galaxy import api
from planemo.io import kill_pid_file
Expand Down Expand Up @@ -34,14 +36,21 @@ def test_serve(self):
@skip_if_environ("PLANEMO_SKIP_PYTHON3")
@skip_unless_executable("python3")
def test_serve_python3(self):
extra_args = ['--galaxy_python_version', '3',
'--galaxy_branch', 'release_18.09']
extra_args = [
"--galaxy_python_version", "3",
"--galaxy_branch", "release_18.09"]
self._launch_thread_and_wait(self._run, extra_args)
# Check that the client was correctly built
url = "http://localhost:%d/static/scripts/libs/require.js" % int(self._port)
r = requests.get(url)
assert r.status_code == 200

@skip_if_environ("PLANEMO_SKIP_GALAXY_TESTS")
@mark.tests_galaxy_branch
def test_serve_daemon(self):
extra_args = ["--daemon", "--pid_file", self._pid_file]
extra_args = [
"--daemon",
"--pid_file", self._pid_file]
self._launch_thread_and_wait(self._run, extra_args)
user_gi = self._user_gi
assert len(user_gi.histories.get_histories(name=TEST_HISTORY_NAME)) == 0
Expand Down

0 comments on commit ca009dc

Please sign in to comment.