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 18, 2018
1 parent 1e1cfa4 commit 7966acc
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 11 deletions.
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
7 changes: 5 additions & 2 deletions planemo/galaxy/serve.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
import contextlib
import os

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 Expand Up @@ -35,6 +37,7 @@ def _serve(ctx, runnables, **kwds):
if port is None:
port = network_util.get_free_port()
kwds["port"] = port
kwds['galaxy_skip_client_build'] = False

with galaxy_config(ctx, runnables, **kwds) as config:
cmd = config.startup_command(ctx, **kwds)
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 7966acc

Please sign in to comment.