mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Merge pull request #7939 from mvdbeek/jmchilton-objectstore_fix
Fix non-eager object store with nested object stores
This commit is contained in:
@@ -240,6 +240,36 @@ def setup_galaxy_config(
|
||||
)
|
||||
config.update(database_conf(tmpdir, prefer_template_database=prefer_template_database))
|
||||
config.update(install_database_conf(tmpdir, default_merged=default_install_db_merged))
|
||||
if asbool(os.environ.get("GALAXY_TEST_USE_HIERARCHICAL_OBJECT_STORE")):
|
||||
object_store_config = os.path.join(tmpdir, "object_store_conf.yml")
|
||||
with open(object_store_config, "w") as f:
|
||||
contents = """
|
||||
type: hierarchical
|
||||
backends:
|
||||
- id: files1
|
||||
type: disk
|
||||
weight: 1
|
||||
files_dir: "${temp_directory}/files1"
|
||||
extra_dirs:
|
||||
- type: temp
|
||||
path: "${temp_directory}/tmp1"
|
||||
- type: job_work
|
||||
path: "${temp_directory}/job_working_directory1"
|
||||
- id: files2
|
||||
type: disk
|
||||
weight: 1
|
||||
files_dir: "${temp_directory}/files2"
|
||||
extra_dirs:
|
||||
- type: temp
|
||||
path: "${temp_directory}/tmp2"
|
||||
- type: job_work
|
||||
path: "${temp_directory}/job_working_directory2"
|
||||
"""
|
||||
contents_template = string.Template(contents)
|
||||
expanded_contents = contents_template.safe_substitute(temp_directory=tmpdir)
|
||||
f.write(expanded_contents)
|
||||
config["object_store_config_file"] = object_store_config
|
||||
|
||||
if datatypes_conf is not None:
|
||||
config['datatypes_config_file'] = datatypes_conf
|
||||
if enable_tool_shed_check:
|
||||
|
||||
@@ -191,6 +191,9 @@ class MockObjectStore(object):
|
||||
def create(self, *args, **kwds):
|
||||
pass
|
||||
|
||||
def exists(self, *args, **kwargs):
|
||||
return True
|
||||
|
||||
def get_filename(self, *args, **kwds):
|
||||
if kwds.get("base_dir", "") == "job_work":
|
||||
return self.working_directory
|
||||
|
||||
@@ -283,6 +283,7 @@ def test_import_export_composite_datasets():
|
||||
h = model.History(name="Test History", user=u)
|
||||
|
||||
d1 = _create_datasets(sa_session, h, 1, extension="html")[0]
|
||||
d1.dataset.create_extra_files_path()
|
||||
sa_session.add_all((h, d1))
|
||||
sa_session.flush()
|
||||
|
||||
|
||||
@@ -274,6 +274,9 @@ class MockObjectStore(object):
|
||||
self.first_create = True
|
||||
self.object_store_id = "mycoolid"
|
||||
|
||||
def exists(self, *args, **kwargs):
|
||||
return True
|
||||
|
||||
def create(self, dataset):
|
||||
self.created_datasets.append(dataset)
|
||||
if self.first_create:
|
||||
|
||||
@@ -408,6 +408,9 @@ class MockObjectStore(object):
|
||||
path = self.created_datasets[dataset]
|
||||
return os.stat(path).st_size
|
||||
|
||||
def exists(self, *args, **kwargs):
|
||||
return True
|
||||
|
||||
def get_filename(self, dataset):
|
||||
return self.created_datasets[dataset]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user