mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Resolve lazy toolbox stack onto current store-infra
This commit is contained in:
@@ -5,6 +5,7 @@ import tempfile
|
||||
|
||||
import pytest
|
||||
|
||||
import galaxy.tools.source_store.sqlalchemy as sqlalchemy_store_module
|
||||
from galaxy.tools.source_store import (
|
||||
ReadOnlyStoreError,
|
||||
StoredToolSource,
|
||||
@@ -75,6 +76,18 @@ def test_index_round_trip(sqlite_path):
|
||||
assert loaded.entries["t1"].name == "T1"
|
||||
|
||||
|
||||
def test_load_index_discards_stale_schema(sqlite_path, monkeypatch):
|
||||
store = SqliteToolSourceStore(url=_sqlite_url(sqlite_path))
|
||||
store.store_index(ToolIndex(entries={"t1": ToolIndexEntry(id="t1", name="T1")}))
|
||||
|
||||
# Simulate a Galaxy upgrade that changed the ToolIndex model: the
|
||||
# persisted blob's stamp no longer matches, so the store must report "no
|
||||
# index" (triggering a rebuild) rather than load stale/defaulted fields.
|
||||
monkeypatch.setattr(sqlalchemy_store_module, "INDEX_SCHEMA_HASH", "post-upgrade-schema-hash")
|
||||
fresh = SqliteToolSourceStore(url=_sqlite_url(sqlite_path))
|
||||
assert fresh.load_index() is None
|
||||
|
||||
|
||||
def test_read_only_refuses_writes(sqlite_path):
|
||||
rw = SqliteToolSourceStore(url=_sqlite_url(sqlite_path))
|
||||
rw.store(_source())
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
#
|
||||
#<unique_build_id> <dbkey> <display_name> <file_path>
|
||||
#
|
||||
#So, for example, if you had phiX indexed stored in
|
||||
#/depot/data2/galaxy/phiX/base/,
|
||||
#So, for example, if you had phiX indexed stored in
|
||||
#/depot/data2/galaxy/phiX/base/,
|
||||
#then the bwa_index.loc entry would look like this:
|
||||
#
|
||||
#phiX174 phiX phiX Pretty /depot/data2/galaxy/phiX/base/phiX.fa
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
#
|
||||
#<unique_build_id> <dbkey> <display_name> <file_path>
|
||||
#
|
||||
#So, for example, if you had phiX indexed stored in
|
||||
#/depot/data2/galaxy/phiX/base/,
|
||||
#So, for example, if you had phiX indexed stored in
|
||||
#/depot/data2/galaxy/phiX/base/,
|
||||
#then the bwa_index.loc entry would look like this:
|
||||
#
|
||||
#phiX174 phiX phiX Pretty /depot/data2/galaxy/phiX/base/phiX.fa
|
||||
|
||||
Reference in New Issue
Block a user