mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-10-13 08:51:38 +08:00
More verbose workflow extraction test cases.
This commit is contained in:
@@ -5,7 +5,7 @@ import operator
|
||||
from collections import namedtuple
|
||||
from json import dumps, loads
|
||||
|
||||
from base.populators import skip_without_tool
|
||||
from base.populators import skip_without_tool, summarize_instance_history_on_error
|
||||
|
||||
from .test_workflows import BaseWorkflowsApiTestCase
|
||||
|
||||
@@ -17,6 +17,7 @@ class WorkflowExtractionApiTestCase(BaseWorkflowsApiTestCase):
|
||||
self.history_id = self.dataset_populator.new_history()
|
||||
|
||||
@skip_without_tool("cat1")
|
||||
@summarize_instance_history_on_error
|
||||
def test_extract_from_history(self):
|
||||
# Run the simple test workflow and extract it back out from history
|
||||
cat1_job_id = self.__setup_and_run_cat1_workflow(history_id=self.history_id)
|
||||
@@ -29,6 +30,7 @@ class WorkflowExtractionApiTestCase(BaseWorkflowsApiTestCase):
|
||||
self.assertEqual(downloaded_workflow["name"], "test import from history")
|
||||
self.__assert_looks_like_cat1_example_workflow(downloaded_workflow)
|
||||
|
||||
@summarize_instance_history_on_error
|
||||
def test_extract_with_copied_inputs(self):
|
||||
old_history_id = self.dataset_populator.new_history()
|
||||
# Run the simple test workflow and extract it back out from history
|
||||
@@ -54,6 +56,7 @@ class WorkflowExtractionApiTestCase(BaseWorkflowsApiTestCase):
|
||||
self.__assert_looks_like_cat1_example_workflow(downloaded_workflow)
|
||||
|
||||
@skip_without_tool("random_lines1")
|
||||
@summarize_instance_history_on_error
|
||||
def test_extract_mapping_workflow_from_history(self):
|
||||
hdca, job_id1, job_id2 = self.__run_random_lines_mapped_over_pair(self.history_id)
|
||||
downloaded_workflow = self._extract_and_download_workflow(
|
||||
@@ -232,6 +235,7 @@ test_data:
|
||||
)
|
||||
|
||||
@skip_without_tool("collection_creates_pair")
|
||||
@summarize_instance_history_on_error
|
||||
def test_extract_with_mapped_output_collections(self):
|
||||
jobs_summary = self._run_jobs("""
|
||||
class: GalaxyWorkflow
|
||||
|
||||
@@ -92,6 +92,18 @@ def skip_without_datatype(extension):
|
||||
return method_wrapper
|
||||
|
||||
|
||||
def summarize_instance_history_on_error(method):
|
||||
@wraps(method)
|
||||
def wrapped_method(api_test_case, *args, **kwds):
|
||||
try:
|
||||
method(api_test_case, *args, **kwds)
|
||||
except Exception:
|
||||
api_test_case.dataset_populator._summarize_history(api_test_case.history_id)
|
||||
raise
|
||||
|
||||
return wrapped_method
|
||||
|
||||
|
||||
def _raise_skip_if(check):
|
||||
if check:
|
||||
from nose.plugins.skip import SkipTest
|
||||
|
||||
Reference in New Issue
Block a user