mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Merge branch 'release_21.01' into dev
This commit is contained in:
@@ -82,7 +82,6 @@
|
||||
@onUpdateHideSourceItems="onUpdateHideSourceItems"
|
||||
@clicked-create="clickedCreate"
|
||||
@remove-extensions-toggle="removeExtensionsToggle"
|
||||
:renderExtensionsToggle="true"
|
||||
:suggestedName="initialSuggestedName"
|
||||
>
|
||||
<template v-slot:help-content>
|
||||
|
||||
@@ -3313,6 +3313,8 @@ class HistoryDatasetAssociation(DatasetInstance, HasTags, Dictifiable, UsesAnnot
|
||||
|
||||
def copy_tags_to(self, copy_tags=None):
|
||||
if copy_tags is not None:
|
||||
if isinstance(copy_tags, dict):
|
||||
copy_tags = copy_tags.values()
|
||||
for tag in copy_tags:
|
||||
copied_tag = tag.copy(cls=HistoryDatasetAssociationTagAssociation)
|
||||
self.tags.append(copied_tag)
|
||||
|
||||
@@ -136,8 +136,9 @@ def get_config(argv, use_argparse=True, cwd=None):
|
||||
db_url = properties["%sdatabase_connection" % config_prefix]
|
||||
else:
|
||||
db_url = "sqlite:///%s?isolation_level=IMMEDIATE" % os.path.join(get_data_dir(properties), default_sqlite_file)
|
||||
install_database_connection = properties.get('install_database_connection')
|
||||
|
||||
return dict(db_url=db_url, repo=repo, config_file=config_file, database=database)
|
||||
return dict(db_url=db_url, repo=repo, config_file=config_file, database=database, install_database_connection=install_database_connection)
|
||||
|
||||
|
||||
def manage_db():
|
||||
|
||||
@@ -893,7 +893,11 @@ class RefgenieToolDataTable(TabularToolDataTable):
|
||||
return rval
|
||||
|
||||
def _remove_entry(self, values):
|
||||
raise NotImplementedError("Not supported")
|
||||
|
||||
log.warning("Deletion from refgenie-backed '%s' data table is not supported, will only try to delete from .loc files", self.name)
|
||||
|
||||
# Update every non-refgenie files
|
||||
super()._remove_entry(values)
|
||||
|
||||
|
||||
def expand_here_template(content, here=None):
|
||||
|
||||
@@ -402,11 +402,21 @@ class ToolsTestCase(ApiTestCase, TestsTools):
|
||||
|
||||
def test_unzip_nested(self):
|
||||
with self.dataset_populator.test_history() as history_id:
|
||||
hdca_list_id = self.__build_nested_list(history_id)
|
||||
response = self.dataset_collection_populator.upload_collection(history_id, "list:paired", elements=[
|
||||
{
|
||||
"name": "test0",
|
||||
"elements": [
|
||||
{"src": "pasted", "paste_content": "123\n", "name": "forward", "ext": "txt", "tags": ["#foo"]},
|
||||
{"src": "pasted", "paste_content": "456\n", "name": "reverse", "ext": "txt", "tags": ["#bar"]},
|
||||
]
|
||||
}
|
||||
])
|
||||
self._assert_status_code_is(response, 200)
|
||||
hdca_id = response.json()["outputs"][0]["id"]
|
||||
inputs = {
|
||||
"input": {
|
||||
'batch': True,
|
||||
'values': [{'src': 'hdca', 'map_over_type': 'paired', 'id': hdca_list_id}],
|
||||
'values': [{'src': 'hdca', 'map_over_type': 'paired', 'id': hdca_id}],
|
||||
}
|
||||
}
|
||||
self.dataset_populator.wait_for_history(history_id, assert_ok=True)
|
||||
|
||||
@@ -33,7 +33,7 @@ log = logging.getLogger(__name__)
|
||||
def invoke_create():
|
||||
config = get_config(sys.argv)
|
||||
if config['database'] == 'galaxy':
|
||||
create_db(config['db_url'], config['config_file'])
|
||||
create_db(config['db_url'], config['config_file'], map_install_models=not config['install_database_connection'])
|
||||
elif config['database'] == 'tool_shed':
|
||||
create_tool_shed_db(config['db_url'])
|
||||
elif config['database'] == 'install':
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
config_version: 0.4
|
||||
genome_folder: /tmp/refgenie
|
||||
genome_servers:
|
||||
- http://refgenomes.databio.org
|
||||
genomes: null
|
||||
@@ -79,14 +79,62 @@ class DataManagerIntegrationTestCase(integration_util.IntegrationTestCase, UsesS
|
||||
|
||||
def test_data_manager_manual(self):
|
||||
"""
|
||||
Test that data_manager_manual works, which uses a signigicant amount of Galaxy-internal code
|
||||
Test that data_manager_manual works, which uses a significant amount of Galaxy-internal code
|
||||
"""
|
||||
self.install_repository('iuc', 'data_manager_manual', '1ed87dee9e68')
|
||||
with self._different_user(email="%s@galaxy.org" % self.username):
|
||||
with self.dataset_populator.test_history() as history_id:
|
||||
self.dataset_populator.run_tool(tool_id=DATA_MANAGER_MANUAL_ID,
|
||||
inputs=DATA_MANAGER_MANUAL_INPUT,
|
||||
history_id=history_id)
|
||||
run_response = self.dataset_populator.run_tool(tool_id=DATA_MANAGER_MANUAL_ID,
|
||||
inputs=DATA_MANAGER_MANUAL_INPUT,
|
||||
history_id=history_id,
|
||||
assert_ok=False)
|
||||
self.dataset_populator.wait_for_tool_run(history_id=history_id, run_response=run_response, timeout=CONDA_AUTO_INSTALL_JOB_TIMEOUT)
|
||||
|
||||
entries = self._app.tool_data_tables.get("all_fasta").get_entries('dbkey', 'dm6', 'dbkey')
|
||||
assert 'dm6' in entries
|
||||
|
||||
table_content = {line[0]: line for line in self._app.tool_data_tables.get("all_fasta").to_dict(view="element")['fields']}
|
||||
|
||||
self._app.tool_data_tables.get("all_fasta").remove_entry(table_content['dm6'])
|
||||
entries = self._app.tool_data_tables.get("all_fasta").get_entries('dbkey', 'dm6', 'dbkey')
|
||||
assert entries is None
|
||||
|
||||
def test_data_manager_manual_multiple(self):
|
||||
"""
|
||||
Test adding/removing on the same data table with multiple data managers
|
||||
"""
|
||||
self.install_repository("devteam", "data_manager_fetch_genome_dbkeys_all_fasta", "14eb0fc65c62")
|
||||
self.install_repository('iuc', 'data_manager_manual', '1ed87dee9e68')
|
||||
with self._different_user(email="%s@galaxy.org" % self.username):
|
||||
with self.dataset_populator.test_history() as history_id:
|
||||
run_response = self.dataset_populator.run_tool(tool_id=FETCH_TOOL_ID,
|
||||
inputs=FETCH_GENOME_DBKEYS_ALL_FASTA_INPUT,
|
||||
history_id=history_id,
|
||||
assert_ok=False)
|
||||
self.dataset_populator.wait_for_tool_run(history_id=history_id, run_response=run_response, timeout=CONDA_AUTO_INSTALL_JOB_TIMEOUT)
|
||||
run_response = self.dataset_populator.run_tool(tool_id=DATA_MANAGER_MANUAL_ID,
|
||||
inputs=DATA_MANAGER_MANUAL_INPUT,
|
||||
history_id=history_id,
|
||||
assert_ok=False)
|
||||
self.dataset_populator.wait_for_tool_run(history_id=history_id, run_response=run_response, timeout=CONDA_AUTO_INSTALL_JOB_TIMEOUT)
|
||||
|
||||
entries = self._app.tool_data_tables.get("all_fasta").get_entries('dbkey', 'NC_001617.1', 'dbkey')
|
||||
assert 'NC_001617.1' in entries
|
||||
|
||||
entries = self._app.tool_data_tables.get("all_fasta").get_entries('dbkey', 'dm6', 'dbkey')
|
||||
assert 'dm6' in entries
|
||||
|
||||
table_content = {line[0]: line for line in self._app.tool_data_tables.get("all_fasta").to_dict(view="element")['fields']}
|
||||
|
||||
self._app.tool_data_tables.get("all_fasta").remove_entry(table_content['dm6'])
|
||||
|
||||
entries = self._app.tool_data_tables.get("all_fasta").get_entries('dbkey', 'dm6', 'dbkey')
|
||||
assert entries is None
|
||||
|
||||
self._app.tool_data_tables.get("all_fasta").remove_entry(table_content['NC_001617.1'])
|
||||
|
||||
entries = self._app.tool_data_tables.get("all_fasta").get_entries('dbkey', 'NC_001617.1', 'dbkey')
|
||||
assert entries is None
|
||||
|
||||
@classmethod
|
||||
def get_secure_ascii_digits(cls, n=12):
|
||||
|
||||
@@ -0,0 +1,115 @@
|
||||
import os
|
||||
import random
|
||||
import string
|
||||
|
||||
from nose.plugins.skip import SkipTest
|
||||
|
||||
from galaxy_test.base.populators import DatasetPopulator
|
||||
from galaxy_test.driver import integration_util
|
||||
from .uses_shed import CONDA_AUTO_INSTALL_JOB_TIMEOUT, UsesShed
|
||||
|
||||
FETCH_TOOL_ID = 'toolshed.g2.bx.psu.edu/repos/devteam/data_manager_fetch_genome_dbkeys_all_fasta/data_manager_fetch_genome_all_fasta_dbkey/0.0.3'
|
||||
FETCH_GENOME_DBKEYS_ALL_FASTA_INPUT = {
|
||||
"dbkey_source|dbkey_source_selector": "new",
|
||||
"dbkey_source|dbkey": "NC_001617.1",
|
||||
"dbkey_source|dbkey_name": "NC_001617.1",
|
||||
"sequence_name": "NC_001617.1",
|
||||
"sequence_id": "NC_001617.1",
|
||||
"reference_source|reference_source_selector": "url",
|
||||
"reference_source|user_url": "https://raw.githubusercontent.com/galaxyproject/galaxy-test-data/master/NC_001617.1.fasta",
|
||||
"sorting|sort_selector": "as_is"
|
||||
}
|
||||
SAM_FASTA_ID = "toolshed.g2.bx.psu.edu/repos/devteam/data_manager_sam_fasta_index_builder/sam_fasta_index_builder/0.0.3"
|
||||
SAM_FASTA_INPUT = {"all_fasta_source": "NC_001617.1", "sequence_name": "", "sequence_id": ""}
|
||||
DATA_MANAGER_MANUAL_ID = 'toolshed.g2.bx.psu.edu/repos/iuc/data_manager_manual/data_manager_manual/0.0.2'
|
||||
DATA_MANAGER_MANUAL_INPUT = {
|
||||
"data_tables_0|data_table_name": "all_fasta",
|
||||
"data_tables_0|columns_0|data_table_column_name": "value",
|
||||
"data_tables_0|columns_0|data_table_column_value": "dm6",
|
||||
"data_tables_0|columns_1|data_table_column_name": "name",
|
||||
"data_tables_0|columns_1|data_table_column_value": "dm6",
|
||||
"data_tables_0|columns_2|data_table_column_name": "dbkey",
|
||||
"data_tables_0|columns_2|data_table_column_value": "dm6",
|
||||
"data_tables_0|columns_3|data_table_column_name": "path",
|
||||
"data_tables_0|columns_3|data_table_column_value": "dm6.fa",
|
||||
}
|
||||
DATA_MANAGER_MANUAL_INPUT_DBKEY = {
|
||||
"data_tables_0|data_table_name": "__dbkeys__",
|
||||
"data_tables_0|columns_0|data_table_column_name": "value",
|
||||
"data_tables_0|columns_0|data_table_column_value": "dm7",
|
||||
"data_tables_0|columns_1|data_table_column_name": "name",
|
||||
"data_tables_0|columns_1|data_table_column_value": "dm7",
|
||||
"data_tables_0|columns_2|data_table_column_name": "len_path",
|
||||
"data_tables_0|columns_2|data_table_column_value": "dm7.len",
|
||||
}
|
||||
SCRIPT_DIRECTORY = os.path.abspath(os.path.dirname(__file__))
|
||||
REFGENIE_CONFIG_FILE = os.path.join(SCRIPT_DIRECTORY, "refgenie.yml")
|
||||
|
||||
|
||||
class DataManagerIntegrationTestCase(integration_util.IntegrationTestCase, UsesShed):
|
||||
|
||||
"""Test data manager installation and table reload through the API"""
|
||||
|
||||
framework_tool_and_types = True
|
||||
use_shared_connection_for_amqp = True
|
||||
|
||||
def setUp(self):
|
||||
super().setUp()
|
||||
self.dataset_populator = DatasetPopulator(self.galaxy_interactor)
|
||||
|
||||
@classmethod
|
||||
def handle_galaxy_config_kwds(cls, config):
|
||||
try:
|
||||
import watchdog # noqa: F401
|
||||
except ImportError:
|
||||
raise SkipTest("watchdog library is not available")
|
||||
cls.configure_shed_and_conda(config)
|
||||
config["tool_data_path"] = cls.shed_tool_data_dir
|
||||
config["watch_tool_data_dir"] = True
|
||||
cls.username = cls.get_secure_ascii_digits()
|
||||
config["admin_users"] = "%s@galaxy.org" % cls.username
|
||||
config["refgenie_config_file"] = REFGENIE_CONFIG_FILE
|
||||
|
||||
def test_data_manager_manual_refgenie(self):
|
||||
"""
|
||||
Test that data_manager_manual works with refgenie enabled, which uses a significant amount of Galaxy-internal code
|
||||
"""
|
||||
self.install_repository('iuc', 'data_manager_manual', '1ed87dee9e68')
|
||||
with self._different_user(email="%s@galaxy.org" % self.username):
|
||||
with self.dataset_populator.test_history() as history_id:
|
||||
run_response = self.dataset_populator.run_tool(tool_id=DATA_MANAGER_MANUAL_ID,
|
||||
inputs=DATA_MANAGER_MANUAL_INPUT,
|
||||
history_id=history_id,
|
||||
assert_ok=False)
|
||||
self.dataset_populator.wait_for_tool_run(history_id=history_id, run_response=run_response, timeout=CONDA_AUTO_INSTALL_JOB_TIMEOUT)
|
||||
|
||||
entries = self._app.tool_data_tables.get("all_fasta").get_entries('dbkey', 'dm6', 'dbkey')
|
||||
assert 'dm6' in entries
|
||||
|
||||
self._app.tool_data_tables.get("all_fasta").remove_entry(self._app.tool_data_tables.get("all_fasta").to_dict(view="element")['fields'][0])
|
||||
entries = self._app.tool_data_tables.get("all_fasta").get_entries('dbkey', 'dm6', 'dbkey')
|
||||
assert entries is None
|
||||
|
||||
def test_data_manager_manual_refgenie_dbkeys(self):
|
||||
"""
|
||||
Test that data_manager_manual works with refgenie enabled, with a table defined first by refgenie
|
||||
"""
|
||||
self.install_repository('iuc', 'data_manager_manual', '1ed87dee9e68')
|
||||
with self._different_user(email="%s@galaxy.org" % self.username):
|
||||
with self.dataset_populator.test_history() as history_id:
|
||||
run_response = self.dataset_populator.run_tool(tool_id=DATA_MANAGER_MANUAL_ID,
|
||||
inputs=DATA_MANAGER_MANUAL_INPUT_DBKEY,
|
||||
history_id=history_id,
|
||||
assert_ok=False)
|
||||
self.dataset_populator.wait_for_tool_run(history_id=history_id, run_response=run_response, timeout=CONDA_AUTO_INSTALL_JOB_TIMEOUT)
|
||||
|
||||
entries = self._app.tool_data_tables.get("__dbkeys__").get_entries('name', 'dm7', 'name')
|
||||
assert 'dm7' in entries
|
||||
|
||||
self._app.tool_data_tables.get("__dbkeys__").remove_entry(self._app.tool_data_tables.get("__dbkeys__").to_dict(view="element")['fields'][0])
|
||||
entries = self._app.tool_data_tables.get("all_fasta").get_entries('name', 'dm7', 'name')
|
||||
assert entries is None
|
||||
|
||||
@classmethod
|
||||
def get_secure_ascii_digits(cls, n=12):
|
||||
return ''.join(random.SystemRandom().choice(string.ascii_lowercase + string.digits) for _ in range(12))
|
||||
Reference in New Issue
Block a user