mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Raise exception for if we're saving a historyless HDA
This commit is contained in:
@@ -2,6 +2,7 @@ name: API tests
|
||||
on: [push, pull_request]
|
||||
env:
|
||||
GALAXY_TEST_DBURI: 'postgresql://postgres:postgres@localhost:5432/galaxy?client_encoding=utf8'
|
||||
GALAXY_TEST_RAISE_EXCEPTION_ON_HISTORYLESS_HDA: '1'
|
||||
concurrency:
|
||||
group: api-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
@@ -3,6 +3,7 @@ on: [push, pull_request]
|
||||
env:
|
||||
GALAXY_TEST_DBURI: 'postgresql://postgres:postgres@localhost:5432/galaxy?client_encoding=utf8'
|
||||
GALAXY_TEST_USE_UVICORN: false
|
||||
GALAXY_TEST_RAISE_EXCEPTION_ON_HISTORYLESS_HDA: '1'
|
||||
concurrency:
|
||||
group: api-legacy-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
name: Converter tests
|
||||
on: [push, pull_request]
|
||||
env:
|
||||
GALAXY_TEST_RAISE_EXCEPTION_ON_HISTORYLESS_HDA: '1'
|
||||
concurrency:
|
||||
group: converter-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
@@ -65,4 +67,4 @@ jobs:
|
||||
if: failure()
|
||||
with:
|
||||
name: Converter test results (${{ matrix.python-version }})
|
||||
path: tool_test_output.html
|
||||
path: tool_test_output.html
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
name: Framework tests
|
||||
on: [push, pull_request]
|
||||
env:
|
||||
GALAXY_TEST_RAISE_EXCEPTION_ON_HISTORYLESS_HDA: '1'
|
||||
concurrency:
|
||||
group: framework-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
@@ -6,6 +6,7 @@ concurrency:
|
||||
env:
|
||||
GALAXY_TEST_DBURI: 'postgresql://postgres:postgres@localhost:5432/galaxy?client_encoding=utf8'
|
||||
GALAXY_TEST_AMQP_URL: 'amqp://localhost:5672//'
|
||||
GALAXY_TEST_RAISE_EXCEPTION_ON_HISTORYLESS_HDA: '1'
|
||||
jobs:
|
||||
test:
|
||||
name: Test
|
||||
|
||||
@@ -8,6 +8,7 @@ env:
|
||||
GALAXY_SKIP_CLIENT_BUILD: '0'
|
||||
GALAXY_TEST_SELENIUM_RETRIES: 1
|
||||
YARN_INSTALL_OPTS: --frozen-lockfile
|
||||
GALAXY_TEST_RAISE_EXCEPTION_ON_HISTORYLESS_HDA: '1'
|
||||
jobs:
|
||||
test:
|
||||
name: Test
|
||||
|
||||
@@ -8,6 +8,7 @@ env:
|
||||
GALAXY_TEST_SKIP_FLAKEY_TESTS_ON_ERROR: 'true'
|
||||
GALAXY_TEST_SELENIUM_RETRIES: 1
|
||||
YARN_INSTALL_OPTS: --frozen-lockfile
|
||||
GALAXY_TEST_RAISE_EXCEPTION_ON_HISTORYLESS_HDA: '1'
|
||||
jobs:
|
||||
test:
|
||||
name: Test
|
||||
|
||||
@@ -6,6 +6,7 @@ env:
|
||||
GALAXY_TEST_SELENIUM_RETRIES: 1
|
||||
GALAXY_TEST_SELENIUM_BETA_HISTORY: 1
|
||||
YARN_INSTALL_OPTS: --frozen-lockfile
|
||||
GALAXY_TEST_RAISE_EXCEPTION_ON_HISTORYLESS_HDA: '1'
|
||||
jobs:
|
||||
test:
|
||||
name: Test
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
Shared model and mapping code between Galaxy and Tool Shed, trying to
|
||||
generalize to generic database connections.
|
||||
"""
|
||||
import os
|
||||
import threading
|
||||
from contextvars import ContextVar
|
||||
from inspect import (
|
||||
@@ -108,6 +109,18 @@ def versioned_objects(iter):
|
||||
yield obj
|
||||
|
||||
|
||||
def versioned_objects_strict(iter):
|
||||
for obj in iter:
|
||||
if hasattr(obj, '__create_version__'):
|
||||
if not obj.history and not obj.history_id and obj.extension != 'len':
|
||||
raise Exception(f'HistoryDatsetAssociation {obj} without history detected, this is not valid')
|
||||
yield obj
|
||||
|
||||
|
||||
if os.environ.get("GALAXY_TEST_RAISE_EXCEPTION_ON_HISTORYLESS_HDA"):
|
||||
versioned_objects = versioned_objects_strict # noqa: F811
|
||||
|
||||
|
||||
def versioned_session(session):
|
||||
@event.listens_for(session, 'before_flush')
|
||||
def before_flush(session, flush_context, instances):
|
||||
|
||||
Reference in New Issue
Block a user