Commit Graph
31 Commits
Author SHA1 Message Date
John Chilton f1c2dde09f Protocol to try to break up app for cleaner tool shed install typing. 2023-09-26 13:46:53 -04:00
John Davis f8d28c2bf6 Wrap session.flush in test.unit.workflows 2023-06-09 13:05:26 -04:00
John Chilton abb69b552c Implement API endpoints and tests for workflow sharing options. 2022-04-13 15:37:43 -04:00
Dannon Baker 623a5e165a Apply black formatting.
Apply isort.
2022-02-03 07:42:20 -05:00
mvdbeek 6d22b6da28 Merge branch 'release_21.05' into dev 2021-06-10 15:37:59 +02:00
mvdbeek f6f4c7e6b7 Fix unit tests after removing get_tool_id 2021-06-10 08:53:49 +02:00
Sergey Golitsynskiy fb179aa66d Rename unit test helper classes (workflow support) 2021-06-01 15:08:17 -04:00
Sergey Golitsynskiy 0b094438e0 Enable pytest class-based tests; add flag if n/a 2021-06-01 12:30:25 -04:00
John Chilton 38fbd87c88 Use existing workflow_manager to load subworkflows in wf modules. 2021-01-03 19:52:28 -05:00
Nicola Soranzo 1ec1f515b3 Merge branch 'release_20.09' into dev 2020-12-09 19:35:39 +00:00
mvdbeek cdad7c79a9 Pass optional subworkflow inputs to editor
Fixes https://github.com/galaxyproject/galaxy/issues/10864
2020-12-08 12:29:59 +01:00
Nicola Soranzo 9d74bba7fb Drop support for retired Python 3.5
Upgrade syntax using `pyupgrade --py36-plus` .

Manually drop several `six` imports.

Also:
- Remove broken pr_cache in scripts/bootstrap_history.py
- Fix broken prefix removal in lib/galaxy/tool_util/deps/mulled/mulled_build.py
2020-10-07 11:52:13 +01:00
John Chilton 20d737cd09 Fix unit tests. 2019-12-10 21:21:31 -05:00
Dannon 65ddaefefa Merge pull request #7560 from jmchilton/refactor_security_helper
Refactor galaxy.web.security into galaxy.security.idencoding.
2019-03-20 11:18:28 -04:00
John Chilton 528497f7c4 Refactor galaxy.web.security into galaxy.security.idencoding.
I want to be able to use this class in galaxy.model and it doesn't have any dependnecies on "web" stuff so I'd like to move it out of galaxy.model and into galaxy.security. galaxy.model shouldn't have dependencies on galaxy.web (and doesn't after the recent 976f5ad367), so this pre-emptively ensures it doesn't require these dependencies for https://github.com/galaxyproject/galaxy/pull/7367.

This has the benefit of also eliminating any galaxy.web dependencies from the generic test base file (test/base/testcase.py) which has long been a goal of mine as well.

There are places we legimately use ID encoding and decoding for security (i.e. job files API) but for the most part it doesn't provide security for API endpoints and this causes confusion repeatedly, so I've started the process of renaming the contained class SecurityHelper to something I feel makes it clearer this is just about encoding and decoding IDs.
2019-03-19 14:28:31 -04:00
John Chilton 4a308130b3 Undo DynamicTool.tool_hash that is the part that is really half baked. 2019-03-19 14:22:41 -04:00
mvdbeek 667f8aa761 Only add collection_type if collection_type has been specified
We don't force the collection_type to be set in any way.
We might want to think about defaulting to list if not specified,
but that's not for now.
2019-01-28 17:12:50 +01:00
John Chilton 67efd072ae Track workflow step input definitions in our model.
We don't track workflow step inputs in any formal way in our model currently. This has resulted in some current hacks and prevents future enhancements. This commit splits WorkflowStepConnection into two models WorkflowStepInput and WorkflowStepConnection - normalizing the previous table workflow_step_connection on input step and input name.

In terms of current hacks forced on it by restricting all of tool state to be confined to a big JSON blob in the database - we have problems distinguishing keys and values when walking tool state. As we store more and more JSON blobs inside of the giant tool state blob - the worse this problem gets. Take for instance checking for runtime parameters or the rules parameter values - these both use JSON blobs that aren't simple values, so it is hard to tell looking at the tool state blob in the database or the workflow export to tell what is a key or what is a value. Tracking state as normalized inputs with default values and explicit attributes runtime values should allow much more percise state definition and construction.

This variant of the models would also potentially allow defining runtime values with non-tool default values (so default values defined for the workflow but still explicitly settable at runtime). The combinations of overriding defaults and defining runtime values were not representable before.

In terms of future enhancements, there is a lot we cannot track with the current models - such as map/reduce options for collection operations (https://github.com/galaxyproject/galaxy/issues/4623#issuecomment-389544980). This should enable a lot of that. Obviously there are a lot of attributes defined here that are not yet utilized, but I'm using most (all?) of them downstream in the CWL branch. I'd rather populate this table fully realized and fill in the implementation around it as work continues to stream in from the CWL branch - to keep things simple and avoid extra database migrations. But I understand if this feels like speculative complexity we want to avoid despite the implementation being readily available for inspection downstream.
2018-11-15 21:34:02 +01:00
E Rasche 32b85ecb59 Only permit yaml.safe_loading of data
Event trusted data, belt + suspenders method.
2017-09-25 11:39:12 +02:00
mvdbeek 64f8e74ade Fix subworkflow tests 2017-08-20 12:49:43 +02:00
Nicola Soranzo 21b44bf348 Fix all E201 and E202 style errors
using the following command:
```
autopep8 -i -r --exclude $(sed -e 's|^|./|' -e 's|/$||' .ci/flake8_blacklist.txt | paste -sd,) --select E201,E202 .
```
2017-08-17 11:35:39 +01:00
John Chilton a0177fe2f4 Add ability to import workflows without Galaxy modifying tool version.
Needed to test workflow tool upgrades when loading workflows, but I think it is good to have a way to preserve the original tool state as well for the sake of absolute reproducibility/tracibility.
2017-01-08 08:13:42 -05:00
Nicola Soranzo a8746c4f52 Fix import order and Python3 compatibility for test/unit/ 2016-11-16 10:29:09 +00:00
John Chilton 157939aa8f Implement nested workflows.
Details:

 - Add a new workflow module describing subworkflows.
 - Add workflow list to editor side panel - with options to link in a subworkflow module or copy the target workflow into the workflow being editted node for node.
 - Update workflow, workflow step, and workflow invocation models to track subworkflow connections and execution.
 - Extend workflow outputs with concepts of labels (and UUIDs while I'm there) to match workflow inputs. This allow us to have something to label outputs with in the workflow editor and to reference in the format 2 workflow description language.
 - Extend workflow editor UI to allow labeling workflow outputs (and enforce that these are unique across a workflow).
 - Extend workflow invocation and progress tracking to allow invoking a subworkflow as part of another workflow invocation.
 - Extend workflow import and export code to allow a nested representation of workflows.
 - Update format 2 workflow description to allow testing nested workflows.

Most relevant new and modified test cases can be run using the following commands:

```
./run_tests.sh -api test/api/test_workflows.py:WorkflowsApiTestCase.test_run_subworkflow_simple
./run_tests.sh -api test/api/test_workflows_from_yaml.py:WorkflowsFromYamlApiTestCase.test_subworkflow_simple
./run_tests.sh -api test/api/test_workflows_from_yaml.py:WorkflowsFromYamlApiTestCase.test_outputs
nosetests test/unit/test_galaxy_mapping.py
nosetests test/unit/workflows/test_workflow_progress.py
```
2015-12-16 15:22:18 +00:00
John Chilton 031a39aba8 Basic unit tests for workflow progress tracking. 2015-12-01 23:44:26 +00:00
John Chilton 21213ef70f Refactor workflow testing code to quickly bootstrap workflows. 2015-12-01 23:44:26 +00:00
John Chilton 7e45ca2a72 Allow multiple tools with the same id in ToolBox.
How to use:

 1.) Place multiple tools with different IDs in your tool conf.
 2.) ... ummm ... no step 2 - just use the tools.

Implementation:

The Tool Shed allows tool lineages by assigning each tool version a GUID and tracking versions in a database. This
implementation works by simply allowing the ToolBox to contain multiple tools with the same ID and orders them by the version specified by the tool author.

To track enable this a second tool lineage has been introduced that just uses tool versions instead of a database (non-toolshed installed tools are not longer placed into the Tool Shed install database). The ToolBox has been updated to allow multiple versions per tool id (defaulting to the 'latest' version for all operations which do not specify a version). Both jobs and workflow steps would track tool versions but did not use that version when fetching tools from the Toolbox - these components have been updated to try to use the tool version.

Unit tests working through most of the ToolBox and tool panel have been added, as well as functional tests exercising the tools API and to ensure workflows now at least attempt to respect tool versions (still kind of silently switches versions in some cases). Manual tests against the new tool form seem to demonstrate the tool switching and tool re-running work with only minor changes to the tools API and the job handler.
2014-12-31 18:21:10 -05:00
John Chilton 974a4c124f Introduce abstraction shielding toolbox.tools_by_id from galaxy.workflow.modules.
That was the last module outside of ToolBox itself that was accessing tools_by_id directly.
2014-12-26 09:55:27 -05:00
John Chilton f2735a693d Work on workflow module testing. 2014-09-11 16:01:08 -04:00
John Chilton 4dcfe4c561 Some very basic unit tests and docs for workflow modules.
Just a start - I need to keep going with this and test and document all methods.
2014-08-26 10:02:49 -04:00
John Chilton adfc7cec81 Normalize workflow step parameters earlier...
... this will allow linking to actual steps (referential integrity) if/when we store workflow requests in the database.

Also unit tests.
2014-08-10 14:05:31 -04:00