Commit Graph
451 Commits
Author SHA1 Message Date
John Chilton c3af6c8fea Serialize tool test descriptions through the API.
Use this is in tool testing. Prevents needing to load / have tools in memory to run tool tests - should allow external tool testing.
2018-03-06 20:07:51 -05:00
guerler 4af913f7df Fix visualization type 2018-02-11 14:37:25 -05:00
John Chilton 51e030f4f3 Bring in @mvdbeek's test cases from #5431. 2018-02-03 14:59:30 -05:00
John Chilton 8e32e93d6d Implement more collection workflow post job actions.
Implement hide, delete, add tag, and remove tag for output collections and mapped over collections.

Fixes https://github.com/galaxyproject/galaxy/issues/1680.
2018-02-02 13:29:57 -05:00
John Chilton f6f9f9a891 Extend mapped collection output rename PJAs to include # replacements.
Also make sure output collections in non-mapping scenarios are also properly renamed as well.
2018-02-02 09:52:44 -05:00
John Chilton 2b8df110d0 Apply rename PJA to collection outputs including $ replacements.
Update PJA collection test to test HDCA is renamed also.
2018-02-02 09:52:44 -05:00
Evgeny Anatskiy 90d59ac923 fix webhooks tests 2018-02-01 12:18:02 -05:00
mvdbeek cad17b07c3 Revert "Revert extra assertions that are causing unrelated issues to surface."
This reverts commit 4925660ab4.
2018-01-30 19:04:10 +01:00
mvdbeek eb506b25b9 Allow map-over when discovering dataset collections
This would affect for example the mapping over of fastq-dump (and all other
tools in the sra-toolkit).

If one had attempted this previously the discovery phase would fail with:
```
galaxy.tools.parameters.output_collect ERROR 2018-01-30 08:56:46,369 Problem gathering output collection.
Traceback (most recent call last):
  File "/bioinfo/guests/mvandenb/galaxy/lib/galaxy/tools/parameters/output_collect.py", line 169, in collect_dynamic_collections
    collection
  File "/bioinfo/guests/mvandenb/galaxy/lib/galaxy/managers/collections.py", line 216, in collection_builder_for
    return builder.BoundCollectionBuilder(dataset_collection, collection_type_description)
  File "/bioinfo/guests/mvandenb/galaxy/lib/galaxy/dataset_collections/builder.py", line 84, in __init__
    raise Exception("Cannot reset elements of an already populated dataset collection.")
Exception: Cannot reset elements of an already populated dataset collection.
```

Instead we force the collection state to be new when we are discovering output collection datasets,
which seems reasonable to me. This includes an API testcase that would have failed previously.
2018-01-30 14:48:42 +01:00
mvdbeek da3e48faa5 Mark rerun_with_use_cached_job as flakey
Sometimes it does not pick up the equivalent job that should exist. Will need
to dig into this, but in the meantime we can allow the test to fail.
2018-01-09 15:53:22 +01:00
mvdbeek 2f6cc22384 Copy element_identifier to resumed job
This fixes #5269.
2018-01-05 17:32:09 +02:00
mvdbeek 81c3b8cc4d Include more information in assertion 2017-12-31 18:06:49 +02:00
mvdbeek c327594ed7 Simplify use_cached_jobs workflow tests 2017-12-31 18:06:49 +02:00
mvdbeek 78c37d32d9 Assert that histories contains same dataset ids 2017-12-31 18:06:49 +02:00
mvdbeek 9d38219d65 Pass use_cached_jobs on to subworkflow invoker 2017-12-31 18:06:49 +02:00
mvdbeek 1c4476a6af Add a test for skipping jobs in workflow context
This is using the simplest of workflows. I had to
remove the chromInfo part from the workflow, because the
path referenced would be changed dynamically and so the
job search wouldn't recognize this as being equivalent.
2017-12-31 18:06:48 +02:00
mvdbeek 0dcf9d7fd6 Refine cached job tool test to make less asumptions 2017-12-31 18:06:48 +02:00
mvdbeek 4b6e403622 Add use_cached_job param to tools and workflow API
Also includes a simple test that runs cat1 three times,
the second time with `use_cached_job=False` (the default),
and the third time with `use_cached_job=True` and verifies
that the second output is different from the third, and that the
first and third output are identical.
2017-12-31 18:06:48 +02:00
mvdbeek 91696783b1 Uncomment test that relies on HDAHistory 2017-12-31 18:06:46 +02:00
mvdbeek e75daa1ddd Skip test that deletes the jobs input dataset
This does not work at the moment, since we need to verify a jobs' input name,
dataset and metadata, for which we don't have an explicit trail. The only trace
is via the update_time (i.e if a input dataset hasn't been updated since the
job was created we know these were the actual parameters in use during the
execution of this job).
2017-12-31 17:44:20 +02:00
mvdbeek 009daeff81 Fix the wildcard search 2017-12-31 17:44:20 +02:00
mvdbeek fc92adc1cc Take into account HDA name, metadata, element_identifier and datatype 2017-12-31 17:44:20 +02:00
mvdbeek c0dbace7bb Replace collection elements with re-run output
This specifically addresses the problem where some jobs of a mapped-over
collection have failed. Instead of filtering the failed collection and
restarting the workflow at this position (involving a lot of copy-paste ...)
the user can now limit the rerun to the problematic jobs and the workflow
should resume from there.
Should fix https://github.com/galaxyproject/galaxy/issues/2235.

This is one possible implementation, it would also be feasible to not
manipulate the original collection, but to copy the HDCA and then to replace
collection elements and replace all references for jobs that depend on the HDCA,
as we do for HDAs. This implementation seems simpler, but let me know if you
see problems with this approach.
2017-12-31 14:08:26 +02:00
mvdbeek 9fdf0a6269 Add job resume test with HDCA input to paused dataset
I am slightly surprised that this worked without change,
but it appears that the remapping occurs via the HDAs that
the HDCA is composed of.
2017-12-31 14:08:26 +02:00
mvdbeek 39073b4b4c Add test for resume job functionality
This test runs a workflow whose first step fails, followed by a tool that uses
the first step's output as an input, which is behind a nested conditional. This
recapitulates the bug described in https://github.com/galaxyproject/galaxy/issues/5222.
2017-12-31 14:07:42 +02:00
John Chilton 895e9971cb More upload configuration options testing - this time for libraries. 2017-12-19 16:09:44 -05:00
John Chilton 90ba35a9a4 Merge remote-tracking branch 'jmchilton/release_17.09' into merge_1709 2017-12-15 12:02:07 -05:00
mvdbeek 3f6c45578e Fix dataset spelling (thx @nsoranzo) 2017-12-15 16:13:32 +01:00
mvdbeek 710177f398 Add API tests for history uploads from URL 2017-12-14 17:21:09 +01:00
Björn Grüning c8d45dd4b3 Merge pull request #5143 from jmchilton/fix_missing_outputs
Re-allow workflow outputs that aren't produced during workflow scheduling.
2017-12-07 16:23:28 +01:00
John Chilton 4925660ab4 Revert extra assertions that are causing unrelated issues to surface.
The unrelated issues are serious problems though and I've created an issue to track them https://github.com/galaxyproject/galaxy/issues/5146.
2017-12-06 16:13:12 -05:00
John Chilton b1d6c017d0 Fixes for handling delayed steps within subworkflows.
With new test case to verify this fix is needed. The previous test case that was verifying collection mapping and rescheduling of subworkflows turned out to really be testing the connections with respect to the outer workflow since only the last step of the subworkflow required rescheduling iterations. This newer test case verifies the connections within the subworkflow also - in addition to re-testing the connections and mapping in the outer workflow.
2017-12-06 15:16:10 -05:00
John Chilton b7be4162bd Re-allow workflow outputs that aren't produced during workflow scheduling.
These are sort of an error in the workflow definition but we don't have a means to competently display this information to the user via the UI so I think we need to just allow this to happen.

I've attached a test case that exhibits this behavior and passes under 17.09 but fails under the current dev branch without these fixes. This was broken in https://github.com/galaxyproject/galaxy/commit/d5f98f49045bca351e982f17cac9386308089eeb when we started to actually persist pointers to workflow invocation outputs (as part of https://github.com/galaxyproject/galaxy/pull/5013).
2017-12-06 14:26:20 -05:00
Martin Cech fc18b504be Merge pull request #5108 from mvdbeek/merge_forward_17_09
Merge forward 17 09
2017-12-01 09:58:55 -05:00
mvdbeek 4dd05fc942 Merge branch 'release_17.09' into dev 2017-12-01 14:33:00 +01:00
Nicola Soranzo 48aca7dce8 Update to flake8-import-order 0.16 2017-12-01 11:09:57 +00:00
John Chilton 78df0e2cc5 Refactor populators for easier nested collection creation. 2017-11-30 10:32:37 -05:00
John Chilton ca09e803ae Dataset collection state UX test case. 2017-11-30 10:02:03 -05:00
John Chilton 0dceb5a553 Add element count to DatasetCollection objects.
There are no places where this count is not set atomically in one thread so this should not have any performance downsides versus the older approach of calculating it on the fly (which was very expensive).
2017-11-30 10:02:02 -05:00
John Chilton d69962e7f4 Implement model abstraction for `ImplicitCollectionJobs`.
These aggregate all the jobs contributing to an implicitly created HistoryDatasetCollectionAssociation.

- Model enhancements that allow this.
- API endpoint for jobs summary of history content (somewhat uniform across HDAs and HDCAs just for consistency).
- Test cases.
- Rework history contents API a bit to eliminate more costly state summary checks by default.
2017-11-30 10:02:02 -05:00
John Chilton 78babab645 Pre-build collections during mapping to be more recoverable.
Create mapped over collections ahead of time instead of at the end only if they are valid.

- This way if there is a problem that problem can be reported in the state of the mapped collection.
- This way datasets can just be hidden instead of displayed and then hidden (fixes #1790).
- I think this should improve performance and prevent locks because we no longer have conflicting threads trying to write dataset state.
- We populate the collection as we go so we can recover and continue scheduling the mapped step (needed for #3883)
2017-11-30 10:02:02 -05:00
John Chilton 9e471d3e97 Allow mapping over empty collections.
If one maps a tool over an empty collection, one should get an empty output collection for each of the tool's outputs.

This should have always been a valid operation I think, the code just wasn't quite structured right when the collection work was merged - there were too many places I was assuming the existence of at least one actual output or input that was mapped over to continue going. This reworks all of that and seems to handle empty collections appropriately.

Fixes #4025 (not being informing the user of the operation, but actually by allowing the operation - which it should be allowed I think).
2017-11-30 10:02:02 -05:00
John Chilton 0185e04a5b Test recover_mapping in conjunction with subworkflow executions. 2017-11-30 10:02:02 -05:00
John Chilton 64835c1e72 Three new worklfow test cases to verify mapping over workflows is possible.
- Simple mapping over an input dataset.
- Mapping that produces nested collections.
- Mapping over subworkflows.
2017-11-30 10:02:02 -05:00
John Chilton d5f98f4904 Formalize workflow invocation and invocation step outputs.
Workflow Invocations
--------------------

The workflow invocation outputs half of this is relatively straight forward. It is modelled somewhat on job outputs, output datasets and output dataset collections are now tracked for each workflow invocation and exposed via the workflow invocation API. This required adding new tables (linked to WorkflowInvocations and WorkflowOutputs) that track these output associations.

Previously one could imagine backtracking this information for simple tool steps via the WorkflowInvocationStep -> Job table, but for steps that have many jobs (i.e. mapping over a collection) or for non-tool steps such information was more difficult to recover (and simply couldn't be recovered from the API at all or even internally without significant knowledge of the underlying workflow).

Workflow Invocation Steps
-------------------------

Tracking the outputs of WorkflowInvocationSteps was not previously done at all, one would have to follow the Job table as well. A signficant downside to this is that one cannot map over empty collections in a workflow - since no such job would exist. Tracking job outputs for WorkflowInvocationSteps is not a simple matter of just attaching outputs to an existing table because we had no concept of a workflow step tracked - since there could be many WorklfowInvocationSteps corresponding to the same combination of WorkflowInvocation and WorkflowStep. That should feel wrong and that is because it is - when collections were added the possiblity of having many jobs for the same combination of WorkflowInvocation and WorkflowStep was added. I should have split WorkflowInvocationSteps into WorkflowInvocationSteps and WorkflowInvocationStepJobAssociations at that time but didn't. This commit now does it - effectively normalizing the ``workflow_invocation_step`` table by introducing the new ``workflow_invocation_step_job_association`` table.

Splitting up the WorkflowInvocationStep table this way allows recovering the mapped over output (e.g. the implicitly created collection from all the jobs) as well the outputs from the individual jobs (by walking WorkflowInvocationStep -> WorkflowInvocationStepJobAssociation -> Job -> JobToOutput*Association).

This split up involves failrly substantial changes to the workflow module interface. Any place a list of WorkflowInvocationSteps was assumed, I reworked it to just expect a single WorkflowInvocationStep. I vastly simplified recover_mapping to just use the persisted outputs (this was needed in order to also implment empty collection mapping in workflows). This also fixes a bug (or implements a missing feature) where Subworkflow moudles had no recover_mapping methods - so for instance if a tool that produces dynamic collections appeared anywhere in a workflow after a subworkflow step - that workflow would not complete scheduling properly.

Now that we have a way to reference the set of jobs corresponding to a workflow step within an invocation, we can start to track partial scheduling of such steps. This is outlined in https://github.com/galaxyproject/galaxy/issues/3883 and refactoring toward this goal is included here - including adding a state to WorkflowInvocationStep so Galaxy can determine if it has started scheduling this step and an index when scheduling jobs so it can tell how far into a scheduling things have gone as well as augmenting the tool executor to take a maximum number of jobs to execute and allow recovery of existing jobs for collection building purposes.

*Applications*

These changes will enable:

- A simple, consistent API for finding workflow outputs that can be consumed by Planemo for testing workflows.
- Mapping over empty collections in workflows.
- Re-scheduling workflow invocations that include subworkflow steps.
- Partial scheduling within steps requiring a large number of jobs when scheduling workflow invocations.
2017-11-30 10:02:01 -05:00
John Chilton 55aa7bce55 Test cases for mapping for outputs with filter statements.
Checked through tools-iuc and I couldn't find any tools that use the actual input data parameters in filter statements so I think it is a fairly good approximation to assume that all mapped jobs will either filter or not at least with current execution model.
2017-11-30 10:02:01 -05:00
John Chilton c076b3b6c5 Refactor workflow testing toward reuse via "populators".
Should allow more functionality to be shared between vanilla API tests and integration tests for various workflow scheduling options.
2017-11-30 10:02:01 -05:00
John Chilton 4e9ee22ebc More verbose workflow extraction test cases. 2017-11-30 10:02:01 -05:00
John Chilton 0ff639a29c More debugging in workflows API tests. 2017-11-30 10:02:01 -05:00
John Chilton a7c8edbaa4 Bug fix - expose proper element_identifier in tool action template expansions. (#5049)
xref https://github.com/galaxyproject/tools-iuc/commit/f57f1bf4816f212b83c08e0e3c3782ebba8b7d9a
2017-11-20 23:11:00 +01:00