Resolve lazy toolbox stack onto current store-infra

This commit is contained in:
mvdbeek
2026-07-28 17:27:29 +02:00
parent 145917b54b
commit 67b9851d3e
3 changed files with 17 additions and 4 deletions
@@ -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())
+2 -2
View File
@@ -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
+2 -2
View File
@@ -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